0

I made push notification system with

Amazon SNS + Apple Push Notification Service

Amazon SNS + google cloud messaging

Every mobile phone is subscribing to one topic in amazon SNS and

I send messages via 'Publish a message' function.

However I would like to send defferent messages depending on each mobile phone's language settings.

Is it possible? or where can I set???


Thanks for reply.

Some requires database and others requires api.

However, I don't have either, then I try workaround way.

  1. Making a topic for each languages.
  2. Check the device language and subscript according topics.

In this way, I might need to add more logic for when user changes the device language setting though.

It works well for now. thanks a lot.

whitebear
  • 11,200
  • 24
  • 114
  • 237

3 Answers3

0

Your application should send you language via some api, so you can track record of last updated language and when you push the notification check language and send payload in that language!

In ios, we can get phone's language something like,

 NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];  

( Reference : this so post )

So, when application will launch check the phone language and send to server. and when server push the notification check the last updated language and send in that language!

Community
  • 1
  • 1
Ketan Parmar
  • 27,092
  • 9
  • 50
  • 75
0

You have to manage it with web' database. For example get language from android and ios along with device key. And fire query to get selected language's device and send notification to them. You have to go group by group

Rajesh N
  • 6,198
  • 2
  • 47
  • 58
0

there are two ways to do it.

  • first one if you have const massages: Store your text inside strings.xml and use translation editor(in android studio) to enter your own translation. So when you push notification the massage string will be for the current device local language.
  • second one if your massages depend on website local then you need to do that inside your code. to know the current device local

Locale current = getResources().getConfiguration().locale;