facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 908 forks source link

Avoid app crashing on access token change #744

Closed syaau closed 4 years ago

syaau commented 4 years ago

The access token change event is broadcasted from AccessTokenTracker during app start, even before the react-native has fully initialized. This results in a RuntimeException while trying to retrieve the JSModule from context. This is just a safe escape hatch to avoid app crashing. A more robust solution might be deferring the change event after the react-native initializes.

Fixes #726

syaau commented 4 years ago

@chakrihacker Can you look into this ? Our app's top crash report on play store is resolved by this.

chakrihacker commented 4 years ago

Hi @syaau how to reproduce the issue in order to test??

syaau commented 4 years ago

@chakrihacker I have tried a lot of different things, but I haven't been able to reproduce it yet. I had the app crash on my Android device once during app start and that was it. But when I look at the play store data, around 0.5% of the users have reported this crash. And this is on the top of the list.

chakrihacker commented 4 years ago

OK, having try catch is always good 👋 , let the facebook devs take decision about it

janicduplessis commented 4 years ago

I'm fine with that change, better than crashing!