program story

iOS9 : 유니버설 링크가 작동하지 않습니다.

inputbox 2020. 8. 24. 08:20
반응형

iOS9 : 유니버설 링크가 작동하지 않습니다.


그래서 튜토리얼 https://blog.branch.io/how-to-setup-universal-links-to-deep-link-on-apple-ios-9를 따라 제공된 것과 정확히 동일한 값을 사용했습니다.

Apple Association 파일은 다음 링크 디렉토리에도 준비되어 있습니다. WEB_PAGE : PORT_NUMBER / apple-app-site-association

이쪽에 모든 것이 설정되어있는 것 같습니다.

자격을 추가하고 프로비저닝 프로필을 업데이트했으며 모든 설정을 완료했습니다.

내 기기에서 앱을 실행하고 http : // WEB_PAGE : PORT_NUMBER 링크를 열면 항상 Safari가 열립니다.

다음 방법에도 중단 점이 있습니다.

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray * __nullable restorableObjects))restorationHandler

하지만 질치.

누가 이것을 완성 했습니까? 내가 놓친 것이 있습니까?


몇 가지 가능한 문제가 있습니다.

  1. : 확실히 문제가 없는지 링크 검사기로 도메인을 붙여 시도 할 https://limitless-sierra-4673.herokuapp.com/ (- 참조 ShortStuffSushi에 신용 의 repo )

  2. 권한에 지정된 도메인에 TLS가 제대로 설정되지 않은 경우 iOS는 시스템 로그에 오류 메시지를 기록합니다. 애플리케이션 로그가 아닌 OS 로그에 묻혀 있습니다. 오류 메시지는 다음과 같습니다 Sep 21 14:27:01 Derricks-iPhone swcd[2044] <Notice>: 2015-09-21 02:27:01.878907 PM [SWC] ### Rejecting URL 'https://examplecustomdomain.com/apple-app-site-association' for auth method 'NSURLAuthenticationMethodServerTrust': -6754/0xFFFFE59E kAuthenticationErr. 여기 에서 가져온 오류 메시지 , TLS 용 CloudFlare 사용에 대한 빠른 (불완전한) 지침은 여기 .

  3. 내 개인 테스트에서 Safari의 링크를 클릭 / 입력 한 적이 한 번도 앱을 직접 열지 않았습니다. 다른 애플 리케이션 (iMessage를, 메일, 여유 등)에서 클릭하는 것이 있다 했다. 다른 사람들은 Google 검색 결과에서 링크를 클릭하면 앱이 직접 열렸다고보고했습니다.

  4. 유니버설 링크가 앱을 여는 데 성공한 다음 Safari로 클릭 연결하면 (앱 탐색 표시 줄의 오른쪽 상단 모서리에있는 사이트를 탭하여) 해당 URL을 방문 할 때 iOS가 앱 열기를 중지합니다 . 그런 다음 Safari에서 아래로 당겨서 "열기"를 사용하여 페이지 상단에 배너를 표시 할 수 있습니다. 나는 이것에 많은 시간을 낭비했다. Apple-app-site-assocation 파일에서 지정한 경로를 기반으로 사이트를 클릭하면 => UL을 비활성화하는 것은 경로 에 따라 달라집니다. 그래서 당신은 별도의 경로가있는 경우, yoursite.com/a/*그리고 yoursite.com/b/*, 당신은 클릭하면 yoursite.com/a/*그것은 당신이 다음에 클릭을 통해 앱의 오른쪽 상단 모서리에있는 옵션을 가지고, 직접 응용 프로그램을 엽니 다 yoursite.com/a/*. 그렇게하면 후속 방문이yoursite.com/a/*앱이 아닌 브라우저에서 열립니다. 그러나 yoursite.com/b/*영향을받지 않고 여전히 앱을 직접 열어야합니다.

문제가 무엇인지 발견하면 알려주세요. 저는 개인적으로 Universal Links의 작동 방식과 존재하는 엣지 케이스에 대해 매우 궁금합니다. 행운을 빕니다.


이것이 잘못 될 수있는 방법에는 여러 가지가 있습니다. 두 가지 문제가 발생했습니다.

  • Xcode에서 Associated Domains 인 타이틀먼트를 추가 할 때 각 항목은 다음으로 시작해야 applinks:하고 도메인 이름이 있어야합니다 . applinks:www.apple.com.

  • Xcode가 나를 위해 인 타이틀먼트 파일을 생성했지만 빌드에는 포함되지 않았습니다. 수동으로 해당 상자를 클릭해야했습니다.

그리고 예, 그렇게 한 후에는 apple-app-site-association파일 에 서명 할 필요가 없었 습니다. 단지 일반 텍스트 일 ​​뿐이며 HTTPS를 통해 제공되는 한 작동합니다. (하지만 iOS 8을 지원하는 경우에도 서명해야합니다.)


Universal Links에 대한 연관 파일을 만드는 문서에 분명히 오류가 있습니다.

그것이 말하는 곳 :

appID 키의 값은 앱의 팀 ID와 번들 ID입니다.

그것은 말해야한다

appID 키의 값은 앱의 접두사 및 번들 ID입니다.

대부분의 앱에서 팀 ID와 앱 접두사가 동일한 것처럼 보이지만 앱이 수년 동안 스토어에 있었다면이 값이 다를 수 있습니다.

이 값을 찾으려면 https://developer.apple.com 에서 회원 센터를 열고 "인증서, 식별자 및 프로필"을보고 "식별자"를 클릭 한 다음 "식별자"아래의 표에서 "앱 ID"를 클릭하십시오. 앱을 찾고 거기에서 접두사 값과 번들 ID를 사용하여 연결 파일에 대한 AppID를 만듭니다.


St.derrick의 답변 은 유익합니다.

그러나 범용 링크를 다시 사파리 대신 앱에서 열 수 있도록하려면 다음 작업을 수행해야합니다.

  • Mail 또는 iMessage에서 범용 링크를 길게 누르면 Safari 또는 App에서 열 것인지 여부에 대한 옵션이 표시됩니다.

이 문제를 디버깅하는 데 도움이되도록 앱을 설치할 때 기기의 콘솔 출력에서 ​​"swcd"를 검색하여 범용 링크 등록이 작동했는지 실패했는지 확인하세요.

  1. 시뮬레이터가 아닌 실제 장치를 사용하십시오.
  2. 장치에서 앱을 삭제하십시오.
  3. 장치를 컴퓨터에 연결하고 xcode에서 장치의 콘솔 출력을 봅니다. (창-> 장치-> [사용자 장치]-> 장치 로그보기). 이 창을 열어 두십시오.
  4. 앱을 설치하고 시작하십시오.
  5. 콘솔 출력을 "swcd"로 필터링합니다. 성공하면 다음 스크린 샷과 같은 것을 볼 수 있습니다. 실패하면 다른 것을 볼 수 있습니다. 아무것도 표시되지 않으면 Associated Domains 권한을 추가하는 것과 같은 근본적인 문제가 발생한 것입니다.

Applink가 성공적으로 추가되었습니다.


apple-app-site-association서버 측에서 유효성을 검사하려면 Apple의 공식 유효성 검사기를 사용할 수 있습니다.

https://search.developer.apple.com/appsearch-validation-tool/


나는 루트 디렉토리 a (예 :)에 대한 링크가 http://example.com/내 앱을 열지 않았지만 경로 (예 :)를 추가 http://example.com/mypath하면 작동 한다는 것을 깨달았습니다 . "/"경로 목록에 추가하면 다음 과 같이 해결되었습니다.

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "TEAM_ID.BundleIdentifier",
                "paths": [ "*", "/" ]
            }
        ]
    }
}

Apple Developer Forums 스레드 에서 slutsker가 답변했습니다 .


Universal Link를 올바르게 구현했는지 확인하는 빠른 단계입니다.

  • 앱을 시작할 것으로 예상되는 링크를 길게 누릅니다. 컨텍스트 메뉴에 '[앱 이름]에서 열기'가 표시되어야합니다.

  • Notes 앱을 열고 앱을 열 수있는 링크를 입력합니다. 완료를 탭합니다. 링크가 노란색으로 바뀌고 링크를 탭하면 Safari가 아닌 앱이 열립니다.

  • 링크 경우 http://yourDomain.com이 응용 프로그램을 실행하지 않는 시도 http://yourDomain.com/yourFolder/을

  • Safari에서 컨텍스트 메뉴에 safari에서 "[your app name]에서 열기"가 표시되지만 링크를 탭하면 앱을 시작하는 대신 safari 자체에서 링크가 열립니다.

    ㅏ. 링크를 클릭했을 때 열린 사파리 페이지를 '끌어서 새로 고침'하는 것처럼 아래로 당겨보십시오. 앱을 열 수있는 배너가 나타납니다. 배너를 탭하여 앱을 열고, 홈 버튼을 눌러 앱을 닫고, Safari로 돌아가서 링크를 다시 탭하여 앱을 실행 해보십시오. 이번에는 배너를 탭하면 앱에서 링크를 열 수있는 환경 설정이 저장 되었어야하므로 앱이 시작되어야합니다.

    비. a. 단계 후에도 앱이 여전히 실행되지 않으면 gmail과 같은 웹 메일에 링크를 메일로 보내고 safari에서 웹 메일 사이트를 열고 링크를 클릭 해보십시오. 이것이 작동한다면 링크와 동일한 도메인에서 앱을 시작하려고 시도했을 수 있습니다. 내가 본 바에 따르면 동일한 도메인에서 앱을 시작하면 대부분 실패합니다 . 아마도 safari는 링크가 사용자가있는 동일한 도메인에있을 때 대상 URL이 범용 링크인지 여부를 확인하지 않을 것입니다. 따라서 다른 도메인에서 앱을 시작해보십시오.


유니버설 링크를 통합 한 후 프로젝트 버전이나 빌드 번호를 높이는 것도 매우 중요합니다. 삭제 / 재설치하더라도 버전을 범프하지 않는 한 iOS는 링크를 선택하지 않습니다.


  • 링크를 브라우저 URL 필드에 붙여 넣으면 범용 링크가 작동하지 않습니다.

  • 유니버설 링크 작업을 사용자 중심으로 <a href="...">요소를 클릭 도메인에서 . 예 : google.com에 bnc.lt를 가리키는 범용 링크가있는 경우 앱이 열립니다.

  • 유니버설 링크는 동일한 도메인에서 사용자 주도 요소 클릭 으로 작동하지 않습니다 . 예 : google.com의 다른 범용 링크를 가리키는 google.com의 범용 링크가있는 경우 앱이 열리지 않습니다.<a href="...">

  • 범용 링크는 <a>사용자 작업의 일부가 아닌 경우 자바 스크립트 (window.onload에서 또는 요소 에 대한 .click () 호출을 통해)를 통해 트리거 될 수 없습니다 .

출처 : https://dev.branch.io/getting-started/universal-app-links/support/ios/#appsbrowsers-that-support-universal-links

세 번째 총알은 알아내는 데 약 하루가 소요되었습니다.


여기 사람들이 다른 솔루션을 찾고있는 경우, 많은 문제가 발생하여 많은 골칫거리를 유발하는 것을 보았으므로 유니버설 링크 디버깅에 대한 전체 단계를 통합했습니다.

확인 해봐:

유니버설 링크 디버깅 가이드

디버깅 가이드 미리보기

유니버설 링크를 새로 설정하려는 경우이 가이드가 매우 유용합니다.

iOS 딥 링킹 설정 가이드

도움이 되었기를 바랍니다.


앞으로 더 많은 사람들이 저와 같은 문제에 직면 할 경우를 대비해 제가 발견 한 것들을 추가 할 것이라고 생각했습니다. 대부분 인증 오류와 관련이 있습니다.

Apple이 명시 적으로 명시하지 않더라도 apple-app-site-association파일은 서명 된 경우에도 https를 통해 제공되어야합니다. https에 사용되는 인증서도 Apple에서 신뢰해야합니다. 따라서 설정-> 일반-> 프로필에서 장치에 추가 된 인증서는 safari에서 https를 허용하지만 범용 링크가 작동하는 것을 허용하지 않습니다.

장치 로그에서 장치와 서버 간의 인증 오류에 대해 다음과 같은 값이 인쇄 "TrustResultValue" : 4됩니다. TrustResultValue5 개 수단 인증서가 잘못된 도메인 (예. test.com www.test.com에서 제공). TrustResultValue4 개 수단 인증서의이 사용하기 위해 신뢰할 수 없습니다.

여기 에서 디버깅에 도움이되는 몇 가지 단계가있을 수 있습니다 . "apple-app-site-association에 대한 액세스 테스트"섹션은 장치가 apple-app-site-association파일 을 받는지 확인하는 방법에 대한 단계별 가이드입니다 . 단계는 다음과 같이 요약됩니다.

  1. 앱을 제거하십시오. 이는 설치시 파일이 다운로드되기 때문에 필요합니다.

  2. 서버가 제대로 제공되지 않도록 apple-app-site-association합니다.

  3. xcode에서 창-> 장치를 열고 장치를 선택합니다.

  4. 창 하단에있는 삼각형을 클릭하여 장치 로그를 엽니 다.

  5. 관련이있을 수있는 이전 로그를 지우려면 휴지통을 클릭하여 로그를 지우십시오.

  6. 재생 버튼을 클릭하여 xcode로 앱을 다시 설치하십시오.

  7. 앱이 실행 된 후 장치가 파일을 올바르게 요청하는 경우 장치 로그에 "apple-app-site-association"을 검색하여 찾을 수있는 오류가 포함되어야합니다.

apple-app-site-association파일이 제대로 제공 되면 (2 단계가 생략 됨) 오류가 없어야합니다. 문제인 경우 인증 오류가 대신 표시 될 수 있습니다.


가장 일반적인 원인은 사용자가 오른쪽 상단을 탭하여 iOS에 향후 앱 (이 경우 Uber)을 열지 않도록 지시하는 것입니다.

수정하려면 아래로 당겨 스마트 배너를 표시하고 열기를 탭합니다.

Safari에서 아래로 당겨 다시 엽니 다.

이후에 앱을 열 때 "기억"합니다.


(Universal) 링크 열기를 쉽게 테스트해야하는 사람은 다음 명령을 사용하여 터미널에서 시뮬레이터의 링크를 열 수도 있습니다.

xcrun simctl openurl booted yourapp_or_http://yourlink

예를 들면 :

xcrun simctl openurl booted https://www.google.com


I've managed to make it work, but it took quite some time and struggle. Note that unless you sign the apple-app-site-association file (signing is optional!) tapping on a link in Safari will not open your app (it has caused me a lot of headache).


Took me close to a day to figure this out. The issue I had was not downloading the updated provisioning profiles in XCode (I also restarted XCode after this).

(Preferences > Accounts > View Details > Download All)


You can test universal links in simulator

From the App Search Programming Guide: Support Universal Links


We've added apple-app-site-association file to this location:

https://example.com/apple-app-site-association

On iOS 9 it worked fine, but on iOS 10 it didn't work.

It appeared that problem was with .well-known path:

https://example.com/.well-known/apple-app-site-association

Because of https://example.com/.well-known/apple-app-site-association path redirected to https://example.com

<Notice>: Allowing redirect 'https://example.com/.well-known/apple-app-site-association' -> 'https://example.com/'
<Notice>: ### Rejecting AASA file size 154466 for URL https://example.com/.well-known/apple-app-site-association

In my opinion if somehow .well-known path doesn't work correctly it breaks universal links.


Go to developer.apple.com and edit one of your distribution profiles. In the editing page you can open a pop up for App IDs that will show a list of your app names and in () round brackets behind the app's name it reveals all your real App IDs. Some apps might have your team ID as prefix but some do not. Make sure to use exactly what you see in that pop up menu inside the () and put it into the apple-app-site-association details appID field. I had exactly this issue with an app and its universal links.


The issue for me turned out to be the apple-app-site-association file. According to Apple's documentation, only the applinks parameter is required. I added the activitycontinuation parameter and it worked.

{
  "activitycontinuation": {
    "apps": [
      "9JA89QQLNQ.com.apple.wwdc"
    ]
  },
  "applinks": {
    "apps": [],
    "details": [{
        "appID": "9JA89QQLNQ.com.apple.wwdc",
        "paths": [ "/wwdc/news/", "/videos/wwdc/2015/*" ]
      }]
  }
}

Haven't really seen the exact same issue/solution combo that got it working for me so might as well add mine incase someone has the same problem!

For my app I am using a custom URL scheme (set in APP_TARGET > Info > URL Types) and set the URL scheme from here into the Firebase console to match but still wasn't working.

My problem was actually two problems:

Watch out if checking Automatically Manage Signing

If you are checking Xcode's "Automatically manage signing" setting like I was, since I was just trying to make a quick demo app, you will want to ensure that the TeamID that is used matches the one in your Firebase console. I originally went to my Apple Developer Account and copied the team ID from my Membership page, but later saw that the actual ID being used by Xcode was different. (You can find this in APP_TARGET > General > Signing > Signing Certificate. For me it looked like iPhone Developer: My Name (TEAM_ID)).

Prefix your TeamID to your Bundle Identifier in your URL Types

After I ensured these matched in my Firebase console and Xcode, my next problem was the identifier for my URL scheme. It's typical to use your bundle identifier here, but Firebase actually prefixes this with the Team ID you gave in your Firebase console, so I had to prefix it to the identifier in the URL types section in Xcode as well.

After these two fixes and re-downloading the GoogleService-Info.plist file I had no problem open up my dynamic links.


If you are hosting your apple-app-site-association on Firebase, make sure to put it in /.well-known/ subdirectory! It appears that Xcode queries that URL first, and if it succeeds, it makes no attempt to query the apple-app-site-association in the root directory. For some reason, firebase engineers made the hosted websites to automatically respond to /.well-known/apple-app-site-association with an empty (but correctly formed) association file that overrides your custom one, leaving you with no clue why nothing works!


For me, my error was our site is redirecting www.domain.com to domain.com, so all the www.domain.com/* will fail because of that. Hope that helps.


After two days it turned out for me, that these kind of links (from branch)

applinks:xxxx.app.link

work only after Archiving (also Ad-hoc) the application and install it to the phone.


I was able to test Universal Links in the iOS Simulator by using the Calendar app.

I just created an event and added the URL I wanted to test in the event's URL field. Then, when viewing the created event, you can simply tap on the URL link and your app should open.


After two days of total desperation, I think I've finally fixed it. Here is my solution:

It seems that older apps use a different app prefix than newer apps. Newer apps only use the Team ID for this purpose. If the app prefix and the team ID are not identical, it seems that you need to specify the activity continuation field in the apple app site association file:

{
    "activitycontinuation": {
        "apps": [
            "YOUR_APP_PREFIX.de.company.app"
        ]
   },
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "YOUR_APP_PREFIX.de.company.app",
        "paths": ["/*"]
      }
    ]
  }
} 

Another thing I experienced during my hell ride was that deleting the app and restarting the device seems to be the only way to force refresh this file.


For future readers that find this page ...

I had a similar situation. However, in my situation, iOS10 was working AOK, and no matter what I did (bump build numbers, delete/reinstall, etc), iOS9 seemed to refuse to work.

I was coming to this from iOS10, and needed to support iOS9. At the time, the documentation here - https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html - clearly states that the file may be placed at the root of the web-server (e.g. /apple-app-site-association) or in the .well-known folder (e.g. /.well-known/apple-app-site-association). Because I'm also supporting Android, which also uses the .well-known folder for a similar file, I decided to put both in there.

For fresh installs on iOS10, it clearly request the root file, fails, then requests the .well-known file, and succeeds.

For iOS9, it clearly requested the root file, fails, and does nothing else.

Solution: if you support iOS9, put the file at /apple-app-site-association.


In my case my error was to put query parameters in paths:

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "TEAM_ID.BundleIdentifier",
                "paths": [ "/auth-ui/hub?target=confirm&*" ]
            }
        ]
    }
}

when I remove '?target=confirm&*' from paths, it start to working


In my case, the request for the AASA file at: https://example.com/apple-app-site-association

Was being redirected to: https://www.example.com/apple-app-site-association

The kicker is -- this works fine on iOS 11, but fails on iOS 9.3.5. Go figure.

Solution: the apple-app-site-association file MUST NOT be behind a 302 or 301 redirect for iOS 9. (To be fair, this is noted on the UL troubleshooting page.)


나를 위해 위의 모든 답변을 구현하고 AASA 파일이 실제로 mpoisot의 답변으로 다운로드되고 있는지 테스트 한 후 내 문제는 Xcode에서 관련 도메인을 다음과 같이 추가했다는 것입니다.

applinks:example.com

내 노트 앱에서 다음을 사용하려고했습니다.

Https://example.com

AASA가 서명되지 않았기 때문에 HTTPS를 통해 제공하고 싶었습니다. 그래서 내 노트 앱에서 사용하려고 할 때 작동했습니다.

 example.com

Xcode의 개발 빌드 또는 Testflight의 배포 빌드와 함께 iOS 12.1.2를 사용하는 물리적 장치에서 작동합니다.

참고 URL : https://stackoverflow.com/questions/32751225/ios9-universal-links-does-not-work

반응형