I am trying to implement Silent Push Notification
in my app for periodically i.e. once in a day upload data to server.
But on iOS 11.2.6 it's consistently failing to call the delegate method
-(void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))
completionHandler
of Silent Push Notification.
In device logs, I can see that the Silent Push Notification is received, but application launch is cancelled by DuetActivitySchedulerDaemon
(as per the logs).
Can you please help me in resolving this issue? Following is the log of device.
Apr 11 21:44:59 iPhone- SpringBoard(UserNotificationsServer)[2696] <Notice>: [com.***.***-myapp] Received remote notification request 91E8-DC24 [ hasAlertContent: 0, hasSound: 0 hasBadge: 0 hasContentAvailable: 1 hasMutableContent: 0 ]
Apr 11 21:44:59 iPhone- SpringBoard(UserNotificationsServer)[2696] <Notice>: [com.***.***-myapp] Deliver push notification request 91E8-DC24.
Apr 11 21:44:59 iPhone- SpringBoard(UserNotificationsServer)[2696] <Notice>: [com.***.***-myapp] Passing content-available push to Duet.
Apr 11 21:44:59 iPhone- SpringBoard(DuetActivityScheduler)[2696] <Notice>: SUBMITTING: <private>.
Apr 11 21:44:59 iPhone- SpringBoard(UserNotificationsServer)[2696] <Error>: Ignoring notification with no alert, sound or badge (com.***.***-myapp): 91E8-DC24
Apr 11 21:44:59 iPhone- SpringBoard(UserNotificationsServer)[2696] <Notice>: [com.***.***-myapp] Not saving push notification 91E8-DC24 to store [ error=Error Domain=UNErrorDomain Code=1401 "Notification has no user-facing content" UserInfo={NSLocalizedDescription=Notification has no user-facing content} ]
Apr 11 21:44:59 iPhone- dasd(DuetActivitySchedulerDaemon)[163] <Notice>: Submitted Activity: com.apple.pushLaunch.com.***.***-myapp:88F855 <private>
Apr 11 21:44:59 iPhone- dasd(DuetActivitySchedulerDaemon)[163] <Notice>: Daemon Canceling Activities: {(
com.apple.pushLaunch.com.***.***-myapp:88F855 )}
Apr 11 21:44:59 iPhone- dasd(DuetActivitySchedulerDaemon)[163] <Notice>: CANCELED: com.apple.pushLaunch.com.***.***-myapp:88F855 <private>!
It does work for some time in other OS and stops completely till next launch.