유니티 패키지 매니저에서 Mobile Notifications 패키지 검색.
아래는 공식 도큐먼트.
https://docs.unity3d.com/Packages/com.unity.mobile.notifications@1.4/manual/index.html
Introduction | Mobile Notifications | 1.4.4
Introduction The Unity Mobile Notifications package adds support for scheduling local one-time or repeatable notifications on Android and iOS. Requirements Compatible with Unity 2019.4 or above. Compatible with Android 4.4+ (API 19) and iOS 10.0+. Supporte
docs.unity3d.com
Unity 모바일 알림 패키지는 Android 및 iOS에서 로컬 일회성 또는 반복 가능한 알림을 예약할 수 있는 기능을 지원합니다.
Android
알림 채널 관리하기
Android 8.0부터는 모든 알림을 알림 채널(Notification Channel)에 할당해야 합니다. Unity 모바일 알림 패키지는 알림 채널을 관리하기 위한 API 세트를 제공합니다. 아래 예시는 알림 채널을 생성하는 방법을 보여줍니다.
var channel = new AndroidNotificationChannel()
{
Id = "channel_id",
Name = "Default Channel",
Importance = Importance.Default,
Description = "Generic notifications",
};
AndroidNotificationCenter.RegisterNotificationChannel(channel);
Notifications 권한 요청하기
if (!Permission.HasUserAuthorizedPermission("android.permission.POST_NOTIFICATIONS"))
{
Permission.RequestUserPermission("android.permission.POST_NOTIFICATIONS");
}
간단한 노티 보내기
var notification = new AndroidNotification();
notification.Title = "Your Title";
notification.Text = "Your Text";
notification.FireTime = System.DateTime.Now.AddMinutes(1);
notification.SmallIcon = "my_custom_icon_id";
notification.LargeIcon = "my_custom_large_icon_id";
AndroidNotificationCenter.SendNotification(notification, "channel_id");
더 자세한 사항은 공식 도큐먼트 참조
공식 도큐먼트.
https://docs.unity3d.com/Packages/com.unity.mobile.notifications@1.4/manual/index.html
Introduction | Mobile Notifications | 1.4.4
Introduction The Unity Mobile Notifications package adds support for scheduling local one-time or repeatable notifications on Android and iOS. Requirements Compatible with Unity 2019.4 or above. Compatible with Android 4.4+ (API 19) and iOS 10.0+. Supporte
docs.unity3d.com
https://link.coupang.com/a/Y9zcG
2021 버전 완벽 대응 유니티 교과서 개정5판
COUPANG
www.coupang.com
(첨부 링크는 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.)