【问题标题】:How to send push notification Country wise using Single platform?如何使用单一平台发送推送通知国家明智?
【发布时间】:2016-04-04 02:39:28
【问题描述】:

我们只有一个位于印度的cashback and coupon android app。现在我们正在扩展到印度尼西亚和新加坡。我们正在使用 Parse 进行推送通知。现在我的问题是如何仅向具有相同 Parse 帐户的印度尼西亚用户发送推送通知。就像用户从 Playstore 下载相同的全球应用程序一样,但问题是印度商店与印度尼西亚和新加坡商店不同。如果我只向印度用户发送推送通知,那么他们也会转发给印度尼西亚用户。那么如何对国家进行分类或细分。 谢谢库马尔

【问题讨论】:

    标签: android parse-platform push-notification


    【解决方案1】:

    如果您使用 Parse,您可以像这样设置一个名为“country_code”的自定义变量

    ParseInstallation installation = ParseInstallation.getCurrentInstallation();
    installation.put("country_code", "IN");
    installation.saveInBackground();
    

    要获取国家/地区代码,请参阅stackoverflow question

    现在您可以使用“country_code”键定位用户

    示例:

    ParseQuery query = ParseInstallation.getQuery(); 
    query.whereEqualTo("country_code", "IN");    
    ParsePush push = new ParsePush();
    push.setQuery(query);
    push.sendPushInBackground();
    

    【讨论】:

      【解决方案2】:

      嗯,你可以试试这样的,

      1. 注册/登录后将用户所在的国家/地区存储在 SharedPreference 中。

      2. 然后像这样将国家名称输入ParseInstallation

        ParseInstallation installation = ParseInstallation.getCurrentInstallation();
        installation.put("country", countryNameFromSharedPreference);
        installation.saveInBackground();
        

      现在,在 Parse 的管理面板中,您将能够使用“国家/地区”过滤目标受众。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-02-07
        • 1970-01-01
        • 2023-03-19
        • 1970-01-01
        • 2010-12-17
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多