iOS requestAccessToAccountsWithType is Not Showing Permission Prompt / NSAlert

前端 未结 2 1588
忘掉有多难
忘掉有多难 2021-01-19 17:27

It is my understanding that when I invoke [ACAccountStore requestAccessToAccountsWithType:options:completion], the user is supposed to see an UIAlert that asks

相关标签:
2条回答
  • 2021-01-19 17:49

    You are actually missing a key: ACFacebookAudienceKey. You can change it like that:

    NSDictionary *options = [[NSDictionary alloc] initWithObjectsAndKeys:
                                     (NSString *)ACFacebookAppIdKey, @"##########",  
                                     (NSString *)ACFacebookPermissionsKey, [NSArray arrayWithObject:@"email"],
                                     (NSString *)ACFacebookAudienceKey, ACFacebookAudienceEveryone,
                                     nil];
    

    By the way, when you are using Twitter, the options must be nil.

    0 讨论(0)
  • 2021-01-19 17:54

    You have inverted objects and keys in your options dictionary :

    NSDictionary *options = [[NSDictionary alloc] initWithObjectsAndKeys:
                             @"##########",  ACFacebookAppIdKey,
                             [NSArray arrayWithObject:@"email"], ACFacebookPermissionsKey,
                             nil];
    
    0 讨论(0)
提交回复
热议问题