0

我實現在Android應用程序(食譜應用程序的索引)火力點的動態鏈接,起初它是基本的,沒有任何問題的工作:Android |火力地堡邀請結果代碼是確定的,但邀請不發送

viewHolder.mShareBtn.setOnClickListener(view -> {  
      Intent intent = new AppInviteInvitation.IntentBuilder(mContext.getResources().getString(R.string.invitation_title)) 
        .setMessage(mContext.getResources().getString(R.string.invitation_message)) 
        .build(); 

      ((AppCompatActivity) mContext).startActivityForResult(intent, 4); 
     }); 

不過我試圖通過添加深層鏈接的配方,使他們更聰明:

viewHolder.mShareBtn.setOnClickListener(view -> { 
      Uri deepLink = Uri.parse(mContext.getResources().getString(R.string.invitation_uri)); 
      Uri deepLinkPlus = Uri.withAppendedPath(deepLink, recipeKey); 

      Intent intent = new AppInviteInvitation.IntentBuilder(mContext.getResources().getString(R.string.invitation_title)) 
        .setMessage(mContext.getResources().getString(R.string.invitation_message)) 
        .setDeepLink(deepLinkPlus) 
        .build(); 

      ((AppCompatActivity) mContext).startActivityForResult(intent, 4); 
     }); 

代碼改變後,結果代碼仍然是確定和我舉杯爲發送,但它不是由預期的收件人收到的也不它出現在消息應用程序中。 我試圖恢復到我的第一個實現,它不再工作。

這似乎已經證明,但沒有答案Duplicate 1Duplicate 2

所有幫助表示歡迎,感謝您抽空看看!

這裏的接收活動:

mGoogleApiClient = new GoogleApiClient.Builder(this) 
      .addApi(AppInvite.API) 
      .enableAutoManage(this, this) 
      .build(); 
    AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, false) 
      .setResultCallback(
        result -> { 
         if (result.getStatus().isSuccess()) { 
          //Get intent information 
          Intent intent = result.getInvitationIntent(); 
          Uri deepLink = Uri.parse(AppInviteReferral.getDeepLink(intent)); 
          // 
          Intent mIntent = new Intent(getApplicationContext(), RecipeDetailActivity.class); 
          mIntent.putExtra("recipe_key", deepLink.getLastPathSegment()); 
          startActivity(mIntent); 
         } 
        } 
      ); 

編輯 - 無效緩存和重新啓動項目+清潔 後重建,我可以得到電子郵件邀請工作,短信仍然沒有 工作。它靜靜地失敗了嗎?結果代碼是-1

+0

你有解決嗎?我有類似的問題...結果是好的,但其他人沒有收到任何邀請。 –

+0

現在還沒有,我無法一直髮送消息和電子郵件。它是一個或另一個,但從來都沒有,我將本週再次從谷歌的Firebase邀請樣本,我會讓你張貼當我修復的bug – Ender

+0

添加sha256與sha1 – Ender

回答

3

解決方案是在SHA1上添加SHA256。

+0

你的意思是添加在控制檯第一個SHA256和那個SHA1? –

+0

試過了,不適合我。 –