我的应用程序允许典型的注册(电子邮件、用户名、密码等),但也可以通过 Parse 启用 Facebook/Twitter 注册/唱歌。如果可能的话,如果用户使用 Facebook 或 Twitter 登录,我想避免强制用户登录两次。目前,我添加了“Scringo”的程序化注册功能,让用户使用与我的应用程序相同的凭据登录“scringo”;然而。如果他们在 Facebook 上注册怎么办?用户使用 Facebook 登录,然后滑过一个栏,然后访问消息传递组件以强制再次使用 Facebook 登录,这似乎非常令人困惑。
这是我目前所拥有的,是否有链接 Facebook/Twitter 登录过程,以便 Parse 与 Scringo 一起获取信息,只需按下一个按钮?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[Parse setApplicationId:@"...gzPI7Omoxc..."
clientKey:@"...s22ZqIbM7n..."];
[PFTwitterUtils
initializeWithConsumerKey:@"...W4XjjpHz..."
consumerSecret:@"...Czjtht7v5..."];
[PFAnalytics trackAppOpenedWithLaunchOptions:launchOptions];
[PFFacebookUtils initializeFacebook];
[self configureNavigationBar];
[Scringo initWithAppId:@"...N2cCMhW1Bv..." completion:^{
[Scringo addSidebar:self.window toLeft:YES];
PFUser *currentUser = [PFUser currentUser];
if (! [ScringoUser currentUser].isAuthenticated) {
[ScringoUser signUpWithEmail:currentUser.email userName:currentUser.username password:@"notforyou" completion:^(ScringoUser *aUser, BOOL isSuccess) {
if (isSuccess) {
[currentUser setObject:aUser.userId forKey:@"ScringoUserId"];
[currentUser saveInBackground];
}
}];
}
}];
return YES;
}