iOS SSO with multiple apps

扶醉桌前 提交于 2019-12-19 10:46:08

问题


I've searched for an answer to this question and have been unable to find any answers.

I've got a range of iOS apps that I want to use the same Facebook app. The SSO works perfectly with the first app I created and tested on. But all the other fail and get returned an unknown_error.

I'm calling:

self.facebook = [[[Facebook alloc] initWithAppId:<app id> urlSchemeSuffix:<app suffix> andDelegate:self] autorelease];

This is all working and even when the sign ins are failing I am returned back to the correct app. However, each time my the:

- (void)fbDidNotLogin:(BOOL)cancelled

method get called where cancelled equals NO.

Are there some other settings I need to change somewhere? Is this because my apps have not yet been submitted to the App Store (except the one that is working)? If that's the case, how am I meant to test this stuff?

Thanks, Daniel


回答1:


I found the useful "unknown_error" message only occurred when authenticating via the iOS Facebook app.

A quick and dirty workaround is to force the Facebook SDK to use mobile safari for authentication. Look for [self authorizeWithFBAppAuth:YES safariAuth:YES] in Facebook.m and change the FBAuth value.

Not the nicest solution... but if you need a project out of the door... ;)




回答2:


I was having the same problem as described above. The way I fixed it was to make sure that all of the Bundle IDs of the iOS apps that are sharing the Facebook app are listed.

As you can see in the picture, I have two URL Scheme Suffixes and the blurred out portions are the Bundle IDs of the apps that are connecting to this facebook app. Since it's a free and paid version, I only use one App Store ID so the posts from the free version will link to the paid version App Store link.

Hope this helps!



来源:https://stackoverflow.com/questions/7915296/ios-sso-with-multiple-apps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!