当单击启动我的android应用程序时,我会看到以下链接。
在本活动中,我可以(使用FirebaseDynamicLinks)获取https://whatever.com/customers?id=MTgy。但是我如何获得整个原始链接呢?
发布于 2017-11-06 18:54:28
// [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);
}您可以从link获得的只是现在执行操作您要执行什么操作
https://stackoverflow.com/questions/47135135
复制相似问题