Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

different language notification Firebase

How can I send a notifications if the device is in English and an other notification for all other language ?

I tried to make two different audience but the two audience are empty.

like image 336
Max0u Avatar asked Aug 04 '17 15:08

Max0u


1 Answers

Whenever you send an notification to your user you'll send an static payload which contains an message that needs to be displayed to user when the notification is received.

When notification is received we/iOS can't do any translation of the message from one language to another.

So one solution that I can think of is, You have to find out the language setting or preference (based on his locale) of the user and then you've to store this preference in your backend. Then when you want to send the notification to that user, you can look up his language preference and convert your notification message into that particular language and set the message in payload and send it to the user.

So bottomline is, you've to do this translation of the notification message in your backend and then send it to user using notification.

HTH.

like image 110
iamyogish Avatar answered Sep 22 '22 05:09

iamyogish