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

Android Timestamp Retrieval Issue #102

Closed
bitcoinvsalts opened this issue Nov 1, 2016 · 6 comments
Closed

Android Timestamp Retrieval Issue #102

bitcoinvsalts opened this issue Nov 1, 2016 · 6 comments

Comments

@bitcoinvsalts
Copy link
Contributor

I am using:

"firebase": "3.5.2",
"react-native-firestack": "^2.3.2",

Here is my code:

firebaseApp.database.ref('posts/').once('value')
.then((snapshot) => {
console.log(snapshot.val());
})

iOS returns:

{ puid: '-KVUuw6uVjl-C1YlhTJh',
timestamp: 1478004295851,
title: 'the first one is not a big ',
name: 'Herve',
text: 'Bill Clinton and the rest. the first to review this information ' },
'-KVUv2CJTJjJKEtvJTtF':
{ puid: '-KVUv2CJTJjJKEtvJTtF',
timestamp: 1478004324872,
title: 'the 8th of my own business and the ',
name: 'Herve',
text: 'the new one of those days ago, ' },
'-KVUuafD4WokUBgQsz53':
{ puid: '-KVUuafD4WokUBgQsz53',
timestamp: 1478004207992,
title: 'hey man. he is the most ',
name: 'Herve',
text: 'hey man. he is the best way for me to ' } }

But in Android:

{ '-KVUv2CJTJjJKEtvJTtF':
{ title: 'the 8th of my own business and the ',
timestamp: 535575048,
text: 'the new one of those days ago, ',
puid: '-KVUv2CJTJjJKEtvJTtF',
name: 'Herve' },
'-KVUuw6uVjl-C1YlhTJh':
{ title: 'the first one is not a big ',
timestamp: 535546027,
text: 'Bill Clinton and the rest. the first to review this information ',
puid: '-KVUuw6uVjl-C1YlhTJh',
name: 'Herve' },
'-KVUuafD4WokUBgQsz53':
{ title: 'hey man. he is the most ',
timestamp: 535458168,
text: 'hey man. he is the best way for me to ',
puid: '-KVUuafD4WokUBgQsz53',
name: 'Herve' } }

As you can see, the timestamp returns with android is wrong, any idea why?

@BlooJeans
Copy link
Contributor

Perhaps a clue for you:
Sounds like the symptoms of timestamps (which are longs in java) getting cast to ints, but that should have been fixed in #79

@bitcoinvsalts
Copy link
Contributor Author

if I rename timestamp to another name like time, I have the same issue.

@auser
Copy link
Contributor

auser commented Nov 1, 2016

Hm... good question... are you using npm or master @jsappme ?

@bitcoinvsalts
Copy link
Contributor Author

not sure what do you mean
I am using yarn with "react-native-firestack": "^2.3.2",

@auser
Copy link
Contributor

auser commented Nov 1, 2016

Ah, can you pull the latest master branch?

git clone https://github.com/fullstackreact/react-native-firestack node_modules/react-native-firestack

Or follow the instructions on the README. I haven't updated the npm module yet with #79

@bitcoinvsalts
Copy link
Contributor Author

I am getting this error:

/Users/herve76/Desktop/react-native-firebase-starter/android/app/src/main/java/me/jsapp/MainApplication.java:30: error: constructor FirestackPackage in class FirestackPackage cannot be applied to given types;
new FirestackPackage(getApplicationContext())
^
required: no arguments
found: Context
reason: actual and formal argument lists differ in length
1 error
:app:compileDebugJavaWithJavac FAILED

@auser auser closed this as completed Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants