【发布时间】:2016-06-25 12:53:33
【问题描述】:
所以我们的应用程序我们有 Parse API,发送推送通知和管理后端的东西,我们正在发送和update the appnotificaiton bt 点击它打开应用程序的通知,我们希望它打开我们的商店页面APP,可以吗?
【问题讨论】:
标签: android parse-platform push-notification
所以我们的应用程序我们有 Parse API,发送推送通知和管理后端的东西,我们正在发送和update the appnotificaiton bt 点击它打开应用程序的通知,我们希望它打开我们的商店页面APP,可以吗?
【问题讨论】:
标签: android parse-platform push-notification
到目前为止,我一直使用此代码。您可以检查是否安装了 Google Play 商店应用,如果是这样,您可以使用“market://”协议。只需编写您的代码,而不是从您尝试从通知面板打开您的应用活动的地方。
final String my_package_name = "........." // <- HERE YOUR PACKAGE NAME!!
String url = "";
try {
//Check whether Google Play store is installed or not:
this.getPackageManager().getPackageInfo("com.android.vending", 0);
url = "market://details?id=" + my_package_name;
} catch ( final Exception e ) {
url = "https://play.google.com/store/apps/details?id=" + my_package_name;
}
//Open the app page in Google Play store:
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(intent);
【讨论】: