3

我在使用 FB auth 的 iOS 应用程序中收到此警告消息:

ERROR:This endpoint has been deprecated.To temporarily reenable it,you may disable the "august_2012" platform migration. It will be disable permanently on August 1,2012.

问题是暂时禁用该迁移。但是,它已经被禁用了,所以不知道如何快速解决这个问题——而不是更新应用程序并将其推回商店,我们将这样做。

4

1 回答 1

0

我通过使用从GitHut下载的最新 ShareKit 版本 (0.2.1) 解决了这个问题,但同样的版本也可以在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 @"";
}

比在 application:didFinishLaunchingWithOptions: 方法中,设置 ShareKonfiguration。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

DefaultSHKConfigurator *configurator = [[DefaultSHKConfigurator alloc] init];

[SHKConfiguration sharedInstanceWithConfigurator:configurator];

[configurator release];

//init the rest
..
}

之后,添加一个 URL Scheme(在 XCode 4.x 中选择你的项目,选择一个目标,单击“Add”->“Add URL Type”)并将 URL Scheme 设置为“fb+your 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;
}

比它应该设置并准备好使用。

于 2012-08-08T08:44:04.590 回答