android – Parse API推送通知,在Play商店打开应用页面

所以在我们的应用程序上我们有Parse API,发送推送通知和管理后端的东西,我们发送和更新应用程序通知bt点击它打开APP的通知,我们希望它打开我们APP的商店页面,是有可能吗? 最佳答案 到目前为止我已经使用过此代码.您可以查看是否安装了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);
点赞