Simple Local Notification Plugins for Unity
UniLocalNotification - It's a plugin for implementing local notification easily. It can hide processing by platform and register local notification with single code. And several convenient methods are also implemented.
Unity5 or higher
iOS, Android
Initialize the plugin. Plese call the method at the beginning of your app every time.
UniLocalNotification.Initialize();
Register local notification to device. The third argument only use android platform.
// Notify in 10 seconds
int delay = 10;
UniLocalNotification.Register(delay, "message", "title");
Cancell all local notifications registered
UniLocalNotification.CancelAll();
To check whether the user has allowed the notification
bool isPermitted = UniLocalNotification.IsLocalNotificationPermitted();
Open application settings (to allow users to register notifications)
UniLocalNotification.OpenAppSetting();
Use unitypackage at the relase page.
Android status bar icons should be 32-bit PNGs with an alpha channel for transparency. So, you can change the icon by creating your aar library.
- Open AndroidLibraryProject by Android Studio.
- Replase notification icon at the "unilocalnotification/src/main/res/drawable/notification_icon.png".
-
Create AAR
Go to android project root and type "./gradlew assemble".
- Find AAR At "unilocalnotification/build/outputs/aar/".
- Replace AAR at the unity project.