简体   繁体   中英

Share 1 Facebook App ID with multiple iOS Apps using ACAccountStore

I have an iOS app configured to use Facebook login via iOS's ACACcountStore. I'm not using the Facebook SDK.

I'm creating another app (for the same company) and I'm trying to take advantage of the existing Facebook App that I've set up for the first iOS app.

I've read that you can add multiple bundle ids in the Facebook App's Settings. I've done this, but unfortunately, I get an ACErrorPermissionDenied error when trying to log in.

Using iOS's built in Facebook login, am I able to share one Facebook App Id with multiple iOS apps with different bundle ids?

Ahh, figured it out.

The good news is that this is definitely possible. Just go into your Facebook app's settings and add another bundle id.

Make sure that the bundle id you've set in your app is exactly the same as the one you add to facebook.

In my case, I was formatting part of my bundle id like so:

com.myApp.${MY_CUSTOM_BUNDLE_ID_SUFFIX:rfc1034identifier}.

MY_CUSTOM_BUNDLE_ID_SUFFIX is a User-Defined setting in my Target's Build Settings. I had it set to:

foo.bar

When processed with the rfc1034identifier, the . was converted to a - so it ended up being com.myApp.foo-bar , so the mismatch is what was causing login to fail.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM