Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Implementing Local Notifications in Xamarin.Forms using Xam.Plugins.Notifier

$
0
0

Hi, i have implemented Local Notifications in Xamarin.Forms using Xam.Plugins.Notifier. I have added the Nuget Package in PCL, iOS and Android.
below code is displaying the notification. i wrote the below chunk of code in my PCL

        CrossLocalNotifications.Current.Show("test" + "  " + " New test", "Some Notification", 5,DateTime.Now.AddSeconds(8));

I have added the below code in AppDelegate.CS

        if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
        {
            // iOS 10.0+
            UNUserNotificationCenter.Current.RequestAuthorization(
                UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound,
                (approved, error) => { });

            UNUserNotificationCenter.Current.Delegate = new UserNotificationCenterDelegate();
        }

I am able to get the notification in iOS but am not getting the notification in Android. Do i need add any code in MainActivity.cs
can someone help me to fix this?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>