Expo.Facebook.logInWithReadPermissionsAsync crashes app on login on android 6.0.1

Hi all,

My expo app is currently crashing without error messages or any other indication (except returning to the expo splash screen, restarting the app and showing build output in the console) when finishing the facebook login procedure invoked with Expo.Facebook.logInWithReadPermissionsAsync.

This happens both on the expo published app and on the standalone app, but only on my android testing phone (though my iOS tests have been limited to 1 iphone 7). The android version is 6.0.1. Friends have reported that the login does work correctly on standalone on their newer android phones (don’t know the version but the phone was bought a few months ago).

My code:

const LoginFacebook = api => function* loginFacebook(action) {
  try {
    console.log('This prints to console')
    const authResult = Expo.Facebook.logInWithReadPermissionsAsync(Expo.Constants.appOwnership === 'standalone' ? 'redacted' : 'redacted', {
      permissions: ['email'],
    }); 
    console.log('This does not print to console')
    if (authResult.type === 'success') {
      const result = yield call(
        api.loginFacebook(action),
        authResult.token,
      );  
      yield put(actions.finishLogin(
        result.token,
        result.user,
        result.profileCompleteness,
      )); 
      yield call(AsyncStorage.setItem, 'authToken', result.token);
      yield call(AsyncStorage.setItem, 'userId', result.user.id);
      yield call(AsyncStorage.setItem, 'user', JSON.stringify(result.user));
      yield call(action.onSuccess, result.profileCompleteness);
    } else {
      throw new Error();
    }   
  } catch (err) {
    console.log(err);
    yield put(actions.failLogin());
  }
};

This is the last screen I see before the crash: https://support.swiftkey.com/hc/user_images/qsAjvZKPUznGPtgjYrbNiQ.png

After I click the continue button, the app will restart without further ado.

Any help diagnosing this would be appreciated. I understand that this is a pretty old version of android and so would not be a priority, but I wanted to at least report it.

Thanks!

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