【问题标题】:Parse API push notification, open app page on play store解析 API 推送通知,在 Play 商店打开应用页面
【发布时间】:2016-06-25 12:53:33
【问题描述】:

所以我们的应用程序我们有 Parse API,发送推送通知和管理后端的东西,我们正在发送和update the appnotificaiton bt 点击它打开应用程序的通知,我们希望它打开我们的商店页面APP,可以吗?

【问题讨论】:

    标签: android parse-platform push-notification


    【解决方案1】:

    到目前为止,我一直使用此代码。您可以检查是否安装了 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);
    

    【讨论】:

    • 如果您认为我的回答正确,请接受回答。谢谢。
    猜你喜欢
    • 1970-01-01
    • 2015-11-13
    • 2014-11-15
    • 1970-01-01
    • 1970-01-01
    • 2023-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多