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;
Related
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.
Totally new to Azure and the services it offers, I face many questions about the "Speech" service and the bots that can be created on the Microsoft platform. Currently developing an Android mobile application I'd like to realize the following behavior:
The user records a voice file from the app (using MediaRecorder), this part is ok
Once the recording is finished, this file is sent to Azure function(via an HTTP POST).
The file is translated into Text
The text is sent (step 7) to the bot which reacts accordingly by executing an HTTP request.
Scheme of the process I explained
First of all I wanted to know if this scenario is possible or if I have to use the Speech SDK on my Android application.
Moreover if this scenario is possible, how do I send the text to the chatbot? I've checked this link but it doesn't seem very relevant to me.
NB: My bot has been completely created using "Bot Framework Composer" for the moment, no code has been written, I just wanted to know if my scenario is plausible and above all possible.
Go through your steps, and I think it can be implemented. If you want to send text to bot, you can refer to this request.
Before that, you may need to start a conversation and get the conversationId.
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.
Everyone....!!
Greetings..!!
I am working on XMPP based Chat app . I have used XMPPFramework by Robbie Hanson https://github.com/robbiehanson/XMPPFramework
i have used OpenFire as XMPP Server
I am facing problem to get Push Notification for Group Chat when user is offline.
Currently I am able to get Push Notification for One to One Chat when user is offline . (For this I have created a PHP WebService which fetches the information from ofOffline Table every 60 sec)
But As there are no Offline messages Tables for Group Chat.
Can anyone suggest me How can I get push notification to group when user is offline in group
I need to manage this from Both Android n iOS Chat App
for Android i am using
https://github.com/siacs/Conversations
Look into ejabberd_mod_offline_post
First config the Room must be a Member-Only room, and add all users as members right after you created it, so that be able to get a total.
Add above model into ejabberd models.
Implement a Callback Service to handle the callback post.
The idea is when User go offline
In one-to-one case, offline_message_hook will be raised
In MUC case, muc_filter_message will be raised, and any one not Presence-Available is offline.
The best example would be AMP implementation in the Tigase. It is based on a MessageAmp plugin and AMP component.
The MessageAmp plugin intercepts messages. If it detects that the user is not logged in, it forwards the message to AMP component to store it in an offline storage. In your case, you could have your own Message plugin which, if it detects that the user is offline, could forward the message to your Push component (iOS push or Android push, SMS push or something else).
And all the logic responsible for actual pushing notification to the device should be implemented in that component.
Try checking this MUC - Light and use the mod_zeropush module to modify a bit to handle single and group push from the muc-light.
Its more like whats app , although you may not achieve 100% results as you expect but less complex than the tradition XEP-0045.
I'm writing a library for pushing notifications which will work for both Android and ios. User will only call the push method and give the deviceId.
Is there a way somehow to know is given id Android or iOS, so I can call specific code for Android or iOS.
I hope my question is clear.
What I do is the following, when the mobile registers in Apple/Google it gets an ID, then I send a request to a php that inserts that ID and the platform of the mobile in a MySQL database. When I need to send push notifications, I can make a select in that table to get only iOS devices, Android devices or both.
Something like this:
insert into devices_table (device_id, device_platform) values ("whateveryourIdIs", "android");
Then, to fetch it from the database
select * from devices_table where device_platform = "android"
So you get all the android devices and can push notifications to them.
Hope that helps, or at least give you some more ideas.