2017-11-06 12 views

答えて

2
// [START get_deep_link] in OnCreate() method 
    FirebaseDynamicLinks.getInstance() 
      .getDynamicLink(getIntent()) 
      .addOnSuccessListener(this,this) //implement OnSuccessListener<PendingDynamicLinkData> for this 
      .addOnFailureListener(this,this); // implement OnFailureListener for this 




    @Override 
    public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) { 
    // Get deep link from result (may be null if no link is found) 
    Uri deepLink = null; 
    if (pendingDynamicLinkData != null) { 
     deepLink = pendingDynamicLinkData.getLink(); 
    } 
    // Handle the deep link. For example, open the linked 
    // content, or apply promotional credit to the user's 
    // account. 
    // ... 

    // [START_EXCLUDE] 
    // Display deep link in the UI 
    if (deepLink != null) { 
     //now you have your dynamicLink here in Uri object 
    } else { 
     Log.e(TAG, "getDynamicLink: no link found"); 
    } 
    // [END_EXCLUDE] 
    } 

    @Override 
    public void onFailure(@NonNull Exception e) { 
    Log.e(TAG, "getDynamicLink:onFailure", e); 
    } 

何がリンクから得ることができることは、これが唯一の今、あなたは私が求めていないものを

+0

を実行したい何のアクションを実行しています。アクティビティ内からリンク全体を取得したいインテントデータにはhttps://whatever.com/customers?id=MTgyのみが渡されます。 –

+0

あなたは完全な動的URLと何が必要なのかを教えてください。 –

+0

あなたは私が求めたものを理解していません。 scheme://example.com?link = scheme://example.orgがあるとします。あなたがそれをクリックすると、アプリケーションが開き、 'pendingDynamicLinkData.getLink()'の上にペーストしたコードでscheme://example.orgが保持されます。私はリダイレクトされた部分だけでなく、 'scheme://example.com?link = scheme:// example.org'全体をアクティビティに入れたいです!私は今回ははっきりしているといいですね。 –