Development Tip

canOpenUrl-이 앱은 스키마 instragram을 쿼리 할 수 ​​없습니다.

yourdevel 2020. 10. 13. 19:26
반응형

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");
}

이 예제를 기반으로합니다.


  1. 귀하의 LSApplicationQueriesSchemes항목은 계획이 있어야합니다. 두 번째 항목에는 의미가 없습니다.

    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>instagram</string>
    </array>
    
  2. 오류를 읽으십시오. 스키마에 오타가있는 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의 기본입니다.

참고 URL : https://stackoverflow.com/questions/32870393/canopenurl-this-app-is-not-allowed-to-query-for-scheme-instragram

반응형