How to access facebookAppId key defined in app.json

#1

Hello.

In my app I’m trying to implement Facebook login. I’m following the tutorial (https://docs.expo.io/versions/latest/sdk/facebook/) and it says I need to use Facebook.logInWithReadPermissionsAsync(appId, options) - and now - I already have the appId defined in my app.json, because apparently I have to, according to the tutorial.

And now, to avoid repeating myself, I would like to fetch it, but Constants.manifest.facebookAppId gives ‘undefined’ even when I can access other things, like Constants.manifest.facebookScheme or …version.

What am I missing here?

Ah, and by the way, why https://docs.expo.io/versions/latest/sdk/constants.html brings " An unexpected error has occurred."? Shouldn’t this be 404 or something? Or there indeed are some server side issues now?

#2

Interesting, I’m looking at my implementation, and the only thing I have set in my app.json is the facebookScheme. I just then use a config module to store my facebook app id so I can manage and import it where I need it.

1 Like
#3

Thanks @breadboxio , this is what I’ll do :slight_smile:

Still however I don’t understand why the key is not accessible, like the others :man_shrugging: