firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.62k stars 1.47k forks source link

Messaging.messaging().token returns errors #13299

Closed hbedekLU closed 3 months ago

hbedekLU commented 3 months ago

Description

Messaging.messaging().token seems to fail in my app for a specific iOS Device. The device is an IPhone on iOS 18 public Beta. I didn't notice any issues before upgrading to the iOS 18 public Beta I have other devices on iOS 18 public beta and these devices are not encountering any issues with the same app build

It currently returns the following error :

Error Domain=com.google.fcm Code=0 "Invalid fetch response, expected 'token' or 'Error' key" UserInfo={NSLocalizedFailureReason=Invalid fetch response, expected 'token' or 'Error' key}

Here is how I retrieve the token :

do {
          let token = try await Messaging.messaging().token()
            self.subscribeToTopics()
            return token
        } catch {
            logMilestone("token: error : \(error)")
            Crashlytics.crashlytics().record(error: error)
            return nil
        }

I noticed similar posts: https://github.com/firebase/firebase-ios-sdk/issues/10679 but the issue is still there on my side

Reproducing the issue

No response

Firebase SDK Version

10.29.0

Xcode Version

15.4

Installation Method

CocoaPods

Firebase Product(s)

Analytics, Crashlytics, Messaging

Targeted Platforms

iOS

Relevant Log Output

Error Domain=com.google.fcm Code=0 "Invalid fetch response, expected 'token' or 'Error' key" UserInfo={NSLocalizedFailureReason=Invalid fetch response, expected 'token' or 'Error' key}

If using Swift Package Manager, the project's Package.resolved

No response

If using CocoaPods, the project's Podfile.lock

PODS:

DEPENDENCIES:

SPEC REPOS: https://github.com/CocoaPods/Specs.git:

SPEC CHECKSUMS: Alamofire: f36a35757af4587d8e4f4bfa223ad10be2422b8c ASN1Decoder: 91cb1d781b5a178ea7375b2f1519e2bdaaa4c427 CocoaLumberjack: 78abfb691154e2a9df8ded4350d504ee19d90732 Firebase: cec914dab6fd7b1bd8ab56ea07ce4e03dd251c2d FirebaseAnalytics: 23717de130b779aa506e757edb9713d24b6ffeda FirebaseCore: 30e9c1cbe3d38f5f5e75f48bfcea87d7c358ec16 FirebaseCoreExtension: 705ca5b14bf71d2564a0ddc677df1fc86ffa600f FirebaseCoreInternal: df84dd300b561c27d5571684f389bf60b0a5c934 FirebaseCrashlytics: 34647b41e18de773717fdd348a22206f2f9bc774 FirebaseInstallations: 913cf60d0400ebd5d6b63a28b290372ab44590dd FirebaseMessaging: 7b5d8033e183ab59eb5b852a53201559e976d366 FirebaseRemoteConfigInterop: 6efda51fb5e2f15b16585197e26eaa09574e8a4d FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc GoogleAppMeasurement: f9de05ee17401e3355f68e8fc8b5064d429f5918 GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15 IQKeyboardManagerSwift: f9c5dc36cba16ddd2e51fa7d51c34a2e083029b5 JOSESwift: 7ff178bb9173ff42c6e990929a9f2fa702a34f69 KRActivityIndicatorView: c5c503bf56e54834382dd926b64ff47287ca0006 KRProgressHUD: d0fb4e72428d312eb6966e84c543ea58fb1efbc7 lottie-ios: a881093fab623c467d3bce374367755c272bdd59 nanopb: 438bc412db1928dac798aa6fd75726007be04262 ObjectMapper: e6e4d91ff7f2861df7aecc536c92d8363f4c9677 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851 SVGKit: 1ad7513f8c74d9652f94ed64ddecda1a23864dea SwiftGen: 4993cbf71cbc4886f775e26f8d5c3a1188ec9f99 SwiftLint: 3fe909719babe5537c552ee8181c0031392be933 TTGSnackbar: 8e7650b9b1f5f44e40228473455986f5c12213c7

PODFILE CHECKSUM: 7899b345f9ac2ab0f424b0a59d79bea1f34427a2

COCOAPODS: 1.14.3

google-oss-bot commented 3 months ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

hbedekLU commented 3 months ago

The problem solved itself after a few days. Same build, same device.