Search code examples
c#xamarinxamarin.formsgoogle-cloud-messagingapn

Xamarin Forms and Remote Notification


I'm trying to implement remote notification on a PLC project that supports iOS and Android platforms. I will be using a web API to handle the register and push the notification. I need help on how to set up the remote notifications.

This what I have for the iOS.

My iOS approach:

  1. In AppDelegate implement registration to APN and get device token.
  2. Save that token to my shared project.
  3. For demonstration and simplicity:

    3.A In one of page have a button to register the device with the token to the server using the web API.

    3.B In same page, another button to send notification to that device by using the token and using web API

  4. Handle received notification in AppDelegate

Any hints or tips on to make my appraoch better?

As for android, I don't know any approach to it since I haven't had any experience using it.

I need help on both iOS and Android approach or links to tutorials or samples. Any help will be appreciated it.


Solution

  • I working with Azure Notification Hub and with this tutorials my app working perfect with remote notifications.

    iOS

    https://learn.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-ios-push-notification-apns-get-started

    Android

    https://learn.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-push-notifications-android-gcm