我真的不能再给标题加更多内容了。我想向那些直接打开我的应用程序的链接的用户发送警告。
这有可能吗?如果有,怎么做?
发布于 2017-04-01 09:44:39
我知道从谷歌广告的工作,它确实有可能将用户发送到一个特定的深链接位置在你的应用程序。作为将用户发送到特定产品页面的示例,您可以使用诸如android-app://com.example.android/exampleapp/productid_1234之类的URL
阅读更多- https://support.google.com/adwords/answer/6046977?hl=en-GB
发布于 2017-04-01 09:55:20
是的,您只需添加发送数据的意图就可以做到这一点。我正在共享一个代码示例,只需实现它,您就会得到您想要的:
Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("text/plain");
share.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
// Add data to the intent, the receiving app will decide
// what to do with it.
share.putExtra(Intent.EXTRA_REFERRER_NAME,"example");
// share.putExtra(Intent.EXTRA_SUBJECT, "your text");
share.putExtra(Intent.EXTRA_TEXT, "click on com.example.yourApp");
startActivity(Intent.createChooser(share, ""));只要把your app complete name with package name放在com.example.yourApp上就行了
https://stackoverflow.com/questions/43155121
复制相似问题