티스토리 뷰
알림을 앱에서 등록할 수 있는 기능이 있죠.
로컬 푸시. 등록할수 있는 갯수의 제한이 있기는 하지만.
유용하게 사용할수 있습니다. 64개까지 등록 가능.
NSDictionary *alertData = [userInfo objectForKey:@"alert"];
UILocalNotification *noti = [[UILocalNotification alloc]init];
noti.fireDate = [NSDate dateWithTimeIntervalSinceNow:10];
noti.timeZone = [NSTimeZone systemTimeZone];
noti.alertBody = [alertData objectForKey:@"body"];
noti.category = @"category1";
noti.applicationIconBadgeNumber = [[alertData objectForKey:@"badge"] integerValue];
noti.soundName = UILocalNotificationDefaultSoundName;
noti.userInfo = userInfo;
[[UIApplication sharedApplication] scheduleLocalNotification:noti];
10초뒤에 알림이 발생하도록 한것입니다.
주의할 점은 말씀드린것처럼.
1. 갯수의 제한이 있다.
2. 백그라운드에서는 등록이 안된다.
그럼 수고하세요.
'Mobile > iOS' 카테고리의 다른 글
| [iOS][Swift] 주석 사용하기 (0) | 2017.05.10 |
|---|---|
| [iOS][Objective-C] TextView Padding (0) | 2017.02.02 |
| [iOS][Objective-C] 8.0부터 Notification에 버튼달기 (0) | 2017.01.05 |
| [iOS][Objective-C] Label 높이 구하기 (0) | 2016.12.17 |
| [iOS] 애플 가이드 라인. 한국어 (0) | 2016.11.29 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Codable
- Xcode
- SWIFT
- CentOS
- nodejs
- ios
- Gradle
- android
- Python
- cocoapods
- docker
- ubuntu
- golang
- Spring
- tomcat
- war
- intellij
- github
- Linux
- git
- rxswift
- Kotlin
- Windows
- enum
- MySQL
- Java
- centos8
- go
- php
- windows10
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
글 보관함