[英]Does Facebook SDK distinguish between iOS debug vs release build
Facebook是否區分調試和發布iOS版本? 在將新的版本提交到iTunes之前,我正在測試我的應用程序。 我的應用使用將照片發布到Facebook的單一權限(即publish_actions)。 奇怪的是,當我使用我的Facebook帳戶進行測試時,一切正常。 但是,當我用伴侶的Facebook帳戶進行測試時,它不會通過:開發人員帳戶已鏈接到我的Facebook帳戶; 不是我伴侶的 基本上針對以下方法
// Convenience method to perform some action that requires the "publish_actions" permissions.
- (void)performPublishAction:(void(^)(void))action {
// we defer request for permission to post to the moment of post, then we check for the permission
if ([FBSession.activeSession.permissions indexOfObject:@"publish_actions"] == NSNotFound) {
// if we don't already have the permission, then we request it now
NSLog(@"Requesting publish permission");
[FBSession.activeSession requestNewPublishPermissions:@[@"publish_actions"]
defaultAudience:FBSessionDefaultAudienceFriends
completionHandler:^(FBSession *session, NSError *error) {
NSLog(@"Completion handler returns for permission");
NSLog(@"My Permissions are: %@",session.permissions);
if (!error) {
NSLog(@"Okay no error");
action();
} else if (error.fberrorCategory != FBErrorCategoryUserCancelled) { NSLog(@"ERROR GETTING PERMISSION:: %@",error);
}
}];
} else {
NSLog(@"the other route");
action();
}
}
永遠不會調用action()
。
線
NSLog(@"My Permissions are: %@",session.permissions);
版畫
My Permissions are: (
"public_profile"
)
和線
NSLog(@"The ERROR IS: %@",error);
版畫
The ERROR IS: Error Domain=com.facebook.sdk Code=2
"The operation couldn’t be completed. com.facebook.sdk:ErrorReauthorizeFailedReasonUserCancelled" UserInfo=0x1702779c0
{com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:ErrorReauthorizeFailedReasonUserCancelled,
NSLocalizedFailureReason=com.facebook.sdk:ErrorReauthorizeFailedReasonUserCancelled,
com.facebook.sdk:ErrorSessionKey=<FBSession: 0x170169480, state: FBSessionStateOpen, loginHandler:
0x100374240, appID: 123456789, urlSchemeSuffix: ,
tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x17022a740>, expirationDate: 2015-05-19 19:07:02 +0000,
refreshDate: 2015-03-20 19:07:02 +0000, attemptedRefreshDate: 0000-12-30 00:00:00 +0000, permissions:(
"public_profile"
)>}
Nopes Facebook不區分調試和發布iOS版本。 但是,事實是您無法使應用程序滿足一般用戶的需求。 要使普通用戶可以登錄,您必須在https://developers.facebook.com/中無法注冊您的應用程序的應用程序
3.點擊設置選項,然后在聯系人電子郵件選項中輸入您的電子郵件並保存更改 4.單擊狀態並進行審查,然后選擇是
您將看到以下對話,單擊確認
現在,您將可以使用任何Facebook帳戶登錄
SDK不會區分構建配置。 您的應用是否通過登錄視圖查看過: https : //developers.facebook.com/docs/apps/review/login ?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.