我在使用 FB auth 的 iOS 应用程序中收到此警告消息:
错误:此端点已被弃用。要暂时重新启用它,您可以禁用“august_2012”平台迁移。将于 2012 年 8 月 1 日永久禁用。
问题是暂时禁用该迁移。但是,它已经被禁用,所以不确定如何快速解决这个问题 - 而不是更新应用程序并将其推回商店(我们将这样做)。
最佳答案
我通过使用最新的 ShareKit 版本 (0.2.1) 解决了这个问题,该版本是我从 GitHut 下载的。但同样的版本也可以在 getsharekit.com/install 上找到。 .
接下来,我通过拖放到我的 XCode 项目中(像往常一样)添加了位于“Classes”中的文件夹“ShareKit”。
出于安全考虑,之前的配置文件已改为类。在“DefaultSHKConfigurator.m”类中设置共享服务(FB、Twitter...)的配置数据。 (顺便说一句。我对 DefaultSHKConfigurator 进行了子类化,因此我仍然拥有原始结构)
要设置 FB,请更改设置:
- (NSString*)facebookAppId {
return @"..."; //app-id from facebook (create fb-app first, if not already done)
}
- (NSString*)facebookLocalAppId {
return @"";
}
比在应用程序中:didFinishLaunchingWithOptions: 方法中,设置 ShareKonfiguration。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
DefaultSHKConfigurator *configurator = [[DefaultSHKConfigurator alloc] init];
[SHKConfiguration sharedInstanceWithConfigurator:configurator];
[configurator release];
//init the rest
..
}
之后,添加一个 URL 方案(在 XCode 4.x 中选择您的项目,选择一个目标,单击“添加”->“添加 URL 类型”)并将 URL 方案设置为“fb+您的 fb-app id” “(我的看起来像“fb35486..”)。
要让 FB 打开您的应用并且用户能够立即发布内容,请添加
- (void) openFBWithURL:(NSURL*) URL {
if (URL != nil) {
NSString* scheme = [URL scheme];
NSString* prefix = [NSString stringWithFormat:@"fb%@", SHKCONFIG(facebookAppId)];
if ([scheme hasPrefix:prefix]) {
[SHKFacebook handleOpenURL:URL];
}
}
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
[self openFBWithURL:url];
return YES;
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
[self openFBWithURL:url];
return YES;
}
然后它应该已设置并准备好使用。
关于Facebook - "august_2012"平台迁移问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10622720/