Requirements
2018.3 or above;
Android 4.4+ (API 19);
iOS 10.0+;
This is a easy to install and use plugin for local push notifications for iOS and Android (for now). Also with an easy maintence notifications using asset bundles.
First if all you need to Initialize the Plugin passing the the DaysNotificationConfigurationItem object.
Which can be created manually or get from with Addressable;
Manually:
DaysNotificationManager.Initialize(new DaysNotificationConfigurationItem());
Addressable:
Addressables.UpdateCatalogs();
Addressables.LoadAssetsAsync<DaysNotificationConfigurationItem>("PathForAsset/AssetName.asset",
delegate (DaysNotificationConfigurationItem item)
{
DaysNotificationManager.Initialize(item);
});
You can post the Notification using the Key for it ou creating its data in runtime.
With Key:
DaysNotificationManager.PostNotification("KEY_VALUE");
Creating and posting it in runtime:
NotificationData data = new NotificationData
{
NotificationTitle = "Notification Title",
NotificationDesc = "Notification Desc",
FireTime = 20, // Can be seconds to trigger or hour and minutes in absolute time
UseAbsoluteTime = false, // True will use absolute time, while false will be seconds to trigger it
ExtraTime = 0 // Minutes for the absolute time,
SmallIcon = "small_icon_name", //Without the .png or .jpeg
LargeIcon = "large_icon_name", //Without the .png or .jpeg
ChannelID = "Android Notification Channel"
};
DaysNotificationManager.PostNotification(data);
For more information, check the sample on the Package.
To create a new DaysNotificationConfiguration item:
Frist, for Android notification only:
Open MenuItem Daily Solutions/Daily Notifications/Android Channel Configuration
Click on Add New to create a new Channel configuration
Configure the Channel ID to access the Channel in Runtime. The user can't see it.
Configure the Channel Name, which the user can see it.
Configure the Channel Description, which the user can see it.
Configure the Importance Level. This will allow the Android system to notify you player with the right importance. (Take a look on this link to know more about it)
You can also setup a few extrar configurations to make your Notification unique using the Extra Values.
Open MenuItem Daily Solutions/Daily Notifications/Notification Editor
Click on Add New to create a new Notification configuration
Configure the NotificationKey, this will help you access the notification configuration in Runtime.
If you want to configure a identifier for you Notification, you can setup it enabling the Has Identifier? toggle and configure the Identifier value.
Configure the Notification Title, which will appear as title for you user.
Configure the Notification Desc, which will appear as description of the notification for you user.
Configure the Notification Subtitle (iOS only), which will appear as a subtitle for your user.
Configure the Fire Time to trigger you notification, this is the how many seconds from the post that the notification will trigger.
If you want to make the notification trigger in a specific hour and minutes, you can use the Use Absolute Time toggle for it.
The Small Icon and Large Icon are the Icons used to show in your notification.
Use the Notification Style (Android Only) to change between normal notification and Big Text Style
For Android, you need to configure the Channel ID which this notification will be posted.