Port of NotifyMe for Xamarin.Android.
A Android Library for simple notifications. Very easily set a delay or time when you want the notification to popup. Notification will popup through system reboots.
TODO
Install NuGet to the target Android application project:
- Xamarin.Android.Support.v4
The native library still uses support libraries instead of AndroidX.
Permission:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application>
:
<receiver android:name="com.allyants.notifyme.NotificationPublisher" />
<receiver android:name="com.allyants.notifyme.BootNotifyMe">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
Create a NotifyMe Builder Object
var notifyMe = new NotifyMe.Builder(ApplicationContext);
Then set the fields you want.
notifyMe.Title(String title);
notifyMe.Content(String content);
notifyMe.Color(Int red,Int green,Int blue,Int alpha);//Color of notification header
notifyMe.led_color(Int red,Int green,Int blue,Int alpha);//Color of LED when notification pops up
notifyMe.Time(Calendar time);//The time to popup notification
notifyMe.Delay(Int delay);//Delay in ms
notifyMe.Large_icon(Int resource);//Icon resource by ID
notifyMe.Rrule("FREQ=MINUTELY;INTERVAL=5;COUNT=2")//RRULE for frequency of notification
notifyMe.AddAction(Intent intent,String text); //The action will call the intent when pressed
After all the fields that you want are set just call build()!
notifyMe.Build();
© 2020