2017-05-29 146 views
4

我的應用程序流程是這樣的:無與倫比的深層鏈接3

  1. 啓動應用
  2. Spotify的「允許應用程序訪問頁面在瀏覽器(Chrome)打開,
  3. 的用戶給應用程序的權限,並重定向到https://appurl.com/spotify-callback/
  4. 那個URL的深層鏈接,使我的應用程序現在再次打開,
  5. 深層鏈接的插件現在應該匹配/spotify-callback/並打開指定的網頁SpotifyCallbackPage壽LD被打開,但我得到的錯誤console.error: Got a deeplink that didn't match

我的深層鏈接的代碼如下所示:

deeplinks.route({ 
       '/spotify-callback/': SpotifyCallbackPage 
      }).subscribe((match) => { 
       // match.$route - the route we matched, which is the matched entry from the arguments to route() 
       // match.$args - the args passed in the link 
       // match.$link - the full link data 
       console.log('Successfully matched route', match); 
      }, (nomatch) => { 
       // nomatch.$link - the full link data 
       console.error('Got a deeplink that didn\'t match'); 
       console.log(nomatch); 
      }); 

發送到路由器的網址是:

https://appurl.com/spotify-callback/#access_token=random-access-token-here&token_type=Bearer&expires_in=3600 

完整的錯誤消息:

error opening ws message: {"category":"console","type":"log","data":["On deep 
      link",{"url":"https://appurl.com/spotify-callback/#access_token=random-access-token-here&token_type=Bearer&expires_in=3600","path":"/spotify-callback/","scheme":"https","host":"appurl.com","fragment":"access_token=random-access-token-here&token_type=Bearer&expires_in=3600","extra":{"org.chromium.chrome.browser.eenp":["io.ionic.starter"],"org.chromium.chrome.browser.referrer_id":21,"com.android.browser.application_id":"com.android.chrome"}}]} 
[16:28:02] console.error: Got a deeplink that didn't match 

我試過不同的網址d端點在路由器中,但它們都不匹配。有人知道我應該嘗試匹配嗎?

+1

我似乎有同樣的問題,你有沒有設法解決這個問題? https://stackoverflow.com/questions/44238121/why-android-does-not-handle-a-deeplink-url-which-has-in-the-path也可能很有趣。 –

回答

0

我不確定您是否已經找到解決此問題的方法。也許你可以嘗試改變route url(Spotify的回調)喜歡的東西:

spotify-callback + window.location.hash