I have a usecase to be Implemented where I need to send Push Notification from my server which is implemented in SpringBoot.
In my case User will set a date reminder date (from mobile Application which is developed in React Native) which will be saved in my database mysql.
Now I need to check those dates (On server)and send a push notification to the users on that date.
what my guess is I need to continuously check for the reminder date for every user and if reminder date is equals to todays date then send the push notification.
But this approach I don't feel it's good.
Can anyone help me out what should be the architecture for my usecase.
If the app is generating the time the notification should fire, then don't have the server send a push notification. Use a local notification instead.
You can still send something to your server so that it knows a local notification was scheduled if that is data that you will either want or need to do something with, but why go through all the extra code to send a push notification when a local notification should work fine.
If the notification needs to contain some information from your server, I would try to setup your app to notify the server that a notification needs to be setup, request whatever information it will need to show, and then when the request comes back setup a local notification with the proper information.
I think there are even ways to have silent notifications that could fire and grab data from the server and then schedule an immediate local notification to show time sensitive information - assuming you can't request the appropriate information earlier.
Related
I'm working on a old Android native app (java) and i have to do the following: send a notification asking the user to sync the app after 24 hour from the last sync.
I can't use push notifications, so I have to make the device check locally the time of the last sync and notify the user if 24 hours have passed, but even if the app is closed.
Its like a alarm, but the notification should be a "regular notification", of course.
Is this possible? And what is the best way to do it?
Are you looking for doing this directly from the app ? If not we achieved a similar thing using a spring boot server that connect to the fire base and #schedule annotation.
I have same problem. you can use alarmManager with pendingIntent to push notif and use BroadcastReciver. when Notification push , BroadcastReciver start and you can push notif in BroadcastReciver for next day.
its easiest way.
We have developed an Android chat-app having Java Spring-boot as backend. We are using the Mesibo messaging platform. We need to develop a push notification feature. Also, we cannot use FCM as it is blocked in certain countries. Mesibo has provided a webhook and some events for sending a push notification.
How will I deliver messages to the user when the app is closed on the phone or the user is offline? Also, I am not sure how the backend will receive the event on which callback will be sent to Mesibo?
If FCM is blocked in countries, you need to have alternate mechanism to wake up your phone, for example, Baidu.
Set up your webhook in the mesibo console so that mesibo invokes it when there is a message or call for an offline user. You can then use (say, Baidu push) to wake up the phone. Once the phone comes out of sleep, mesibo can take over.
I want to implement push notification for Android and IOS, we have our own app for android and ios from that app user can send various request and after request completion user will get notification by using push notification.
So my question is
1. How I can detect the device to which i need to send notification.
2. I am new to GCM so can somebody help me from how to start this.
3. Every where I have found GCM send RegId to server, so whenever request comes every time I need to generate RegId or I need to check whether that user is registered or not if not register it first and then sends notification.
Thank You.
You don't need to regenerate the Registration ID every time.
In simple terms:
Client registers with GCM and client gets a registration ID.
You need to store the registration ID in your server.
Your server will need to send a list of registration ids with message content to GCM. GCM will respond with a list of successful and unsucessful messages to
the server.
The push events that are successful will go to the corresponding device. Note that the push notification will only show if you have
code on the client that receives it in addition you need to have the
app installed.
The client and server code example on the documentation is easy to implement. Have fun :)
I am working on an iphone messaging application so using APN Servers to send push notification to offline users (as whatsupp does).
I am using Enhanced Notification Format to connect APNs via an API (com.notnoop.apns 1.0.0.Beta7-SNAPSHOT version).
https://github.com/notnoop/java-apns
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/LegacyFormat.html
In some cases push notification is not delivered to some devices in a short period of time though everything works fine in my server application,
I mean pushnotification byte array is written APNs socket buffer without any problem.
At the same time whatsupp can receive push notification properly after that my client application starts receiving notifications from APNS servers.
I wonder if something is triggered in APNs after waiting 10 minutes and received whatsup notification.
I know that Delivery of notifications is a “best effort”, not guaranteed but when whatsupp can receive notification why my application sometimes cannot receive.
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW4
Here is my payload and other parameters:
Expiry:86400
Payload:
{"t":"-13","aps":{"content-available":1,"alert":{"loc-args":["Sender Name John"],"loc-key":"LS_NP"},"sound":"pnsound.aiff","badge":3},"n":"M","m":"NP","j":"905551114444"}
Why I am having this trouble some times? and What I need to check?
Does Apple have an reputation policy in which notification delivered to whatsapp is prioritized?
There is one more notification format (other than both simple and Enhanced)
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html
This format allows us setting priority format, is this format(IMMEDIATELY) get notification delivered 100%?
I am using the Google-GCM service for pushing notifications to a mobile device & building this application in Java EE.
I'm perfectly able to push notifications to the mobile device. And from the client-end (mobile) I'm able to receive input(string).
Henceforth my conceptual question starts: When I'm receiving input from a mobile (let's say: "Hello, Server"), I'm trying to build an automated process on the server-side and in reply it will push a notification (let's say: "Hi client, I'm fine; How are you?") automatically.
I want to grab some idea to push the notification automatically whenever the mobile device is registered. How do I do it?
All realistic implementations of GCM include a stage where an app receives a RegID, and communicates the RegID back to the server, typically via an HTTP service, typically along with some other business specific data. The server would store the RegID, associating it with other data, and later use it to send messages.
Have you implemented automated the delivery of the GCM registration ID to the server yet? If so, in the same piece of code, you might as well push a notification back. If not, do put together some. Server-side implementation would depend on your server's platform, naturally.