3

Firebase Dynamicsのリンクを使用しました。私のアプリを開いたり、ゲームストアに行ったり、URLに行ったりできます。しかし、私はリンクを介していくつかのパラメータを渡すとき、私は最初のパラメータを取得することができます。 は、ここに私のダイナミックリンクです:Firebase Dynamic links経由で複数のパラメータを渡すAndroid

https://xx.app.goo.gl/?link=http://xx.com/?usn=abc&pass=def&apn=com.xx&afl=http://google.com 

そして私は、リンク取得するには、このコードを使用:(パスを= DEF失われた) 誰もがこの問題を解決http://xx.com/?usn=abc

// Build GoogleApiClient with AppInvite API for receiving deep links 
     mGoogleApiClient = new GoogleApiClient.Builder(this) 
       .enableAutoManage(this, this) 
       .addApi(AppInvite.API) 
       .build(); 

     // Check if this app was launched from a deep link. Setting autoLaunchDeepLink to true 
     // would automatically launch the deep link if one is found. 
     boolean autoLaunchDeepLink = false; 
     AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink) 
       .setResultCallback(
         result -> { 
          if (result.getStatus().isSuccess()) { 
           // Extract deep link from Intent 
           Intent intent = result.getInvitationIntent(); 
           String deepLink = AppInviteReferral.getDeepLink(intent); 
           Logger.e(deepLink); 
          } 
         } 
       ); 

とログの印刷を?

答えて

7

linkパラメータの値がURL encodeである必要があります。そうでないと、システムはダイナミックリンクのパラメータと、ダイナミックリンクのlinkパラメータのサブパラメータを判別できません。

これは最終的なURLがhttps://xx.app.goo.gl/?link=http%3A%2F%2Fxx.com%2F%3Fusn%3Dabc%26pass%3Ddef&apn=com.xx&afl=http://google.com

重要事項のようになります。意味:あなたは(私は疑いよう)として平文リンクパラメータを通じてユーザー名とパスワードを渡すためにしようとしている場合、これは非常に悪い考えです。真剣に、これをしないでください。このような要件への適切なアプローチについては、this answerをお読みください。

+0

ありがとう、私はそれをチェックします。 usn/passはテスト目的のためのものです:D – maphongba008

+0

それは動作します、多くのありがとう。 – maphongba008

+0

この類似の質問でも助けてください:http://stackoverflow.com/q/42119692/6144372 –

関連する問題