Răsfoiți Sursa

Add didFailToRegisterForRemoteNotificationsWithError

Marino Faggiana 8 ani în urmă
părinte
comite
6d45d90e54
1 a modificat fișierele cu 18 adăugiri și 0 ștergeri
  1. 18 0
      iOSClient/AppDelegate.m

+ 18 - 0
iOSClient/AppDelegate.m

@@ -453,6 +453,24 @@
     NSLog(@"DEVICE TOKEN = %@", deviceToken);
 }
 
+- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
+{
+    NSLog(@"Error register remote notification %@", error);
+}
+
+- (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
+    
+    UIApplicationState state = [application applicationState];
+    
+    if (state == UIApplicationStateInactive || state == UIApplicationStateBackground) {
+        
+        NSLog(@"Receive Notification on Inactive or Background state");
+        
+    } else {
+        
+        NSLog(@"Receive Notification on Active state");
+    }
+}
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Quick Actions - ShotcutItem =====
 #pragma --------------------------------------------------------------------------------------------