iPhone app rejection 17.2: app requires users sign in with their Facebook accounts

自古美人都是妖i 提交于 2019-12-08 01:43:05

问题


I followed the login instructions for my native iOS app here https://developers.facebook.com/docs/mobile/ios/build/

I have everything facebook in the AppDelegate in application:didFinishLaunchingWithOptions:

facebook = [[Facebook alloc] initWithAppId:@"xyzabc" andDelegate:self];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

if ([defaults objectForKey:@"FBAccessTokenKey"] 
    && [defaults objectForKey:@"FBExpirationDateKey"]) {
    facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
    facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}


if (![facebook isSessionValid]) {
    NSArray *permissions = [[NSArray alloc] initWithObjects:
                            @"publish_stream", 
                            nil];
    [facebook authorize:permissions];

}

The problem is that my app opens and I require people to be logged in to facebook to use the features in my app. Apple rejected me saying the Facebook feature should be optional rather than forced (listed under rejection reason 17.2).

I was just wondering if I can keep most everything in the app delegate, but put the

    if (![facebook isSessionValid]) {
        NSArray *permissions = [[NSArray alloc] initWithObjects:
                                @"publish_stream", 
                                nil];
        [facebook authorize:permissions];
}

somewhere else (like when a login to facebook button is pressed). If this is the case, should the facebook documentation be updated so no one else gets rejected? Or maybe I missed something where I can keep that in the app delegate, but call something else to make login optional?

Thanks in advance for your help!


回答1:


What I did to solve this is I moved all the Facebook code from -applicationDidFinishLaunching to a custom method -createFBInstance that I called from a UIViewController whenever a UIButton was pressed so now the user only logs in to Facebook when a button is clicked and the app works great! Just make sure you only use the methods from the FBSessionDelegate inside your delegate I could never make it work in any other class. I also opened up the login web page in a web view inside the app so it looks much nicer.




回答2:


Of course it will be rejected. 17.2 says Apps that require users to share personal information, such as email address and date of birth, in order to function will be rejected. There is no way for users to use your application until they have facebook account. Instead I suggest you keep it optional like login with facebook/Google and have your application's own registration procedure.



来源:https://stackoverflow.com/questions/11728585/iphone-app-rejection-17-2-app-requires-users-sign-in-with-their-facebook-accoun

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