Support scheduling local one-time or repeatable notifications for Unity games (Android and iOS)
for version 1.0.0
"com.wolf-org.notifications":"https://github.com/unity-package/notification-unity.git#1.0.0",
dependency com.unity.mobile.notifications-2.3.2
and com.cysharp.unitask-2.5.5
"com.unity.mobile.notifications": "2.3.2",
"com.cysharp.unitask": "https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#2.5.5",
- Add define symbol
VIRTUESKY_NOTIFICATION
- Create
NotificationChanel
(viaCreate
>Unity-Common
>Notification Chanel
)
Identifier
Minute
(after t minute notification will be sent)Repeat
(is it repeatable or not)Pig Picture
(only android)Name Picture
(name pig picture notification)Note: File big picture must be place in folder StreamingAsset, Name Picture must contains file extension ex .jpg
-
Override Icon
-
Small Icon
(custom small icon) -
Large Icon
(custom large icon) -
NotificationPrepare
Attach NotificationPrepare to scene to prepare notification android bigpicture, RequestUserPermission android and schedule
- Send notification
public NotificationChanel notificationChanel;
private void Start()
{
notificationChanel.Send();
}
- Schedule notification
public NotificationChanel notificationChanel;
private void Start()
{
notificationChanel.Schedule();
}
- Cancel All Scheduled
public NotificationChanel notificationChanel;
private void Start()
{
notificationChanel.CancelAllScheduled();
}