I've added push notification to my ionic mobile app using this tutorial : https://devdactic.com/ionic-push-notifications-guide/ and it's working fine.
The problem now is, to send notifications you need a device token from the phone (this is obtained after registering the device) and the server api is going to use it to send the notification. But I can't have it manually from all the phone I'm testing. How is it theoritically done for distribution to send the notification to all the phone that installed the app?
You would usually store the device-token in a database on the backend-side once you receive it. When you want to send a notification to all devices, you fetch all the tokens from the database and send a message to each one.
Related
Is it possible to create an app that can send notification to the user who does not have the same app installed on his device.
I have come acrossed 'Push Notification' service via GCM and FCM but it requires the app being installed on both the devices to communicate or send notification.
(P.S- No suggestion for web application to user mobile service)
You can use other means of communication like SMS or email.
No. Notifications even though coming from Android Google servers are part of the app environment. So you cannot send an app notification to non app users. If that was the case imagine getting app notifications from Amazon and whatnot.
But you can use some other means like mail, sending links of your app via mail/sending invites via mail or SMS.
I'm very new in meteor and I just made a simple app that show news (text) for a school, the problem is that no one knows when they write something new because the app doesn't have notification. I can't figure out how to use raix:push or richsilv:cordova-notifications because the test of raix:push didn't work in my device (android) and richsilv:cordova-notifications just work with android and I couldn't make it automatic. Saying "automatic" I mean "when the mongo collection is updated a notification is sent"
I think you may need to set up push server for sending notification to Android client.
Google is providing such option, where client app has to register with GCM server. On successful registration, google will give reg Id, which has to be stored in DB.
From your server make HTTP request to GCM server with Reg Id and message. GCM will deliver the message to appropriate device.
Please refer https://developers.google.com/cloud-messaging/gcm
I would like to implement GCM in my Android app:
One Android app
Registered- U_user and another M_user.
I have Google Sign In in my app thats works fine with JSON and GSON and local MySQL database server with tomcat-server restutil to keep storing Gmail login users.
So, I want to send a notification from U_user to M_user.
U_user does a registration that has been pushed to M_user.
How can I do this?
I am assuming you mean the same Android app installed on different phones (U_user's phone and a separate phone for M_user).
To quote a section in the docs:
To make sure that messages go to the intended user:
Your app server can maintain a mapping between the current user and the registration ID.
The app can then check to ensure that messages it receives match the logged in user.
What this means is that you can send messages to another user through GCM. To let the app server know what to send to M_user, let U_user send an upstream message to your GCM app server (only possible in app servers using XMPP - see here). Alternatively, you have the option to do POST requests to your app server via HttpUrlConnection (can work on both XMPP- and HTTP-based GCM app servers).
Regardless of which method you use, specify in these messages to the server that you would like to send a message to M_user.
I wanted to know how to address a specific android phone to send push notifications as the google's gcm is slow and also as i want to learn how to send push notifications without google cloud messaging and to build my own api for sending push notifications to other platform devices .
I'm not sure how to address an android phone whether by its IP address or keep a socket for listening at a port.
Please help!
You not need to use ports or some listening mechanism to build. Use the Google's GCM way.
You need to build a service that will periodically check your server for any massages to get (fetch) for your specific device (keep a self created unique id with each device and registered the device on your the server by that id). Actually this is not pushing. but this is what happening in the GCM server also. When you put some massage for some specific device to your server(it is the pushing) the device will grab that by the service running on it.
simply you have to create a server by yourself (like GCM server)
Then you have to create a service to run on mobile to check updates on your server (like android play service)
I am developing an Android application that can send notifications (not "push") to any other Android device. Apart from Google Cloud Messaging (GCM) are there any alternatives to do so?
I do not plan to use GCM. My only requirement is to send the notification from my app to any other device via either Bluetooth or WiFi.
I have tried using the basic Notification API for Android but I could not send a notification to other device. It shows me a local notification.
this may helps https://www.firebase.com/docs/java-quickstart.html
firebase sync the devices and whatever you send it to server it automatically pushes that in other device