Onesignal-ios-sdk: Apns Delegate Never Fired for some iphone

Created on 18 Jun 2019  Â·  51Comments  Â·  Source: OneSignal/OneSignal-iOS-SDK

Hello, Everyone.
I am developing new ios app and using onesignal.com for push notification
https://www.screencast.com/t/6sydJuE2

But I got this issue for some iphone.
some iphones are works well but something is not working.
I am not sure what is this issue.
Please help me.

Help Wanted

Most helpful comment

I could fix this problem by using cocoapods.
I was not using cocoapod when i set up onesignal into ios project.
I reconfigured it from scratch and set up coocapod, it fixed!
Thanks

All 51 comments

Hello,
Can you please paste your Podfile?

This may be related to #180

Hi,

I think I was able to figure out the problem(at least on my end).
So this is how my Podfile looks like

target 'MyProject' do
    pod 'Crashlytics', '~> 3.12.0'
    pod 'Fabric', '~> 1.9.0'
    pod 'MyCustomFramework', '~> 1.0.0'

    target 'MyCustomStaticLibrary' do
        pod 'MyCustomFramework', '~> 1.0.0'
    end
end

I have a static library embedded in the project that causes this similar linking problem with cocoapods #5768. I think because of this problem I get this warning from OneSignal
WARNING: Already swizzled UIApplication.setDelegate. Make sure the OneSignal library wasn't loaded into the runtime twice!

Because of this swizzlingapplication(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) fails and OneSignal can't get the PushToken even if the device is able to acquire one.

Is this correct @rgomezp ?

@wilf16 ,
It's certainly possible, though I'm not 100% certain. Thanks for posting your Podfile. If you were able to resolve, maybe @gyong0108 was able as well? Please respond as I would like to close this issue if it has been resolved

@rgomezp yes, it did resolve the problem in swizzling between cocoa pods and a static library. Although it's not an ideal solution, but for now it will do.

I will close for now. @gyong0108 please comment if you would like to reopen

The problem persists in iOS 13.2.1

im confirm that this problem persists in iOS 13.1.2

i have this problem as well

@mikasaloliz , @rymesaint ,
I recommend getting the full system log from Window > "Devices and Simulators" and press the "Open Console" for your device. The log should then be shared with Apple.

Also, try toggling your WIFI (see #514 )

It doesn't solve the problem.

Got the same issue - any help would be greatly appreciated

Can you post the full log by following the steps I mentioned above?

I'm getting the same error in iOS 13.1.2, I'm using react-native-oneSignal, changing wifi doesn't change anything

@Luckygirlllll ,
Can you post the full log by following the steps I mentioned above?

Please turn on OneSignal logging

Closing due to no response

@rgomezp Please do not close, I have been waiting for a solution for this exact issue. Any improvements?

I am also experiencing this and can provide you with any logs or outputs you require.
onesignal-cordova-plugin 2.6.0
Xcode 11.1
iPhone Xr iOS 13.1.3

Please include the full logs by following the steps I mentioned above

Actually, by brute forcing it by removing the plugin and reinstalling, then updating the pod repo and re-installing the pod it fix the issue for me. However, if it reappears I will do so.

@Twitch247 ,
Thanks for your solution.

@jcancinar , can you please try?

Hello, i am also faced with this issue in ios13.2
Any solid solution??

Can you post the full log by following the steps I mentioned above?

I was dealing with this problem for days. Tried many things. Carthage, Pod file, etc. And then suddenly it worked. I couldn't realize how I did it! Then I tried to figure that out. Now I know what should I do to make it work.

As it says "APNS Delegate Never Fired" in the error message, you should create Push Certificate again and then install on your system and then export it for OneSignal and import. (Wrote it short because I think you know the process)

I think the second one is really weird because that one is WIFI!!! When I realized that, I really get shocked! But it works and everything is fine. I stopped thinking and made my job 👍 :)

Hope this short explanation helps. Greetings...

@rgomezp I have removed EVERYTHING and had a clean start of Cordova. The first plugin I added was Onesignal, it worked. Then I moved the old www files and plugins to the new Cordova project

It simply worked. I still have no idea what caused it but I can live with that.

@musttafa
i regenerated push certiciate again and then install it on onesignal
But it's still not working.

@zootopia106
You use a real device to run your project and WIFI active?

Getting the same issue since few days on all new devices.

image

What I have tried to do:

Used the podfile from the instructions in the SDK setup guide:

target 'Project Name' do
    pod 'OneSignal', '>= 2.6.2', '< 3.0'

end

target 'OneSignalNotificationServiceExtension' do
      pod 'OneSignal', '>= 2.6.2', '< 3.0'

end

Can you post the full log by following the steps I mentioned above?

Push notifications not working with iOS 13 with latest One Signal SDK.

