0

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?

Hemant Parmar
  • 3,924
  • 7
  • 25
  • 49
Adnan Ijaz
  • 27
  • 1
  • 8

2 Answers2

0

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

  • I am not expert in android so kindly elaborate it? What do you want to say that i send notification to database from web and receive notification from database? – Adnan Ijaz Feb 06 '18 at 07:29
  • @Ahnan ljaz please see here https://stackoverflow.com/questions/14443448/android-alarmmanager-used-to-call-a-service-to-notify-the-user –  Feb 06 '18 at 07:55
0

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.

Vishal Chhodwani
  • 2,567
  • 5
  • 27
  • 40