Facebook Connect Safari cannot open page

HI I use faceobok connect and the official Facebook tutorial below: https://developers.facebook.com/docs/mobile/ios/build/ Now, when I simulate it, it goes to Facebook, then it says something about the application. and you click on it. When I click, sais safari cannot open the page because it is an invalid address. Here is a list of my properties:

Here is my code:

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { return [facebook handleOpenURL:url]; } // For iOS 4.2+ support - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [facebook handleOpenURL:url]; } - (void)fbDidLogin { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"]; [defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"]; [defaults synchronize]; } -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex: (NSInteger)buttonIndex { if (buttonIndex == 0) { // facebook facebook = [[Facebook alloc] initWithAppId:@"387500177929927" 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]) { [facebook authorize:nil]; } } } 

Property List:

  <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>387500177929927</string> </array> </dict> </array> </plist> 
+4
source share
1 answer

Your CFBundleURLSchemes key does not look right, for this application it should be fb387500177929927 , not 387500177929927

From documents

Create a new line with the URL type names with one element, URL schemes containing one value, fbYOUR_APP_ID (literal characters fb and then your application identifier).

+4
source

Source: https://habr.com/ru/post/1400733/


All Articles