I'm having problems implementing this functionality after following Facebook's tutorial: https://developers.facebook.com/docs/howtos/share-appid-across-multiple-apps-ios-sdk/
Basically, I have 2 targets under the same project - one for the free version and one for the premium. I have created and set up a single Facebook app for this and added 2 url scheme suffixes:
Also, I've added the suffixes within the respective plist files. For example, the premium app is defined with:
Where the "xxxxx..." is just my Facebook app ID.
After all this, I still can't log in to the application on iOS 5.0 and 6.0 (using native FB dialog or the SDK dialog within Safari). This is what I get when I log in via Safari:
The code doing the login is:
NSArray *permissions = kInitialPermissions;
BOOL result = NO;
FBSession *session = [[FBSession alloc] initWithAppID:@"xxxxxxxxxxx"
permissions:@[]
urlSchemeSuffix:@"premium"
tokenCacheStrategy:nil];
if (allowLoginUI ||
(session.state == FBSessionStateCreatedTokenLoaded)) {
[FBSession setActiveSession:session];
}
result = [FBSession openActiveSessionWithReadPermissions:permissions
allowLoginUI:allowLoginUI
completionHandler:completion];
return result;
Any ideas will be appreciated. Thanks!
As well as adding the fbxxxxxxxxxxpremium URL Scheme to the the URL Types array in the plist file (which you seem to be doing), add a new key/value:
key = FacebookUrlSchemeSuffix
value = premium
So in the plist file itself:
<key>FacebookUrlSchemeSuffix</key>
<string>premium</string>
This fixed it for me. The Facebook docs make reference to this but don't make it clear IMO.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With