- [SFOAuthCoordinator setAuthInfo:]:发送给解除分配的实例崩溃的消息

时间:2015-03-27 14:17:18

标签: ios salesforce

我在用户点击“拒绝”后使用Salesforce在我的iOS应用中收到此崩溃登录后在app权限屏幕中按钮。 我已经提到SF给出的示例应用程序&它显示相同方案的错误警报。 不知道我错过了什么

错误: 错误域= com.salesforce.OAuth.ErrorDomain代码= 669"最终用户拒绝授权" UserInfo = 0x1d8ab880 {NSLocalizedDescription =最终用户拒绝授权,错误= access_denied}

- [SFOAuthCoordinator setAuthInfo:]:发送到解除分配的实例0x189b1370的消息

以下是我正在使用的代码:

的appDelegate:

init方法

[SFLogger setLogLevel:SFLogLevelDebug];
    [SalesforceSDKManager sharedManager].connectedAppId = RemoteAccessConsumerKey;
    [SalesforceSDKManager sharedManager].connectedAppCallbackUri = OAuthRedirectURI;
    [SalesforceSDKManager sharedManager].authScopes = @[ @"web", @"api" ];

__weak AppDelegate *weakSelf = self;

[SalesforceSDKManager sharedManager].postLaunchAction = ^(SFSDKLaunchAction launchActionList) {
    [weakSelf setupRootViewController];
};
[SalesforceSDKManager sharedManager].launchErrorAction = ^(NSError *error, SFSDKLaunchAction launchActionList) {
     [weakSelf initializeAppViewState];
    [[SalesforceSDKManager sharedManager] launch];
};
[SalesforceSDKManager sharedManager].postLogoutAction = ^{
    [weakSelf handleSdkManagerLogout];
};
[SalesforceSDKManager sharedManager].switchUserAction = ^(SFUserAccount *fromUser, SFUserAccount *toUser) {
    [weakSelf handleUserSwitch:fromUser toUser:toUser];

didFinishLaunchingWithOptions:

 [[SalesforceSDKManager sharedManager] launch];

ViewController :(延迟登录)

 [[SFAuthenticationManager sharedManager] loginWithCompletion:^(SFOAuthInfo *sfOAuthInfo) {
        NSLog(@"authentication successful!!!");
    }
    failure:^(SFOAuthInfo *sfOAuthInfo, NSError *error) {
        NSLog(@"Authentication failure!!!");
    }];

0 个答案:

没有答案