Facebook.logInWithReadPermissionsAsync crashes with specific permissions

When requesting the following set of permissions, the expo client will crash both on the simulator and iOS (haven’t tested android).

Permissions that cause crashes:

  • ads_management
  • manage_pages
  • publish_pages

I looked at the device logs, and the only relevant line is Service exited with abnormal code: 1.

1 Like

Hi Eric-

That’s frustrating. Sorry to hear it.

Is there any chance you could provide the code you’re using to help us reproduce the problem and then fix it? Ideally in a Snack ( http://snack.expo.io/ )

Here you go: https://snack.expo.io/S1B9sQIHG

Hey @ericcoleman – we are working on issues with our social login APIs now and will respond as we look into this!

We use permissions: [‘public_profile’, ‘email’] and FB login crashes on IOS.

@ericcoleman I debugged your example and the exception says Publish or manage permissions are not permitted to be requested with read permissions.

I’ll try to make it no crash but just reject properly.

@aalices how did you manage to get the error? Even the snack crashes expo.

As for requesting both, I just noticed the 3 listed caused a crash…

Also, just requesting ads_management permission by itself also crashes the simulator, device, and snack.

We’re seeing the same problem, manage_pages is crashing expo client.

Just requesting one of these permissions causes the app crash, as noted above. So what would be the workaround here? Do we just need to eject from expo and use the native facebook SDK?

It’s not intentional for the app to crash when asking for extra permissions – at most the native layer should throw an async JS error that you can handle, and perhaps it shouldn’t err at all but we’ll need to look more at the FB SDK documentation. I’ve created an internal issue to track this.

Is there anyway to request this permission? I’ve read that this error happens elsewhere (in other sdk’s) because you are specifying the “manage_pages” permssion as a readPermission, not a writePermission. That might be whats happening here.

Write permissions aren’t supported (but still shouldn’t outright crash).

The reason is related to FB SDK, but I am about to make it not crash Expo but reject properly.

How should i request a write permission then? Is ejecting and using the FB SDK the only option in this case?

I would recommend looking into uri Linking: https://stackoverflow.com/a/5707825 Basically you can send someone to the facebook app with a post queued up. FBSDK is a scary framework :dizzy_face: and Facebook / iOS relations have been shifting a lot in iOS 11. Sending a user directly to the app with your content ready would be the most stable move regardless of Expo

Hello expo team, thank you for your response on this issue. We’re an x-googler startup using Expo and are currently blocked by this issue. manage_pages is not just a write permission, it’s also the primary permission needed to access the new Instagram Graph API. Without this permission the APi is completely locked out.
See https://developers.facebook.com/docs/instagram-api/getting-started
“You’ll need manage_pages to get your Page’s ID, which you can then use to get your Instagram Business Account ID.”

It’s unfortunate that facebook made decision to overload this permission for both, getting IDs and writes, but that is the reality we’re in.

Can you suggest any workarounds for ti? Facebook appears to be sunsetting the original instagram API so this will effect more users in the near future.

See full deprecation schedule here:

We will be deprecating the older Instagram API Platform in three phases with complete deprecation occurring in early 2020.
The following will be available until July 31, 2018:

Follower List - to read the list of followers and followed-by users
Relationships - to follow and unfollow accounts on a user’s behalf
Commenting on Public Content - to post and delete comments on a user’s behalf on public media

1 Like

At the moment I don’t think there is anyway to perform the direct actions you require without detaching :frowning:️ here is a canny request for publish permissions: https://expo.canny.io/feature-requests/p/loginwithpublishpermissions-for-facebook-api

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