답변

1

편집 : 대답

에 대한 CATALIN Morosan 덕분에 그것은 당신이 방법 AppInviteReferral.isOpenedFromPlayStore(result.getInvitationIntent())를 사용하여이를 찾을 수 있습니다 것으로 나타났다. 초대장을 클릭하면 실행되는 활동 :

// Create an auto-managed GoogleApiClient with access to App Invites. 
mGoogleApiClientInvite = new GoogleApiClient.Builder(this) 
     .addApi(AppInvite.API) 
     .enableAutoManage(this, this) 
     .build(); 

// Check for App Invite invitations and launch deep-link activity if possible. 
// Requires that an Activity is registered in AndroidManifest.xml to handle 
// deep-link URLs. 
boolean autoLaunchDeepLink = false; 
AppInvite.AppInviteApi.getInvitation(mGoogleApiClientInvite, this, autoLaunchDeepLink) 
     .setResultCallback(
       new ResultCallback<AppInviteInvitationResult>() { 
        @Override 
        public void onResult(AppInviteInvitationResult result) { 
         if (result.getStatus().isSuccess()) { 
          // Extract information from the intent 
          Intent intent = result.getInvitationIntent(); 
          String invitationId = AppInviteReferral.getInvitationId(intent); 
          boolean alreadyUser = AppInviteReferral.isOpenedFromPlayStore(result.getInvitationIntent()); 
          if (alreadyUser) { 
           // Do stuff... 
          } else { 
           // Do other stuff... 
          } 
         } 
        } 
       }); 
+1

이것은 작동하지 않습니다. AppInviteReferral.hasReferral()은 두 상황 모두에서 true를 반환합니다. AppInviteReferral.isOpenedFromPlayStore()는 우리가 원하는대로 동작해야합니다. –

+0

@CatalinMorosan 정확합니다. 내 앱이 Play 스토어에 없기 때문에 지금까지 테스트 해 볼 기회가 없었습니다. 이제는 해답이 hasReferral()과 반대로 작동합니다. – Borja

0

this Google product form post을 바탕으로, 중포 기지 동적 링크 라이브러리는 당신이 제거하고 그것을 위해 응용 프로그램을 다시 설치해야 할 것입니다 의미, 한 번 응용 프로그램 수명 당 들어오는 딥 링크를 확인합니다 다시 확인하십시오. 이 방법은 getInvitation() 메서드의 동작에 영향을 미치며이 메서드의 결과에 따라 응용 프로그램이 이전에 설치되었는지 여부를 나타낼 수있는 것으로 보입니다.

나에게 이것은 몹시 혼란스러워 보입니다. Branch.io에서 우리는 전혀 다른 방식으로 처리합니다. 링크 데이터 객체에는 항상 is_first_session 부울이 포함되며, 이는 사용자가 프로그래밍 방식으로 처리 할 수 ​​있습니다.

관련 문제