This question already has answers here:
Push Notifications in Android Platform
(20 answers)
Closed 9 years ago.
I have a website which supports Push-notifications, but what i must do to receive thhis notifications in my app?
You could use Googles Android Cloud to Device Messaging. This also C2DM called funcionality enables you to push short messages to Android Devices. These short messages typically do not contain the actual data but only a code for "there is something available". In a next step, your application pulls the actual data from your server.
You can find a lot of usefull information by searching for c2dm here on StackOverflow. Also see this very usefull tutorial.
For implementng Push-notifications in your app you need to use Cloud to Device messaging or short C2DM
here some tutorial for implementing C2DM in Application:
Android Cloud to Device Messaging (C2DM) - Tutorial
Android Cloud To Device Messaging
For Push Notifications You need a sever side, that will manage your push subscriptions and send pushes to your user base.
Look at Simple guide how to integrate Android Push Notifications, it's easy to integrate Push Notifications into your app using this guide, just add some lines of code.
Related
This question already has answers here:
How to send one to one message using Firebase Messaging
(5 answers)
How can I send a Firebase Cloud Messaging notification without use the Firebase Console?
(17 answers)
Closed 2 years ago.
This might be a duplicate questions, but still. I have seen many tutorials on sending notifications from Firebase Cloud Messaging to an android app, but I don't understand how to send notifications from my angular website to firebase, which will then push these notifications to android app. In all these tutorials, they have sent notifications by manually typing messages in the firebase UI.
My question how do I send notification data from my angular website to FCM, which will then send these notifications to my android app? Any references for this? Any procedure to follow?
In your case, you might consider having your own app server that will provide an API for your angular app to send notification. Here's a documentation on how you can send a notification to a device from your server.
https://firebase.google.com/docs/cloud-messaging/send-message
There are different parts of this implementation actually. First, your app server needs to provide an API to the Android app that will be used to send the firebase registration token from your app when the app is launched. You might consider storing those registration tokens in your backend database.
Then the other API that your server will provide, to send notification, can be integrated in your angular app. The server API should be able to find the exact registration token of the device where you need to send the notification and will call the API from FCM to send the notification to the device. Here's the API doc that you might consider taking a look into.
https://firebase.google.com/docs/cloud-messaging/http-server-ref
Here is a good tutorial that shows how you can implement the server side implementation to send the notification.
https://www.pluralsight.com/guides/push-notifications-with-firebase-cloud-messaging
This question already has answers here:
How to send Device to device notification by using FCM without using XMPP or any other script.?
(3 answers)
Closed 5 years ago.
Is there a way to send push notification between 2 android devices without a server?
I found some tutorials but all of them was using the node.js for sending a notification. (Or I found that some samples that were using the firebase console for doing this)
Nope,
You need a "server" to do push notification. You can use a variety of services to do that, as you mentioned firebase is one of them. You may not need a full on server, but you need some kind of service to do that, you can't simply send notifications between devices straight away:
Some examples are:
AWS Serverless functions
Cloud functions in firebase
If you'd rather use one of these services, then you'll need to configure FCM in your app, you can check how to do that in the docs. And some nice sample codes here :)
I'm trying to create application for Android and iOS and, i want to use push notification on both the application. I'm going to have a server app that will be sending the notification.
but i am trying to APNS and Parse SDK it's common to use ,but i want GCM through push notifications on iOS ,can you please how can it possible ,any such information about GCM to iOS push notifications ,i am googling but i want some suggestions for GCM through iOS device notifications.Can you help me.thank you.
There is very good descriptive instructions in Google Cloud Messaging for iOS guide. It shows whole flow from registration of device token to receive push from server with code example.
After go through above guide, you may go for Setting up a GCM Client App on iOS and you are almost done to use GCM with iOS application
Update: GCM now supports IOS. See Grigo´s comment.
GCM is Android specific. If you want to avoid dealing with 2 different services for IOS and Android, you can use something like Amazon SNS for example. SNS now supports pushing cloud notifications to Android, IOS and Windows devices via the AWS Mobile SDK.
I am looking to create an Android app that uses a MySQL database located on a server. When certain changes are made to this database, I'd like a push notification to be sent to some app users. My question is, is the Google Cloud Messaging Service required to implement this? This page http://developer.android.com/google/gcm/index.html seems to suggest that using the Google Developers Console is also required. If so, is it possible to export this project into Eclipse? Thanks in advance.
My question is, is the Google Cloud Messaging Service required to implement this?
Yes and no, if you want to do real push messages then yes it is required however if you dont want to use GCM you can use XMPP to send messages to devices
Push notification can be generated using alarm in android.See this.
But here you are looking to send push notification after certain changes in your database which is located in your server,for that GCM will be a better option.You can find an excellent tutorial of GCM here.
This question already has answers here:
How to make a chat application in android? [closed]
(6 answers)
Closed 9 years ago.
I am developing an Android app in which I have to implement chat messaging. I would like one to one chat or a group chat.
But I have no idea how to start. Please help me with this stuff. Any help will be appreciated.
A simple chat mechanism will have 2 basic functionalities
Send the message to server (with info about the recipient)
Receive the message from server (designated for my user name)
First step is simple, we can create a web service which will accept the message with additional information about recipient(s). We can create it using any server side language.
Step 2, that is fetching the message from server can be done using 2 techniques, Pull the message (using polling) from server, or Push the message from server to android phone
Polling: In this, the android device will keep accessing server after a few seconds to check if there is a message available for user. This again can be implemented using a simple async task at the client side which will keep calling a web service after say 2-3 seconds. This is fine to use if we are planning to enable chatting only when user is accessing the app (no notifications like gmail or facebook), so that we can kill the polling service when not in use (otherwise it will eat up resources).
Push notifications: a better option is to use push notifications. Android provide Google cloud messaging or GCM (http://developer.android.com/google/gcm/index.html) which will help achieve push from server easily. Otherwise you can try a third party API like urbanairship or pushwoosh depending on your requirement. Push notifications will help the user to receive messages even when he is not using the app.
So in nutshell, a webservice to receive the messages and a push notification mechanism should be sufficient to implement a chat service in android.
Little bit about UrbanAirship
I used UA in one of my projects for push notifications as I needed to support both iOS and Android. If you just want to support Android GCM might also be a good option.
Coming back to UA, check this for sample code and usage: https://docs.urbanairship.com/display/DOCS/Home
The way it works is simple, when someone installs the app and is connected to internet, app registers itself to the UA service. A unique code is specified for each installed app (this is the time when you can capture the user name and unique code and store somewhere in your DB). Next UA provides an API using which you can push a message to designated recipient(s), using the unique codes which are available with UA. These messages can be received by android app and used as per the requirement. Even if the app is not running we can show a notification just like when we receive an email or a message
You can use an existing platform like Scringo. It gives you a one-on-one chat as well as group chat (both the client and the server) as well as the push notification service.