3

我正在将Linked-in我的 iOS 应用程序集成到我的应用程序中。Login它对我来说工作正常..当我在应用程序中输入凭据并成功进入应用程序时它成功登录....但是当我logout再次login要求Access- >allow access按钮不询问凭据,但我希望allow access页面不应该出现在下一次登录...意味着logout当我再次单击linkedin``login...它应该直接访问应用程序..不应该要求图像 2..

在此处输入图像描述

图 2 第二次出现。login我不想来

在此处输入图像描述

- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
 {

     NSMutableArray *toolbarButtons = [toolBar.items mutableCopy];
     // toolbarItems = [[NSMutableArray arrayWithArray:toolbar.items]
     // This is how you remove the button from the toolbar and animate it
     // This is how you add the button to the toolbar and animate it

    if (!firstTime1||![loginView canGoBack]) 
    {
        [toolbarButtons removeObject:backButton];
        [toolBar setItems:toolbarButtons animated:YES];
        firstTime1=YES;
    }

NSURL *url = request.URL;
NSString *urlString = url.absoluteString;

    BOOL requestForCallbackURL = ([urlString rangeOfString:[LinkedIn linked].linkedInCallbackURL].location != NSNotFound);
    if ( requestForCallbackURL )
    {
        BOOL userAllowedAccess = ([urlString rangeOfString:@"user_refused"].location == NSNotFound);
        if ( userAllowedAccess )
        {
            if ([self logoutPreviousSession])
            {
                [[NSUserDefaults standardUserDefaults] setInteger:1 forKey:@"SuccessfulLogin"];
                [DelegateClass magazine]._loggedThrough=@"LinkedIn";
                [[LinkedIn linked].requestToken setVerifierWithUrl:url];
                [[LinkedIn linked] accessTokenFromProvider];
            }

        }
        else
        {

             [self dismissModalViewControllerAnimated:YES];
        }
    }
return YES;
 } 
4

0 回答 0