-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
4.5
-
-
MOODLE_405_STABLE
-
Moodle Apps - 2024 i3.1, Moodle Apps - 2024 i3.2
The first time that the app starts, it seems the registration in FCM is ok and we receive the push ID to use to send push notifications. However, if you restart the app then we no longer get that push ID, it seems the registration is failing for some reason.
This is probably a regression caused by MOBILE-4563.
There are 2 messages in the Xcode console that could be related to this:
10.23.1 - [FirebaseCore][I-COR000003] The default Firebase app has not yet been configured. Add `FirebaseApp.configure()` to your application initialization. This can be done in in the App Delegate's application(_:didFinishLaunchingWithOptions` (or the `@main` struct's initializer in SwiftUI). Read more: https://goo.gl/ctyzm8.
This message is quite weird, because it appears on the console when we call [FIRApp configure] (so it seems the configure function is telling us to call the configure function, which makes no sense).
10.23.1 - [FirebaseMessaging][I-FCM002022] APNS device token not set before retrieving FCM Token for Sender ID '694767596569'.Be sure to re-retrieve the FCM token once the APNS device token is set.
10.23.1 - [FirebaseMessaging][I-FCM002022] Declining request for FCM Token since no APNS Token specified
Error getting FCM registration token: Error Domain=com.google.fcm Code=505 "No APNS token specified before fetching FCM Token" UserInfo={NSLocalizedFailureReason=No APNS token specified before fetching FCM Token}
This is probably the cause of the problem. But the first time the app starts this message also appears in the console, but the push ID is retrieved successfully.