When I test the PUSH notification of ios using the actual machine, the timing of the method called when the cable is connected and disconnected is different. Is this normal behavior?
ios push-notification
I think that connecting and disconnecting the cable means foreground or background.
The method called depends on whether it is foreground or background.
https://qiita.com/sxo/items/eab3e2bc9febb57cf37f#%E3%81%9D%E3%81%AE3-push%E9%80%9A%E7%9F%A5%E3%82%92%E5%8F%97%E4%BF%A1%E3%81%99%E3%82%8B
// Receive normal Push notifications
- (void) application: (UIApplication*) application didReceiveRemoteNotification: (NSDictionary*) userInfo {
NSLog(@"pushInfo:%@", [userInfo description]);}
// Background Fetch Receives Background
- (void) application: (UIApplication*) application didReceiveRemoteNotification: (NSDictionary*) userInfo
fetchCompletionHandler: (void
)
(^)(UIBackgroundFetchResult)) completionHandler {
NSLog (@"pushInfo in Background: %@", [userInfo description]);
completionHandler (UIBackgroundFetchResultNoData);}
© 2024 OneMinuteCode. All rights reserved.