1.4.1 • Published 4 years ago
com.beatles.unity.mn v1.4.1
MobileNotifications
package: com.beatles.unity.mn
Local Notification for Android and iOS
description
初始化
public class NewBehaviourScript : MonoBehaviour
{
void Start()
{
MobileNotifications.Create();
}
}
发送一个通知
var _service = MobileNotifications.GetInstance();
var now = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds();
LocalNotification localNotification = new LocalNotification(NotificationHelloId, "NotificationTest", "hello, 😈🐒", now + 5000 /* 5 seconds */);
localNotification.SmallIcon = "icon";
localNotification.UserData.Add("Hello", "World");
_service.ScheduleNotification(localNotification);