0

I implemented push notifications on Xamarin Forms for the Android project following this video. The spoken language in the video is portuguese, but the code explains itself. The implementation is done using this plugin. On Android, the implementation works well. I wish I could find the same implementations steps for IOS. Can anyone help?

Thank you!

SamyCode
  • 928
  • 3
  • 14
  • 33

1 Answers1

1

You can always follow up with this Xamarin tutorial on the basics on how to implement push notifications on iOS:

https://developer.xamarin.com/guides/ios/application_fundamentals/notifications/remote_notifications_in_ios/

Besides that the GitHub documentation implies this:

Call CrossPushNotification.Current from any project or PCL to gain access to APIs.

Must initialize plugin on each platform before use. If not initializated before using a method (Register/Unregister) will thow PushNotificationNotInitializedException.

CrossPushNotification.Initialize<'T'> This methods initializes push notification plugin. The generic T should be a class that implements IPushNotificationListener. This will be the class were you would listen to all push notifications events.

iOS On the AppDelegate:
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
    //Consider inizializing before application initialization, if using any CrossPushNotification method during application initialization.
       CrossPushNotification.Initialize<CrossPushNotificationListener> ();
    //...
    return base.FinishedLaunching (app, options);
} 

And I guess that you've already implement the IPushNotificationListener

Beside that you will need to Register/Unregister the device when needed, So I think the plugin is pretty self explained.

There is a similar thread on this topic related to this: How to use Push Notifications in Xamarin Forms

Hope this helps!

Community
  • 1
  • 1
Mario Galván
  • 3,964
  • 6
  • 29
  • 39