objective-c – Facebook Connect Safari无法打开页面

objective-c – Facebook Connect Safari无法打开页面,第1张

概述我正在使用faceobok connect和下面的官方Facebook教程: https://developers.facebook.com/docs/mobile/ios/build/ 现在,当我模拟它进入Facebook然后它是关于应用程序的东西,你按完了.当我按完了它时,sais safari无法打开页面,因为它是一个无效的地址.这是我的房源清单: 这是我的代码: - (BOOL)appli 我正在使用faceobok connect和下面的官方Facebook教程:
https://developers.facebook.com/docs/mobile/ios/build/
现在,当我模拟它进入Facebook然后它是关于应用程序的东西,你按完了.当我按完了它时,sais safari无法打开页面,因为它是一个无效的地址.这是我的房源清单:

这是我的代码:

- (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];    }} }

物业清单:

<?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>
解决方法 你的CFBundleURLSchemes键看起来不对,对于那个应用它应该是fb387500177929927,而不是387500177929927

从the docs起

Create a new row named URL types with a single item,URL Schemes,containing a single value,fbYOUR_APP_ID (the literal characters fb followed by your app ID).

总结

以上是内存溢出为你收集整理的objective-c – Facebook Connect Safari无法打开页面全部内容,希望文章能够帮你解决objective-c – Facebook Connect Safari无法打开页面所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1010939.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存