Hi All,
Good Day!
We are working on a reservation system mobile application. The Dispatcher can assign trips to the driver. The Application is created using Xamarin Forms. We need the related drivers to get notified before the trip starts (2 Hours Before, 30 Min before the Trip).
Kindly advise how to achieve this
You can use Azure Notification Hubs to send push notifications to a specific app user on a specific device.
1.Add a specific tag in the OnRegistered
method of the PushHandlerService
for each user, should be the user id or something
var tags = new List() { "userid" }; // create tags if you want"
and do the pushnotification from azure portal with the tag you wish
2.Add a parameter(userid) with the payload you send
{"data":{"message":"Notification Hub","param":"5"}}
and onthe OnMessage method in PushHandlerService do a if condition
string paramText = intent.Extras.GetString("param"); if(userid==paramText ) { if (!string.IsNullOrEmpty (messageText)) { createNotification ("New hub message!", messageText); } else { createNotification ("Unknown message details", msg.ToString ()); } }
Note: the First method is recommended
For more details, you can check:https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-aspnet-backend-gcm-android-push-to-user-google-notification
Answers
You can use Azure Notification Hubs to send push notifications to a specific app user on a specific device.
1.Add a specific tag in the
OnRegistered
method of thePushHandlerService
for each user, should be the user id or somethingand do the pushnotification from azure portal with the tag you wish
2.Add a parameter(userid) with the payload you send
and onthe OnMessage method in PushHandlerService do a if condition
Note: the First method is recommended
For more details, you can check:https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-aspnet-backend-gcm-android-push-to-user-google-notification
Hi,
Thank You.
Need one more help.
The Tripe details will be receiving from an API, if that API is containing a Trip for a driver in the next four hours, then we need to send the notification, such a things is possible here...