Here is the code i tried
String id = "123456";
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra("id", id);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, "Firebase Deep Link");
intent.putExtra(Intent.EXTRA_TEXT,deepLinkUri);
startActivity(intent);
and this is while getting uri details on clicking the link in gmail or message
FirebaseDynamicLinks.getInstance()
.getDynamicLink(intent)
.addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() {
@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) {
Snackbar.make(findViewById(android.R.id.content),
"Found deep link!", Snackbar.LENGTH_LONG).show();
((TextView) findViewById(R.id.link_view_receive))
.setText(deepLink.toString());
} else {
Log.d(TAG, "getDynamicLink: no link found");
}
// [END_EXCLUDE]
}
})
.addOnFailureListener(this, new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.w(TAG, "getDynamicLink:onFailure", e);
}
});
In onStart to get id on clicking the link from gmail app or message
Intent intent = getIntent();
id = intent.getStringExtra("id");
but it is returning empty ("")
If any please help me