我想让我的新用户在提示他们创建Simperium帐户之前稍微使用该应用程序。我该如何控制授权?
我以前可以打电话:
self.simperium.authenticationEnabled = NO;
直到我希望Simperium提示用户登录,此时我会致电:
simperium.authenticationEnabled = YES;
[simperium authenticateIfNecessary];
唉,authenticationEnabled
似乎不再可用了。我目前正在使用develop
分支。
谢谢!
答案 0 :(得分:1)
在新的api中,您可以按照以下步骤操作:
初始化Simperium(反过来,连接你的核心数据堆栈):
self.simperium = [[Simperium alloc] initWithModel:self.managedObjectModel 背景:self.managedObjectContext 协调器:self.persistentStoreCoordinator];
一旦您准备好启用同步(并因此对用户进行身份验证):
[_ simperium authenticateWithAppID:@" {SIMPERIUM_APP_ID}" APIKey:@" {SIMPERIUM_APP_KEY}" RootViewController的:_window.rootViewController];
(无需再翻转authenticationEnabled标志!) 希望有所帮助!