Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Apns Delegate Never Fired" while using Firebase Auth with and without swizzling #507

Closed
moonvader opened this issue Nov 13, 2021 · 8 comments

Comments

@moonvader
Copy link

Description:
I have issue with OneSignal push notifications for iOS app after I added Firebase Auth with phone. All iOS devices listed in OneSignal are marked with "Apns Delegate Never Fired" label and notifications can be sended but app don't receive them.

I found two similar issues

As I understand the problem might be with swizzling that is used by Firebase Auth. I disabled swizzling using info.plist file as it suggested in the official firebase docs. But issue remains, so I think that I am missing something and OneSignal SDK still not being called.

My AppDelegate file looks like

override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
           Auth.auth().setAPNSToken(deviceToken, type: AuthAPNSTokenType.unknown)
 }

 override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {

           if Auth.auth().canHandleNotification(userInfo) {
               completionHandler(.noData)
               return
           }
}

Environment
onesignal_flutter: 3.2.4
flutter 2.5.3
Xcode 13.0

@jkasten2
Copy link
Member

@moonvader Thanks for reporting. Can you attempt to temporally remove Firebase Auth from you project to confirm that the issue is related to any other changes you made to your project at the same time you added Firebase?

The only two things that can cause the "Apns Delegate Never Fired" status is 1. If you device can't connect to Apple's ANPS server to get a push token. This can happen if you're network block ports for example. 2. If there is another SDK / library that swizzles in an incompatible way.

Could you add logging to you didRegisterForRemoteNotificationsWithDeviceToken to see if it is firing? This will rule out the network issue.

Lastly could you note the firebase version you are using? Also if you have a example project reproducing the issue this will help us find the root cause.

@moonvader
Copy link
Author

I am sure that this issues is connected with Firebase Auth problem started right after adding Firebase Auth with phone

firebase_auth: 3.1.4 pub is used

@jkasten2
Copy link
Member

@moonvader Thanks for letting us know, we will attempt to reproduce the issue and report back.

@baraghiffari
Copy link

baraghiffari commented Dec 20, 2021

I have a 2 apps that uses onesignal, one that has this issue has a bunch of firebase plugin installed including firebase_auth 3.3.0 and the other one only firebase_core. My flutter version is 2.5.3

@rupas385
Copy link

rupas385 commented Feb 1, 2022

@moonvader @jkasten2 Hi! I am fighting with the same problem, any update about it?

@adaskaliuk
Copy link

Any updates? Now we begin to think to say Bay Bay to OneSignal.

@jkasten2
Copy link
Member

This issue was most likely fixed in the onesignal_flutter 3.3.2 release. Swizzling as been reworked in this version and should be more compatible with other SDKs.

If you are still seeing an issue please provide details on the exact versions of all SDKs you are using along with your Flutter version.

@abdelrahmanbonna
Copy link

@jkasten2 I am still having the same issue in the latest release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants