I would like to write an instant messaging mobile application with push notifications. One requirement is to have both an iPhone and Android version able to send push notifications between 2 devices regardless of the device type.
I am having trouble coming up with a best solution to send push notifications for the following 4 cases:
Android client -> server -> Android client.
Android client -> server -> iPhone client.
iPhone client -> server -> iPhone client.
iPhone client -> server -> Android client.
I have a few questions:
Did you find pushd simple to handle your push notifications? Did you run into any unforeseen issues?
What are the pros and cons between creating my own node.js server implementation and using pushd for the 4 cases above (minus learning more from doing it myself)?
Would it be simpler to use a different server implementation such as python or php through Apache?
Were there any resources you found to be critical to writing your own server implementation?
Is there a simpler suggestion for implementing push notifications between 2 cross-platform devices?
I've come across UrbanAirship and Pushwoosh but I don't think they apply to my use cases.
I apologize if this question seems to open-ended for SO but I have been struggling with this for the past few nights and am having a hard time coming up with these answers.
Thanks and I appreciate the help!
Check out Parse.com
Its amazing, and their push notification service is much simplier than creating your own.
Set up an endpoint, gated to a database for your push notifications and post to that service w henever necessary. For clientside code, see here for Android and here for iOS. If you'd like server code, leave a comment and I'll post an edit to this answer,
Related
I am building my first Android app and need to know how I could use push notification.
My project is a home alarm system and also I have built my own local web server. Now I want to push a notification from my server to my Android app when an alarm appears in my server.
Currently my garage doors use the MyQ app and when the garage door opens or closes I get a notification on my phone, I want to implement the same thing in my app.
I've been reading about the Google Firebase Cloud Messaging but it seems exceeding my need.
If you need push notification on your cell phone then you definitely need to integrate your app with Google Firebase. (or at least that's the right way of doing it).
Alternatively, there is something called as local notifications & background process in Android you could do long polling to check if the garage door is open (probably every 2 mins or something). However, I don't recommend that as it can drain your mobile battery.
Also I recommend using Flutter as oppose to using Native Android. As there are some pre-built libraries for android and Google Firebase integration.
Take a look at this Youtube video - https://www.youtube.com/watch?v=2TSm2YGBT1s
Ouh, maybe thats a little bit too much for starting with android - nevertheless I want to help you.
You need a communication protocol between your server and your phone (i.e. Firebase as you mentioned or Websockets).
If your server sends a message to you client (your phone) you have to create a notification. (Android Developer Guide). That's the theoretical part. You will also stumble across a lot of
challenges with
asynchronous programming.
Firebase might actually be the simplest option. You could build your own web socket service too, but that would probably be more than you need. See this previous question for more options: Android push notification without firebase
Android has some services that communicate with firebase to receive notifications.
You'll need to implement a service on top of your web server (using backend languages such as Python, Node.js, PHP,...) so it can send notifications when an event happened (like the door closed) witch isn't a simple way for a beginner.
then your web server sends a message to firebase and tells it to send a notification to my client.
so I highly recommend using firebase because of the simplicity of usage. otherwise, you should implement a separate service on your android phone to get the notification (if you want to run it locally) also as explained do the backend side.
We are developing step by step game and need to send a notification to all players of current game when someone made his turn. We have a REST server that uses jersey + jackson implementation.
We know that it is possible to use Google Cloud Messaging for this purpose, however it doesn't support windows phone platform (we want to support Android, iOS, Windows Phone). Yes, Microsoft has their own server, but it requires to learn API of 2 services. Also, we found that server sent events protocol exists that can help us.
Is it good idea to use SSE (on all mobile platforms) instead of push notifications or there are some better solutions?
Thanks.
Using SSE is a bad usage for your requirement, as it will only work when your app is running, no notifications will be received when your app is closed.
You should use the notification system of each plateform you target (GMC for Andorid, Apple Push Service for ios, etc.)
Each device needs to register to the notification server and then you can send notifications to registered devices.
Since your targetting multiple plateforms, it would be easier to use a third party service that will do the registering and message dispatching to all your targetted plateforms through a simple API.
As suggested by Rahul Mathur, Parse is a known and reliable provider. Other possibilities include AWS SNS, Urban Airship, PushWoosh, and a lot more !
I suggest you to use parse as it is easy to implement
For android : https://parse.com/tutorials/android-push-notifications
For iOS : https://parse.com/tutorials/ios-push-notifications
You can also customise your php script on parse console.
I have an application for for iOS, Android and Windows mobile.I want to send notifications to the application. AFAIK as someone new to this, I think that I need to send the notifications from my server to GCM server for Android and APNS for iphone, I have no idea for windows.
I was hoping if I can send the notifications directly to the phone (setting up a XMPP server , what the IM messenger usually use (JABBER,EJABBERD etc.)) without going to APNS of GCM .
EDIT : The application is an enterprise application so some customers don't want to share aur route their data across GCM or APNS servers.
Is that possible, please guide me to the same .
Thanks.
Take a look at https://github.com/Redth/PushSharp, It's a pushnotification service library for Windows, IOS and Android
Push notifications for Windows Phone: http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff402558(v=vs.105).aspx
Or you can use a service like Parse.com that allows you to manage push notifications for all he platforms using one API.
The library does that for you, you first need to do some configuration Check here.
Look a the samples.
i am planning to implement a push notification into android app , i saw so many threads related to that but i am focusing on using XMPP as i have ejabber installed already.
i came across the aSmack library but i am not aware how promising and stable that library is for
pubusb architecture as this model can provide push notifications.
what i want t know is
1) even the receiver who will receive the push notification has to be constantly connected with the ejabbered server ?
2) What should i do to get the advantage of C2MD as using XMPP and aSmack i dont think i will be able t
to get the benefits of C2MD
i have tried few libraries
1) xtify (paid)
2) urbanairship (paid)
3) Android Cloud to Device Messaging ( must require google account )
so i guess better to create your own using XMPP , can any one help me with the above questions
If you want to use a push system, you do not have to be constantly connected to ejabberd. If you prefer to handle the connection / reconnection in a battery optimized way yourself, then you do not need to implement push, as ejabberd serves as a channel for push.
How can I send data from a server to an Android device without the device polling for data?
This is called a server side 'push' and is commonly referred to as 'pushing'. This is a well known feature of the iPhone, however, it does not currently exist on the Android. Android Cloud 2 Device messaging has not yet been released to the general development community. you may want to check out projects such as MQTT and Deacon.
You might consider using Googles cloud to device messaging for a solution.
You'll have to sign up for an account and are only able to use AppEngine servers at the moment.
Your application has to use API level 8 (2.2) in order to be able to receive the cloud's pushes.
GCM (Google Cloud Messaging) is the easiest way, and while GCM provides the basic service of sending messages, there are companies out there that do help you get up and running.
You could take a look at companies like urban airship, xtify and mBlox (developer.mblox.com) to get started with this and have a few additional tools that help you structure the push notifications in a more structured way.
Good Luck with your development!