0
我有我的傳出和傳入的URIInstagram的重定向URI不匹配,註冊URI iOS應用
self.outgoingRedirect = @"https://courseera.com";
self.incomingRedirect = @"https://myscheme.com";
和代碼的其餘部分看起來像這 -
[[NXOAuth2AccountStore sharedStore]
setClientID:@"xxx"
secret:@"xxx"
authorizationURL:[NSURL
URLWithString:@"https://api.instagram.com/oauth/authorize"]
tokenURL:[NSURL
URLWithString:@"https://api.instagram.com/oauth/access_token"]
redirectURL:[NSURL URLWithString:self.outgoingRedirect]
forAccountType:@"Instagram"];
返回YES; }
(BOOL) application:(UIApplication)app openURL:(NSURL *)url options:
(NSDictionary *)options{
if([self.incomingRedirect containsString:[url scheme] ] &&
[self.incomingRedirect containsString:[url host]]){
NSURL *constructed = [NSURL URLWithString:[NSString
stringWithFormat:@"%@?%@",self.outgoingRedirect,[url query]]];
NSLog(@"We received a callback URL");
return [[NXOAuth2AccountStore sharedStore]
handleRedirectURL:constructed];
}
else{
return [[NXOAuth2AccountStore sharedStore] handleRedirectURL:url];
}
};
我得到一個錯誤「重定向URI不匹配註冊重定向URI。」
你在你的應用程序的Instagram開發門戶中輸入了什麼重定向URI? –
我已將URI添加爲http://myscheme.com – sarah