You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using Firebase Cloud Messaging, it turned out that notifications sent on a schedule according to the recipient's time zone were not displayed on the device. Test notifications that are sent for a specific fcm token are working. The documentation does not describe how you can test notifications on a schedule, so I had to come up with my own way.
We created a unique Analytic User Property for push notifications only to certain devices. We also added userInfo logging to the methods -application:didReceiveRemoteNotification:fetchCompletionHandler:, -userNotificationCenter: didReceiveNotificationResponse:withCompletionHandler: и - userNotificationCenter:willPresentNotification:withCompletionHandler:.
First, not all devices received notifications: 2 out of 10 tested devices, notifications reached. All tested devices have iOS10+.
Secondly, those devices that received the notification were not shown it.
Thirdly, we found confirmation of the guess that the notification sent by the recipient's time zone comes in the form of a silent notification, based on which a local notification with a delay is created.
Due to logging, we got a userInfo that we could debug with. In our case, it looked like this:
When debugging, I found that the local notification is not added to the UNUserNotificationCenter. When calling the method -addNotificationRequest:withCompletionHandler: (FIRMessagingContextManagerService.m:186) in completion an error occurs:
Adding notification request failed with error: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 55 named com.apple.usernotifications.usernotificationservice" UserInfo={NSDebugDescription=connection to service on pid 55 named com.apple.usernotifications.usernotificationservice}
It turned out that the problem lies in adding sound to the UNMutableNotificationContent (FIRMessagingContextManagerService.m:165). In userInfo, the value for the key "gcm.notification.sound" is the string "default", and the UNMutableNotificationContent has the sound property of the UNNotificationSound type. I.e., the correct sound setting for UNMutableNotificationContent has to be done.
The text was updated successfully, but these errors were encountered:
[REQUIRED] Step 1: Describe your environment
[REQUIRED] Step 2: Describe the problem
While using Firebase Cloud Messaging, it turned out that notifications sent on a schedule according to the recipient's time zone were not displayed on the device. Test notifications that are sent for a specific fcm token are working. The documentation does not describe how you can test notifications on a schedule, so I had to come up with my own way.
We created a unique Analytic User Property for push notifications only to certain devices. We also added userInfo logging to the methods
-application:didReceiveRemoteNotification:fetchCompletionHandler:
,-userNotificationCenter: didReceiveNotificationResponse:withCompletionHandler:
и- userNotificationCenter:willPresentNotification:withCompletionHandler:
.First, not all devices received notifications: 2 out of 10 tested devices, notifications reached. All tested devices have iOS10+.
Secondly, those devices that received the notification were not shown it.
Thirdly, we found confirmation of the guess that the notification sent by the recipient's time zone comes in the form of a silent notification, based on which a local notification with a delay is created.
Due to logging, we got a userInfo that we could debug with. In our case, it looked like this:
When debugging, I found that the local notification is not added to the UNUserNotificationCenter. When calling the method
-addNotificationRequest:withCompletionHandler:
(FIRMessagingContextManagerService.m:186) in completion an error occurs:Adding notification request failed with error: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 55 named com.apple.usernotifications.usernotificationservice" UserInfo={NSDebugDescription=connection to service on pid 55 named com.apple.usernotifications.usernotificationservice}
It turned out that the problem lies in adding sound to the UNMutableNotificationContent (FIRMessagingContextManagerService.m:165). In userInfo, the value for the key "gcm.notification.sound" is the string "default", and the UNMutableNotificationContent has the
sound
property of the UNNotificationSound type. I.e., the correct sound setting for UNMutableNotificationContent has to be done.The text was updated successfully, but these errors were encountered: