Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getServerTime returns an object with an invalid date #910

Closed
idlework opened this issue Mar 26, 2018 · 1 comment
Closed

getServerTime returns an object with an invalid date #910

idlework opened this issue Mar 26, 2018 · 1 comment
Labels
help: needs-tests Needs a test case adding to the project tests. help: needs-triage Issue needs additional investigation/triaging. platform: android platform: ios plugin: database Firebase Realtime Database

Comments

@idlework
Copy link

Issue

For iOS when I request a server time with getServerTime it return an object with an Invalid Date. When I call getServerTime a second time it returns a correct date. The following code shows it: console.log(typeof firebase.database().getServerTime() // shows: Invalid Date) console.log(typeof firebase.database().getServerTime()) // shows: Mon Mar 26 2018 18:01:53 GMT+0200 (CEST)

This is how it shows when tested on a iOS device, with an Android device it always return the Invalid Date object.

The Invalid Date object is probably generated by the Chrome console because it can't handle the object.

Environment

Both

  1. Application Target Platform:

macOS Sierra: 10.12.6 (16G1212)

  1. Development Operating System:

iOS build has a minimum requirement of iOS 10

Android build settings

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "2.0"
    }
}
  1. Build Tools:

react-native command line

  1. React Native version:

"react-native": "0.51"

  1. RNFirebase Version:

"react-native-firebase": "^3.3.1"

  1. Firebase Module:

iOS libraries

pod "FirebaseCore", "~> 4.0.15"
  pod "Firebase/Auth"
  pod "Firebase/Database"
  pod "Firebase/DynamicLinks"
  pod "Firebase/Firestore"
  pod "Firebase/Messaging"
  pod "Firebase/Storage"

  pod 'Fabric', '~> 1.7.2'
  pod 'Crashlytics', '~> 3.9.3'

Android libraries

compile "com.android.support:appcompat-v7:26.0.2"
    compile "com.facebook.react:react-native:+"
    compile "com.google.android.gms:play-services-base:11.8.0"
    compile "com.google.android.gms:play-services-auth:11.8.0"
    compile "com.google.android.gms:play-services-maps:11.8.0"
    compile "com.google.android.gms:play-services-gcm:11.8.0"
    compile "com.google.firebase:firebase-core:11.8.0"
    compile "com.google.firebase:firebase-analytics:11.8.0"
    compile "com.google.firebase:firebase-auth:11.8.0"
    compile "com.google.firebase:firebase-database:11.8.0"
    compile "com.google.firebase:firebase-firestore:11.8.0"
    compile "com.google.firebase:firebase-invites:11.8.0"
    compile "com.google.firebase:firebase-messaging:11.8.0"
@Salakar Salakar added platform: android platform: ios plugin: database Firebase Realtime Database help: needs-triage Issue needs additional investigation/triaging. labels Mar 26, 2018
@Salakar Salakar added this to the v4.0.0 Release milestone Mar 26, 2018
@Salakar Salakar added the help: needs-tests Needs a test case adding to the project tests. label Mar 26, 2018
@chrisbianca
Copy link
Contributor

This has been fixed and will be included in the next v4 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: needs-tests Needs a test case adding to the project tests. help: needs-triage Issue needs additional investigation/triaging. platform: android platform: ios plugin: database Firebase Realtime Database
Projects
None yet
Development

No branches or pull requests

3 participants