How to send push notification to Firebase with localized content? - android

I migrate application from OneSignal to FCM. In One signal there was a feature that automatically detect the language set on the device. So, when I've sent to oneSignal
{"contents": {"el": "Ο χρήστης User ζητά πρόσβαση στο κοινόχρηστα αρχεία", "en": "User wants access to shared files}} it detects device language and chooses proper content from the request. Is there something like that in Firebase?

In you case you need to save current language of the Device and send the notification according to the Language.
I have sent the data of Hindi Language in Unicode from PHP back end. Hope this will work for you. but the problem is that char length increases and Firebase has Limit on that

The FCM messaging currently does not provide a way to give various translations for a single message. You would have to know in advance what the user's language preference is, then send them a message with just the translation you want them to see. Either that, or you would have to include each translation in the app itself, and send some sort of identifier in the message to tell the app which message to show.

Related

How to Send a text message from the data input on the text view fields?

I am using android studio. I made an application that allows the user to input data in different activities. The goal of the app is that what the user inputs will somehow be retrieved back to me by text message. I was wondering if there was a way to store the information input on the textfields (perhaps using a variable) and then send the variables to my phone as a text message for me to be able to see what was input on them. I’m not sure if this has been done before but I really need help with it. Thanks.
I think, this can be achieved by using the backend services. Whatever user inputs will be stored on database or somewhere using the backend services and retrieve that data using the sms service from backend system to the specific number or phone.

Send diferrent push notification messages depending on languages setting

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.
Making a topic for each languages.
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.
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!
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
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;

FCM differences between Android and iOS about data messages

I'm using Firebase Cloud Messaging to send data payload and display notification in my Android and iOS apps. I'm integrating this in my iOS app and I'm in front of a curious thing.
Short story:
My notification server only send data messages (I mean JSON messages containing "data" field and with no "notification" field). In my Android app this is not a problem because I receive the message even if my app is in background in my Service implementation and I manually build a notification that I display. But in iOS case, how can I receive message when my app is in background to do the same? I mean if I add a "notification" field to my request I see the notification pop on my screen (when app is in background) and I can get data (located in the "data" field) after a click when my app is in foreground.
But can I have data when my app is in the background to manually display a notification?
Important precision:
The content of the displayed notification should be built app side and not server side because the server doesn't have enough informations, this is why I can't send the "notification" field in my payload message.
Thanks
EDIT: I solve (in part) this problem using this link. Shortly, I enabled both Background fetch and Remote notifications under Background Modes (and added content_available : true in the payload). Then I can process data received in didReceiveRemoteNotification: But now it still one thing: how make it works when my app is killed?
EDIT 2: I found something that could be the thing : that. Modifying the payload of a remote notification implies to handle incoming notifications before there are displayed. I'll try.
EDIT 3: Firebase doesn't support the mutable-content key required to make my solution found at EDIT 2 working. Discussion about that is here. So... Any idea?
I do not think it is possible to trigger "stock" notification on iOS from code the same way you do on Android using NotificationBuilder.
The only option available is to use hybrid messages with both notification and data payloads.
Check their doc for more information on hybrid messages.
On 16/02/14, Firebase added compliance with the "mutable-content" key. So that solved my problem and, I think, many people's problems.
Personal thinking:
I consider that 6 months late for this feature is really too much. I hope that future releases'll be up to date with iOS (as well as Android) releases.

Can an android app listen to Yes/No from an email or a text?

I have designed an application that will send an email to all addresses in an sqlite database to check their availability.
Is there any way that the people receiving these emails can reply with a yes/no and the app would listen and take in what the reply was?
If this is not possible for email, can it be done with a yes/no text message?
Thanks in advance.
The replies could certainly be sent as a response to your message and end up in the mailbox corresponding to the sender of your message. Your app could monitor that mailbox for new messages and process them.
You can't use JS in an email, and forms have spotty support (more info). You can instead use href links with unique urls to respond to a single question.
See here for an example.

How to send automatic mail to a person if certain event occured?

I am implementing a temperature sensing system project. I want to write a data on file and in temperature field if it exceed a certain temp then I want to send a mail to a user automatically. How can i do it?
These are the links which will help you in sending email directlty from your android app-
Link 1
Link 2

Categories

Resources