Contents

?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

iOS 앱에서 push를 수신할 때, 앱의 상태는 다음의 세 가지 상태 중 하나에 있다.


1. 앱이 실행 상태가 아님( push 수신으로 실행됨 )


2. 앱이 foreground( 실행 중 ) 상태에서 push를 수신함


3. 앱이 background 상태에서 push를 수신함


각각의 상태에서 별도의 다른 동작을 위해 이 상태를 구분할 수 있어야 하고, AppDelegate 내에서 다음의 코드를 통해 구분이 가능하다.


# Objective-C

- (BOOL)application:(UIApplication *)application 
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
 
    if (launchOptions && [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]) {
        // 1번 상태에서 push 수신
    }
 
    return YES;
}
 
 
- (void)application:(UIApplication *)application 
    didReceiveRemoteNotification:(NSDictionary *)userInfo
{
    if (application.applicationState == UIApplicationStateActive) {
        // 2번 상태에서 push 수신
    }
    else {
        // 3번 상태에서 push 수신
    }
}




?

List of Articles
No. Category Subject Author Date Views
61 System/OS 무선 인증 서버.. 김도.. ㅋㅋ file hooni 2013.04.23 18619
60 Develop 밸런싱 로봇.. 최종.. (관련 논문도 첨부) ㅋㅋ file hooni 2013.04.23 24157
59 Etc 베지어 곡선 (Bezier curve) file hooni 2013.08.18 238802
58 Develop 베지어 곡선(Bézier curve) 알고리즘(spline 곡선) 3 file hooni 2013.04.23 35257
57 Develop 사이버보안실무 발표자료 (2017.06.08) file hooni 2017.06.05 9579
56 Etc 사이버보안실무 수업 메모 hooni 2017.03.30 2967
55 Develop 사이버보안실무 수업 메모 secret hooni 2017.03.23 0
54 Etc 사이버보안실무 시험. secret hooni 2017.04.20 0
53 PPT 삼성페이(Samsung Pay) 구조 file hooni 2016.09.09 2792
52 Develop 서기의 PHP 동영상 강의(싱싱해) hooni 2013.05.15 31891
51 System/OS 서버 확장을 위한 두 가지 방법 file hooni 2018.08.29 4956
50 Etc 선과 악에 대한 영어논술문항(지킬앤하이드 독서 후 이어지는 심화 수행평가) hooni 2013.12.04 13904
Board Pagination Prev 1 ... 89 90 91 92 93 94 95 96 97 98 99 Next
/ 99