2016-07-07 188 views
1

我試圖使用Shyambhat的InstagramKit(來自DEV分支),我無法讓Instagram重定向到應用程序(以及應該捕獲重定向URL的代碼部分)我登錄後,不管我做什麼。InstagramKit(ios)登錄身份驗證問題

在我的Info.plist我:

InstagramAppRedirectURL: app:// 

而且還對Instagram的我:

Redirect URI: app:// 

它總是相同的...它永遠不會奏效。 (我已經試過[myclientID]://授權和一堆其他的東西。)

我得到的錯誤「錯誤:頁面無法加載如果你有餅乾......」

這裏是我的代碼:

- (void)viewDidLoad { 
    [super viewDidLoad]; 

    NSLog(@"Do we see the light of day?"); 
    InstagramKitLoginScope scope = InstagramKitLoginScopeRelationships | InstagramKitLoginScopeComments | InstagramKitLoginScopeLikes; 
    NSURL *authURL = [[InstagramEngine sharedEngine] authorizationURLForScope:scope]; 
    [self.webView loadRequest:[NSURLRequest requestWithURL:authURL]]; 


} 

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType 
{ 
    NSLog(@"Did instagram make it here?"); 
    NSError *error; 
    if ([[InstagramEngine sharedEngine] receivedValidAccessTokenFromURL:request.URL error:&error]) { 
     // success! 
     NSLog(@"Instagram login successful"); 
    } 
    return YES; 
} 

我們做「看到光明的一天」。我使用它登錄屏幕...我登錄...但它從來沒有讓它「Instagram是否使它在這裏?」

任何幫助,將不勝感激。

回答

1

就像我說的......它從來沒有使它成爲BOOL webView。原來我只是需要明確設置委託在viewWillAppear:

-(void)viewWillAppear:(BOOL)animated 
{ 
    _webView.delegate = self; 
} 

問題解決了。