简体   繁体   中英

How to send push notification Country wise using Single platform?

We are having a cashback and coupon android app based in India only. And now we are expanding to Indonesia and Singapore. We are Using Parse for push notification. Now my problem is How to send the push notification only to Indonesia users with the same Parse account. Like users are downloading the same global app from the playstore but issue is that Indian store is different from Indonesia & Singapore store. And if i am sending a push notification to only Indian user then they are also forwarding to the Indonesia users also. So How to categorize or segment both the country. Thanks Kumar

Well, you can try something like this,

  1. Store the users' country in SharedPreference after registration / login.

  2. Then put the Country name to ParseInstallation like this.

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

Now, in your admin panel of Parse, you'll be able to filter the Target Audience with "Country".

If you are using Parse, you can set a custom variable called 'country_code' like this

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

To get country code refer this stackoverflow question .

Now you can target users using 'country_code' key

example:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM