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 수신
    }
}




?

  1. 캘리포니아 운전면허 문제

  2. 원어민이 매일 쓰는 일상표현 150개

  3. [mac] 패키지 매니저, MacPort

  4. [ios] APNS, Remote Push 수신 시점에서 앱의 3가지 실행 상태

  5. [ios] 오브젝티브C→스위프트, 코드 변환 손쉽게

  6. [mac] VirtualBox 실행 스크립트와 bash_profile 설정

  7. [ios] 상위 ViewController 가져오기

  8. [ios] 로컬에 있는 JS 파일 웹뷰에서 동적으로 실행하기

  9. [ios] Xcode에서 특정 파일만 ARC 따로 설정하는 방법

  10. [펌] 마이크로서비스, 모노리포, SRE, ... 덮어놓고 구글 따라하면 안 되는 기술들

  11. [ubuntu] 우분투 18.04에 PHP5 설치하기

  12. 콘솔에서 패스워드 걸린 zip 압축하는 명령

Board Pagination Prev 1 ... 84 85 86 87 88 89 90 91 92 93 ... 98 Next
/ 98