2

배경 모드가 활성화 된 앱을 빌드하고 앱이 가져 오는 푸시 알림 페이로드에 '콘텐츠 사용 가능'키가 있습니다. 배경 모드가 설정된 원격 알림을 처리하는 방법

앱이 백그라운드에있는 동안 내가 3 푸시 알림을받을 경우 있음을 의미 didReceiveRemoteNotification 결과가 앱에서 푸시 알림을 얻는다 EVERY TIME 호출되고이 설정 - 기능이 그 안에 3 번 코드를 발사합니다 실행될 때 응용 프로그램 것이다 applicationDidBecomeActive

내 가장 큰 문제는 또는 이후, 배경에서 응용 프로그램을 가져 앱 아이콘을 탭에 관계없이 사용자가 푸시 시스템 경고를 누른 경우 알 수있는 방법이 없다는 것입니다 사용자의 작업으로 인해 didReceiveRemoteNotification이 발생합니다.

사용자가 Sys 알림을 탭했는지 확인할 수있는 방법이 있습니까?

이 : http://samwize.com/2015/08/07/how-to-handle-remote-notification-with-background-mode-enabled/ 하고, 내 질문 상태로, 수있는 방법이 없기 때문에,

답변

-1
For app is background push 
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo 
{ 
    if (application.applicationState == UIApplicationStateInactive || application.applicationState == UIApplicationStateBackground ) 
    { 
     //opened from a push notification when the app was on background 
    } 
} 

For app is terminate state 

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 

    if (launchOptions != nil) { 
     // Launched from push notification 
     NSDictionary *notification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; 

    } 
} 
+0

친애하는 각하, 불행하게도 당신의 대답은 내 문제를 해결할 수없는 도움이 될 것 같지 않습니다 다른 답변 일반적으로 알림 경고와 'didReceiveRemoteNotification'을 탭하는 사용자를 구별합니다. 왜냐하면 BackgroundMode를 사용하면 수신 된 모든 푸시 알림에 대해 'didReceiveRemoteNotification'이 호출되기 때문입니다. 그래서 3 푸시를하면 앱이 백그라운드에 있고 앱 ** 아이콘을 탭합니다 ** 'didReceiveRemoteNotification'이 호출됩니다 ** 3 시간 ** –

관련 문제