I have a list of Device Id's with me but the regID column of the table got deleted. Is there a way I can send push notifications via GCM with just Device ids?
App is registered on GCM with those Device IDs, only the regID got deleted. The app server I am using is in PHP.
Can I generate registration token for GCM using my app server?
Unfortunately, there is no way to generate, re-generate or refresh registration tokens from an App Server. All of these processes are done on the client app's side.
Is there a way I can send push notifications via GCM with just Device IDs?
Nope. The registration token is the value needed by GCM (or even FCM). You'll have to retrieve the tokens from the client apps somehow and save them (again) accordingly. Having some backups of these tokens would be great.
In general there is no. For send notification you must have a regID what was created on device.
Related
I'm using firebase push notifications php api with android...
When I send a notification from firebase API, to android device, I also make a MySQL input, to register one copy of that, and work!
but...
What happen when the API sends too many push notifications?
There is no problem with my shared server?
I'm worried that my server will collapse for too many records for each push.
Right now It work like this...
Firebase API PHP send notification -> MySQL register that notification in one table -> Android Device recieve the notification.
but I don't think this is the right way...
so... the question is...
what is the proper way to save a firebase push notifications sent...?
I am developing an android application and website as well, in this i want to send notification in real time from Admin panel to specific android application user. The main problem is that using GCM (Firebase CM) there is a token generated from android application and stored it in the database, using this token we can send message from admin panel to android application user. Is there is way that we can receive/send notification without using "token" because e.g. "Teacher send notification to students from Website to Student android application teacher just select the registration name or section and just type what he want to send and click send button. Notification should receive to that particular user.
How we can do it? Can any body help me?
Use Android service and call API as a background and check new entry in notification table, if found new entry display it as a notification
Without Device Token you can not send any notification from Admin Panel to Android App. To send notification FCM needs a unique ID that is Device Token.
To resolve your query:
You can use Alarm Manager or a Background Service that will call your API to check have any new message of teacher in your DB, if have any new message then generate a notification with that message.
Only Background Service is not a complete solution, it will only call your check new message API.
Your Alarm Manager that will trigger at any given time duration e.g. 30 sec and call your Background service.
That can help you without token.
I am developing a web push notification system using Google Cloud Messaging (only web). I am using a GCM registration id to send the push notification in an Android device.
Can anybody tell me if there are any cases or scenarios that the GCM registration id will be changed for a device?
FYI, I would like to share my current knowledge:
The GCM registration id will be changed if the application is updated or re-installed.
If the device OS is updated.
My system design is as follows:
First, I register the registration id of the device in my database ?
(This is the only one time my client access my site and be able to get the registration ID and where I save it).
Then, I send a notification after a month or later (it depends, maybe even after 3 months).
Here are my questions:
If the device OS was updated in during that duration, does the device id change?
If the Chrome browser is updated or reinstalled, does the device registration id change?
If the registration id does change (because of one of the reasons above), how can I send a push notification to the desired device?
Appreciate the help. Thanks in advance.
I am trying to develop an android app that verifies a transaction initiated from a browser on a PC. I want the server application to push a notification of a new transaction to the app so the user can confirm to complete the transaction. The tricky bit is the transaction is specific to a particular person (I'm using this as an alternative to sending an SMS for example). Can anyone help on how to go about this? Is it possible to do this with C2DM or GCM?
Using Android GCM is advisable. The complete reference to GCM is available at
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
Step by step GCM development is given in there. It is really very helpful. Hope this is helpful to you.
The critical thing you need to keep in mind before making a decision is that when you are using GCM, you need to keep a track of the users by keeping their GCM_ID in your database. You can add a gcm_id column to your users table for this and whenever the user opens your app, the gcm_id should be updated in your database. The gcm_id of the user's phone can change, from the official docs:
Note that Google may periodically refresh the registration ID, so you should design your Android application with the understanding that the com.google.android.c2dm.intent.REGISTRATION intent may be called multiple times
GCM push notifications wont be able to reach your users mobile phone all the time,especially if his phone is not connected to internet or switched off.You are using this for transactions etc, so I assume that the notifications must not fail. You should keep a check in your web application to send an SMS or notify the user that this has failed. You should get a response from GCM to your server through which you can identify a failed case.
I have my Android client application that wait for a push message from the GCM Google server... on the server side, my web must store the registration ID of the device, in order to send the push notification to this specific device (calling the GCM Service with a specific PHP class).
The question is, how can I refresh the registration Id of the device every time It is registreted on the Google GCM servers? How can I associate to each users on the web app to a specific registration Id of the android app?
You can use PHpmyadmin tool to creat the data base and use the php script to open,store registration Id and close the db.