반응형
canOpenUrl-이 앱은 스키마 instragram을 쿼리 할 수 없습니다.
iOS9에서 내 앱에 Instagram URL을 추가하려고하지만 다음과 같은 경고가 표시됩니다.
-canOpenURL: failed for URL: "instragram://media?id=MEDIA_ID" - error: "This app is not allowed to query for scheme instragram"
그러나, 나는 다음을 LSApplicationQueriesSchemes
내에 추가했습니다 info.plist
.
<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");
}
이 예제를 기반으로합니다.
귀하의
LSApplicationQueriesSchemes
항목은 계획이 있어야합니다. 두 번째 항목에는 의미가 없습니다.<key>LSApplicationQueriesSchemes</key> <array> <string>instagram</string> </array>
오류를 읽으십시오. 스키마에 오타가있는 URL을 열려고합니다.
instragram
에 대한 호출에서에 대한 참조를 수정하십시오canOpenURL:
.
필요한 Facebook :
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbauth</string>
<string>fbauth2</string>
<string>fb-messenger-api20140430</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131219</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbshareextension</string>
</array>
만 넣어 <string>instagram</string>
. 전체 경로는 필요하지 않지만 스키마 URL의 기본입니다.
반응형
'Development Tip' 카테고리의 다른 글
키가 특정 문자열을 포함하는 파이썬 사전에서 항목 필터링 (0) | 2020.10.13 |
---|---|
CSS를 통해 Microsoft Edge 브라우저를 식별하는 방법은 무엇입니까? (0) | 2020.10.13 |
dict의 키와 값을 ʻunicode`에서`str`로 변환하는 가장 빠른 방법은 무엇입니까? (0) | 2020.10.13 |
Chrome DevTools를 사용하여 iOS 6 + 7 Mobile Safari 디버그 (0) | 2020.10.12 |
Snappy를 사용한 Parquet vs ORC vs ORC (0) | 2020.10.12 |