我正在将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;
}