Differentiate is the string android device id or ios - android

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.

Related

How to send text message to Azure Bot?

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.

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;

How to avoid hardcoded urls in IOS/Android app

I'm developing a django web-project and I'm going to develop its IOS and Android API.
Is there a way to avoid using hardcoded url addresses in the app code?Something like django url name system
The following problem faces me if there isn't any solution to my question:
If I want to change some of my urls, I should change the app code and also all the previous installed apps on peoples' devices won't work and should be updated.
The way I see it, you probably have two options:
a) Code very generic forwarding links into your app, such as:
http://www.example.com?linkid=1
http://www.example.com?linkid=2
You can then, from your side, forward these on to where you need them to go by using the query string ID number.
b) Write a web service to push updated URLs to your app, maybe on load so you're not polling the service all the time.
How often are the URLs likely to change?

Push notification for XMPP Chat App for offline users in Group

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.

Get Picture Messages To C++ program

I'm currently thinking of setting up a picture message import project. Something like this:
Client Mobile Device [picture message] -> our Server Device
Server Device [picture && number -> Server Computer
However I don't know if there's a possible way to do this. I could set up a google voice account and use something like this in order to retrieve messages, however this doesn't allow picture messages...
So I was thinking of perhaps making an android or iPhone application to redirect picture messages. Though I don't know if this is possible. If it is, how would I go about gathering the messages? The networking is simple enough, however I'm not familiar with the android system, nor the message system of the iPhone.
On the other hand, I could make a simple email server to receive messages from the cell phone provider's email system.
Is any of the above viable? The image as well as the origin number are both needed.
This sounds like a typical client/server application actually, except the commands sent to the server contain binary data.
There are many ways to do this, and many protocols you can use. Email (gmail) is just one example.
What I would do is use HTTP to post binary messages to your web server. This is cool because it manages authentication, data transfer, etc, are all available.
Here's a short example: Secure HTTP Post in Android
Just add authentication on top of that and you're in business!
You would have to do some web server development too.
I hope this helps.
Emmanuel
Ok I think this is possible. I'm not sure how it works but I'll do my best.
First you have to be notified when an SMS is received by listening to SMS_RECEIVED events. BroadcastReceiver + SMS_RECEIVED
Second, you have to read the SMS attachment as explained here: Get attachment from unread MMS messages
Does this help?

Categories

Resources