Log
Called init with app ID: aae09674-5055-430a-905f-5130fb9678dc
Firing registerForRemoteNotifications
registerForPushNotifications Called:waitingForApnsResponse: 1
oneSignalApplicationDidBecomeActive
getNotificationTypes:mSubscriptionStatus: -1
oneSignalApplicationWillResignActive
network response (OSRequestGetIosParams): {
updateNotificationTypes called: 15
startedRegister: 1
oneSignalApplicationDidBecomeActive
getNotificationTypes:mSubscriptionStatus: -1
getNotificationTypes:mSubscriptionStatus: -1
oneSignalApplicationWillResignActive
oneSignalApplicationDidBecomeActive
getNotificationTypes:mSubscriptionStatus: -1
getNotificationTypes:mSubscriptionStatus: -1
Calling OneSignal create/on_session
HTTP Request (OSRequestRegisterUser) with URL: https://onesignal.com/api/v1/players, with parameters: {
network response (OSRequestRegisterUser): {
getNotificationTypes:mSubscriptionStatus: -1
getNotificationTypes:mSubscriptionStatus: -1
oneSignalApplicationWillResignActive
HTTP Request (OSRequestOnFocus) with URL: https://onesignal.com/api/v1/players/ab10f8ea-8410-46fe-be91-d1d90455dc22/on_focus, with parameters: {
network response (OSRequestOnFocus): {
oneSignalApplicationDidEnterBackground
apns
Uploading apns2.png…

Have you also uploaded the app to Testflight before or built it directly on the device via XCode? It works for me if I download the version from Testflight.

@Rgomez

I re-configured again with new certs and it is working now, not able to reproduce it anymore so cannot generate the logs.

Will get the logs if it occurs again.

Make sure "Push Notifications" capability in XCode is enabled for your Target projects!
Mine were mysteriously removed when Xcode auto-updated from version 10 to version 11.2.

Great to hear y'all were able to resolve. Is this safe to close?

Still getting Apns Delegate Never Fired in the onesignal dashboard.

@zootopia106 , can you re-upload your cert to the OneSignal dashboard?

I could fix this problem by using cocoapods.
I was not using cocoapod when i set up onesignal into ios project.
I reconfigured it from scratch and set up coocapod, it fixed!
Thanks

The problem didn't fix yet,

I try all the solution above but none works

Note: it works for some mobile

Screen Shot 2019-11-14 at 11 10 49 PM

Today i have this problem (from about 2 a.m. UTC +1), and i must toggle the wifi - i have also some subscription action (that i didn't)

I have the same trouble.
i tried all the solutions but none was helped, but i sure that a token is coming in, because i can get it via didRegisterForRemoteNotificationsWithDeviceToken.
the question is - why it not passing next to onesignal servers?

I had to remove Branch.io plugin in favor of Onesignal. Now it’s working fine.

I will look for a solution again in near future because we need the Branch plugin

My suggestion to you is to remove the other plugins to see which one Onesignal doesn’t work with

Can you please try @jcancinar 's suggestion? Cheers

well, the my problem is not in oneSignal itself, but because some conflict between Corona SDK native project and OneSignal.
apperently, i cant see "Branch.io" plugin in this project, so this stuck me out because i not have expirience in native dev.
I created a thread on Corona forums, where i wrote this situation more detail.

sorry for disturbing, but if you can help in my case, please do.

@otkmember I followed with you on the specific Corona SDK issue on their forums.

@jcancinar With the Branch.io issue if you are seeing this Apns never fired error then the issue is most likely they are swizzling the AppDelegate incorrectly. I recommend making sure you have their latest SDK and reporting this issue to them.

I also have the same problem, but with phonegap build, any insight I can use ?
Regards

After losing my mind I finally found the solution: "background fetch" mode must be enabled on Signing & Capabilities tab.

Schermata 2020-01-04 alle 18 12 12

This works on iPhone 8 with iOS 13.3 and the "APNs delegate never fired" has disappeared

Schermata 2020-01-04 alle 18 18 35

I am getting this error too. I am not usegin CocoaPods and my react native version 0.59.10.

@caglardurmus even updating the OneSignal plugin to the latest version?

@nikiman the background check is a feature in the iOS system phone?
thanks

@canado forgive me that I haven't specified. The background fetch mode must be checked on Xcode (Signing & Capabilities tab) before publishing the app.

ahh ok, because I am not using Xcode but Phonegap Build
So just to make sure, on apple's certificate website there is no such params to check / uncheck?

Issue 1 - APNS Connection

"background fetch" isn't required to register for push, the "Apns Delegate Never Fired" seems to be due to a connection issue to Apple if the problem goes away after toggling wifi or using a different network or iOS device. This might only be an issue with Apple's sandbox's servers.

To avoid splitting the conversation between multiple tickets I am closing this one in-favor of #514. Please check the device logs as noted in https://github.com/OneSignal/OneSignal-iOS-SDK/issues/514#issuecomment-572373987 to see if this is the cause of the issue for you.

Issue 2 - Conflicting Library

If you are consistently seeing the issue after trying the above then the issue is due to another library conflicting with OneSignal's AppDelegate method sizzling. I recommend trying to remove other libraries that support push to narrow down the issue in this case. Once you have narrowed it down to a specific library interfering please open a new ticket with the exact versions so we can reproduce the issue.

Locking Issue

Please read the following two sections above and follow their suggestions. If nether apply please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings