Facebook Expires return Promise

#1

Hi ! I’m a beginner with react native, and i took a project midway, so sorry if my question is basic, but i haven’t found an answer.

So i connect to the app via Facebook, using Expo. I use the token to stay connected and (WIP) to create user in the database. But i need the expiration date of the token if i want to know if i need to ask a new one to fb.

When i console.log expires that i previously stocked in AsyncStorage, it gives me a Promise object that i don’t know how to handle.

Promise {
"_40" : 0,
"_55": null,
"_65" : 0,
"_72": null,
}

How can i transform this into something usable ?

0 Likes

#2

No apologies needed! You’ll need to fulfill the promise by doing something like const result = await resultPromise;
I’d recommend reading up on promises and async/await since they are so central to how react-native works :slight_smile:

1 Like

closed #3

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.

0 Likes