【发布时间】:2015-12-28 11:50:12
【问题描述】:
我试图在 iOS9 中将 Instagram 网址添加到我的应用中,但是我收到以下警告:
-canOpenURL: failed for URL: "instragram://media?id=MEDIA_ID" - error: "This app is not allowed to query for scheme instragram"
但是,我在info.plist 的LSApplicationQueriesSchemes 中添加了以下内容;
<key>LSApplicationQueriesSchemes</key>
<array>
<string>instagram</string>
<string>instagram://media?id=MEDIA_ID</string>//this one seems to be the issue
</array>
非常感谢任何帮助?
编辑 1
这是我用来打开 Instagram 的代码:
NSURL * instagramURL = [NSURL URLWithString:@"instragram://media?id=MEDIA_ID"];//edit: note, to anyone copy pasting this code, please notice the typo OP has in the url, that being "instragram" instead of "instagram". This typo was discovered after this StackOverflow question was posted.
if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
//do stuff
}
else{
NSLog(@"NO instgram found");
}
基于此示例。
【问题讨论】:
-
是不是因为你写的是instragram而不是instagram?
-
@JamesP 打自己的脸我怎么错过了,但我已经修复了它,问题仍然存在。
标签: ios info-plist