Skip to content

로컬 알림 기능 ​

일부 게임 개발사는 로컬 알림 기능을 직접 구현하지 않았으므로, 이 기능 관련 인터페이스를 호출할 수 있습니다.


1. 로컬 알림 추가 ​

함수 ​

objective-c
- (void)gamedreamerAddLocalNotificationWithNotificationObject:(GamedreamerLocalNotification *)notificationObject AndCompletion:(void (^)(NSDictionary *result, NSError *error))completion;

매개변수 ​

GamedreamerLocalNotification

속성명속성 타입필수 여부상세 설명
notiIDNSString예로컬 알림에 대응하는 식별 ID입니다. 추가하는 알림의 notiID 가 동일하면 나중에 추가한 알림이 이전 알림을 덮어씁니다. 이 특성을 이용해 같은 유형 알림을 갱신할 수 있습니다.
titleNSString예로컬 알림의 제목
contentNSString예로컬 알림의 내용
isRepeatBOOL예해당 알림이 고정 주기로 반복 발송되는 알림인지 여부
repeatTypeRepeatType아니오주기성 알림의 반복 유형입니다. 현재 세 가지 유형을 지원합니다: RepeatDaily 매일 X시 X분에 알림, RepeatWeekly 매주 X요일 X시 X분에 알림, RepeatMonthly 매월 X일 X시 X분에 알림
targetTimestampNSString예알림 발송 시간

예제 코드 ​

objective-c
#import <Gamedreamer/GamedreamerManager.h>

	        GamedreamerLocalNotification *notification = [[GamedreamerLocalNotification alloc] init];
			NSDate *current = NSDate.date;
			notification.notiID = @"123";
			notification.title = @"test title";
			notification.content = @"test content";
			notification.isRepeat = true;
			notification.repeatType = RepeatDaily;
			notification.targetTimestamp = [NSString stringWithFormat:@"%f",[current timeIntervalSince1970]+20];
			[GamedreamerManager.shareInstance gamedreamerAddLocalNotificationWithNotificationObject:notification AndCompletion:^(NSDictionary *result, NSError *error) {
				NSLog(@"--------%@\n%@--------",result, error);
				}];

2. 추가된 로컬 알림 조회 ​

함수 ​

objective-c
- (void)gamedreamerGetLocalNotificationList:(void (^)(NSArray * notiList))completion;

콜백 ​

속성명속성 타입상세 설명
notiIDNSString로컬 알림에 대응하는 식별 ID입니다. 추가하는 알림의 notiID 가 동일하면 나중에 추가한 알림이 이전 알림을 덮어씁니다. 이 특성을 이용해 같은 유형 알림을 갱신할 수 있습니다.
titleNSString로컬 알림의 제목
contentNSString로컬 알림의 내용
isRepeatBOOL해당 알림이 고정 주기로 반복 발송되는 알림인지 여부
repeatTypeRepeatType주기성 알림의 반복 유형입니다. 현재 세 가지 유형을 지원합니다: RepeatDaily 매일 X시 X분에 알림, RepeatWeekly 매주 X요일 X시 X분에 알림, RepeatMonthly 매월 X일 X시 X분에 알림
targetTimestampNSString알림 발송 시간

예제 코드 ​

objective-c
[GamedreamerManager.shareInstance gamedreamerGetLocalNotificationList:^(NSArray *notiList) {
            NSLog(@"--------%@--------",notiList);
            for (GamedreamerLocalNotification *item in notiList) {
                NSLog(@"--------%@--------",item.targetTimestamp);
            }
}];

3. 추가된 로컬 알림 제거 ​

함수 ​

objective-c
- (void)gamedreamerRemoveLocalNotificationWithNotiID:(NSString *)notiID;

매개변수 ​

매개변수명매개변수 타입매개변수 설명
notiIDNSString삭제할 대상 알림의 식별 ID

예제 코드 ​

objective-c
[GamedreamerManager.shareInstance gamedreamerRemoveLocalNotificationWithNotiID:@"123"];