3

Firebase Dynamics 링크를 사용했으며 내 앱을 열거 나 매장을 방문하거나 URL로 이동할 수 있습니다. 그러나 링크를 통해 매개 변수를 전달할 때 첫 번째 매개 변수 만 가져올 수 있습니다. 여기 내 동적 링크입니다 :Firebase Dynamic links를 통해 여러 매개 변수 전달 안드로이드

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

그리고 링크 얻기 위해이 코드를 사용 :

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

그리고 로그 인쇄 : http://xx.com/?usn=abc (패스 데프 잃은 =) 사람은이 문제를 해결?

답변

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

중요 사항과 같아야 의미을 당신이하는 경우 (I 용의자로)와 같은 일반 텍스트 링크 매개 변수를 통해 사용자 이름과 암호를 전달하는 시도, 이것은 매우 나쁜 생각이다. 심각하게, 이 작업을 수행하지 마십시오. 이와 같은 요구 사항에 대한 올바른 접근 방법은 this answer을 읽어보십시오.

+0

감사합니다. 확인하겠습니다. usn/pass는 테스트 목적으로 만 사용됩니다. D – maphongba008

+0

작동합니다. 많은 감사드립니다. – maphongba008

+0

이 비슷한 질문도 도와주세요 : http://stackoverflow.com/q/42119692/6144372 –

관련 문제