Closed girishw closed 4 years ago
I found a few problems with this issue:
The error you're getting is likely to cause push notifications to fail on both iOS and macOS Catalyst. Can you try generating a new auth key and uploading it to Firebase console?
I tried with a new APNS key and am seeing the same result. A few more data points:
I also see the following warning : 6.18.0 - [Firebase/InstanceID][I-IID003014] Running InstanceID on a simulator doesn't have APNS. Use prod profile by default.
@chliangGoogle could InstanceID be mistaking the Catalyst runtime for a simulator environment?
Looks like that's coming right from GoogleUtilities itself - https://github.com/firebase/firebase-ios-sdk/blob/0dd8dda16557cc56fb93e29fac966e889c3d8347/GoogleUtilities/Environment/third_party/GULAppEnvironmentUtil.m#L203-L211
We should be checking TARGET_OS_MACCATALYST
here.
Also it looks like the example needs to change, too: https://github.com/firebase/firebase-ios-sdk/blob/e028c72162a3df49ce3147aa2fc2fca4841353da/Example/Messaging/Sample/iOS/Environment.swift#L20-L27
The Swift sample should use #if targetEnvironment(simulator)
instead of checking architectures.
This fix will be in the next release, but you can test it out now by installing the pod directly from GitHub.
@morganchen12 This fixed the InstanceID/APNS warning but still hasn't fixed the APNS authentication error.
I can help take a look at. Are you able to reproduce with catalyst?
Yes, I am seeing when I build my app for Catalyst. The same code + configuration built for iOS does not have the problem. Do I need to make any changes to the bundle ID?
Can you share with us the APNS authentication error?
@chliangGoogle
Error: Auth error from APNS or Web Push Service Raw server response: "{"error":{"code":401,"message":"Auth error from APNS or Web Push Service","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.firebase.fcm.v1.FcmError","errorCode":"THIRD_PARTY_AUTH_ERROR"}]}}"
at FirebaseMessagingError.FirebaseError [as constructor] (/srv/node_modules/firebase-admin/lib/utils/error.js:42:28)
at FirebaseMessagingError.PrefixedFirebaseError [as constructor] (/srv/node_modules/firebase-admin/lib/utils/error.js:88:28)
at new FirebaseMessagingError (/srv/node_modules/firebase-admin/lib/utils/error.js:253:16)
at Function.FirebaseMessagingError.fromServerError (/srv/node_modules/firebase-admin/lib/utils/error.js:283:16)
at Object.createFirebaseError (/srv/node_modules/firebase-admin/lib/messaging/messaging-errors.js:34:47)
at /srv/node_modules/firebase-admin/lib/messaging/messaging-api-request.js:76:42
at
So the error is from server side, meaning your client apns token was not setup correctly. You mentioned that "UNUserNotificationCenter.current().requestAuthorization(options:) does not show a dialog to the user." This seems like your push notification setting in xcode wan't setup correctly. Can you double check that to make sure the dialog got pop out?
From the api, make sure your have Mac Catalyst 13.0+. https://developer.apple.com/documentation/usernotifications/unusernotificationcenter/1649527-requestauthorization And make sure you enable push notification in capabilities in xcode and setup the signing and provisioning correctly.
can you also check if you are getting apns token right now?
@chliangGoogle
"However, when I build and run for Catalyst, I am seeing the error. " Do you see any error in xcode when you switch? specifically signing errors with your existing push notification provisioning profile?
I see the following errors, not sure if they are related:
[User Defaults] Couldn't write values for keys ( ApplicationAccessibilityEnabled ) in CFPrefsPlistSource<0x600002c21780> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: Yes): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
[User Defaults] Couldn't write values for keys ( FullKeyboardAccessFocusRingEnabled ) in CFPrefsPlistSource<0x600002c21780> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
[User Defaults] Couldn't write values for keys ( ApplicationAccessibilityEnabled ) in CFPrefsPlistSource<0x600002c21780> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: No): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access
[Firebase/Core][I-COR000008] The project's Bundle ID is inconsistent with either the Bundle ID in 'GoogleService-Info.plist', or the Bundle ID in the options if you are using a customized options. To ensure that everything can be configured correctly, you may need to make the Bundle IDs consistent. To continue with this plist file, you may change your app's bundle identifier to 'com.myApp.bundleIF'. Or you can download a new configuration file that matches your bundle identifier from https://console.firebase.google.com/ and replace the current one.
Couldn't read values in CFPrefsPlistSource<0x600002c51780> (Domain: group.myApp.bundleID, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd
[Firebase/InstanceID][I-IID003014] Error while reading embedded mobileprovision Error Domain=NSCocoaErrorDomain Code=260 "The file “embedded.mobileprovision” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/.../Developer/Xcode/DerivedData/MyApp-bfnufiqtzeksrgetsiycpfkfzngu/Build/Products/Beta-maccatalyst/MyApp.app/embedded.mobileprovision, NSUnderlyingError=0x600000db5fb0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
I see couple of issues here:
@chliangGoogle Regarding 3: I am currently using the admin send function as described here: https://firebase.google.com/docs/cloud-messaging/send-message
Do I just substitute the APNS token for the FCM registration token to test 3?
no, you will use Apple's sender API: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns/
You can try something like this:https://github.com/firebase/firebase-ios-sdk/issues/4042#issuecomment-542359566
I used the following to test: https://github.com/onmyway133/PushNotifications
While I don't see the notification delivered on the device, I don't see an error message either. The PushNotifications app shows a success message.
Edit: Correction. The notifications are being delivered. The first notifications were delayed for some reason.
I see so number 3 is not an issue, we are working on issues 1 and 2.
Looking at the bundleID issue now, also related to #5126
@girishw Please try again with xcode 11.4 which allows to use the same bundle ID as your iOS one.
I managed to get it working after #5165. So if you can enable it without using the bundle ID prefix with maccatalyst and wait for the next release with #5165 should resolve the issue.
@chliangGoogle I rebuilt my app with Xcode 11.4, Use iOS Bundle Identifier checked. I built with the github sources. I now see the following error message:
{ Error: Requested entity was not found.
at FirebaseMessagingError.FirebaseError [as constructor] (/srv/node_modules/firebase-admin/lib/utils/error.js:42:28)
at FirebaseMessagingError.PrefixedFirebaseError [as constructor] (/srv/node_modules/firebase-admin/lib/utils/error.js:88:28)
at new FirebaseMessagingError (/srv/node_modules/firebase-admin/lib/utils/error.js:253:16)
at Function.FirebaseMessagingError.fromServerError (/srv/node_modules/firebase-admin/lib/utils/error.js:283:16)
at Object.createFirebaseError (/srv/node_modules/firebase-admin/lib/messaging/messaging-errors.js:34:47)
at /srv/node_modules/firebase-admin/lib/messaging/messaging-api-request.js:76:42
at
I verified that messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) is being called and I am using the new FCM token.
Do I need to do anything else to reset my app for the new configuration?
Can you reset your app uninstall it and reinstall again?
@chliangGoogle I am running builds from Xcode to test. I tried deleting the user's account and running a first launch process with authorization of notifications, etc. Still the same result :-(
Are you running on mac or ipad? Is it possible to share your debugLog with me? You can send directly to me.
Sync offline and customer didn't get the latest version of code. @girishw please try again with the patch changes of #5165 and reopen the issue if it still doesn't work for you.
same problem for me, i have pod version 6.21 i accept permission to allow push on my catalyst app i dont receive push on IOS it works like a charm
any help ? its something special to do with catalyst ? i add keychain sharing capability as i read it in 6.21 readme, but its change nothing.
The fix is in the next release. Please wait for 6.22 and see if that resolves the issue.
hey hey, i get the 6.22 and test push with cloud messaging test in firebase console, its not working, i don't get notification on my mac with my catalyst app.
I am unable to get push notifications working for Catalyst. My current setup works correctly for iOS but shows an authentication error for Catalyst.
Code Excerpts
Error { Error: Auth error from APNS or Web Push Service Raw server response: "{"error":{"code":401,"message":"Auth error from APNS or Web Push Service","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.firebase.fcm.v1.FcmError","errorCode":"THIRD_PARTY_AUTH_ERROR"}]}}" at FirebaseMessagingError.FirebaseError [as constructor] (/srv/node_modules/firebase-admin/lib/utils/error.js:42:28) at FirebaseMessagingError.PrefixedFirebaseError [as constructor] (/srv/node_modules/firebase-admin/lib/utils/error.js:88:28) at new FirebaseMessagingError (/srv/node_modules/firebase-admin/lib/utils/error.js:253:16) at Function.FirebaseMessagingError.fromServerError (/srv/node_modules/firebase-admin/lib/utils/error.js:283:16) at Object.createFirebaseError (/srv/node_modules/firebase-admin/lib/messaging/messaging-errors.js:34:47) at /srv/node_modules/firebase-admin/lib/messaging/messaging-api-request.js:76:42 at
at process._tickDomainCallback (internal/process/next_tick.js:229:7)
errorInfo:
{ code: 'messaging/unknown-error',
message: 'Auth error from APNS or Web Push Service Raw server response: "{"error":{"code":401,"message":"Auth error from APNS or Web Push Service","status":"UNAUTHENTICATED","details":[{"@type":"type.googleapis.com/google.firebase.fcm.v1.FcmError","errorCode":"THIRD_PARTY_AUTH_ERROR"}]}}"' },
codePrefix: 'messaging' }
Configuration