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 for some iphone #503

Closed
gyong0108 opened this issue Jun 18, 2019 · 51 comments
Closed

Apns Delegate Never Fired for some iphone #503

gyong0108 opened this issue Jun 18, 2019 · 51 comments

Comments

@gyong0108
Copy link

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.

@rgomezp
Copy link
Contributor

rgomezp commented Jun 25, 2019

Hello,
Can you please paste your Podfile?

This may be related to #180

@wilf16
Copy link

wilf16 commented Jun 26, 2019

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 swizzling application(_ 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 ?

@rgomezp
Copy link
Contributor

rgomezp commented Jul 8, 2019

@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

@wilf16
Copy link

wilf16 commented Jul 9, 2019

@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.

@rgomezp
Copy link
Contributor

rgomezp commented Jul 9, 2019

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

@rgomezp rgomezp closed this as completed Jul 9, 2019
@AlbertoLourenco
Copy link

The problem persists in iOS 13.2.1

@rgomezp rgomezp reopened this Oct 3, 2019
@mikasaloliz
Copy link

im confirm that this problem persists in iOS 13.1.2

@rymesaint
Copy link

i have this problem as well

@rgomezp
Copy link
Contributor

rgomezp commented Oct 14, 2019

@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 )

@AlbertoLourenco
Copy link

It doesn't solve the problem.

@michelalbers
Copy link

Got the same issue - any help would be greatly appreciated

@rgomezp
Copy link
Contributor

rgomezp commented Oct 15, 2019

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

@Luckygirlllll
Copy link

Luckygirlllll commented Oct 17, 2019

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

@rgomezp
Copy link
Contributor

rgomezp commented Oct 17, 2019

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

Please turn on OneSignal logging

@rgomezp
Copy link
Contributor

rgomezp commented Oct 29, 2019

Closing due to no response

@rgomezp rgomezp closed this as completed Oct 29, 2019
@echopulse0
Copy link

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

@Twitch247
Copy link

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

@rgomezp rgomezp reopened this Oct 30, 2019
@rgomezp
Copy link
Contributor

rgomezp commented Oct 30, 2019

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

@Twitch247
Copy link

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.

@rgomezp
Copy link
Contributor

rgomezp commented Oct 30, 2019

@Twitch247 ,
Thanks for your solution.

@jcancinar , can you please try?

@wangxpert
Copy link

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

@rgomezp
Copy link
Contributor

rgomezp commented Oct 31, 2019

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

@musttafa
Copy link

musttafa commented Oct 31, 2019

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...

@echopulse0
Copy link

@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
Copy link

musttafa commented Nov 1, 2019

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

@flemx
Copy link

flemx commented Nov 1, 2019

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

@rgomezp
Copy link
Contributor

rgomezp commented Nov 1, 2019

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

@j2damax
Copy link

j2damax commented Nov 4, 2019

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…

@Russel1
Copy link

Russel1 commented Nov 4, 2019

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.

@flemx
Copy link

flemx commented Nov 4, 2019

@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.

@kevinpham404
Copy link

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.

@rgomezp
Copy link
Contributor

rgomezp commented Nov 7, 2019

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

@wangxpert
Copy link

Still getting Apns Delegate Never Fired in the onesignal dashboard.

@rgomezp
Copy link
Contributor

rgomezp commented Nov 7, 2019

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

@wangxpert
Copy link

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

@rgomezp rgomezp closed this as completed Nov 8, 2019
@summonerriftofficial
Copy link

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

@niqt
Copy link

niqt commented Nov 22, 2019

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)

@otkmember
Copy link

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?

@echopulse0
Copy link

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

@rgomezp rgomezp reopened this Dec 9, 2019
@rgomezp
Copy link
Contributor

rgomezp commented Dec 9, 2019

Can you please try @jcancinar 's suggestion? Cheers

@otkmember
Copy link

otkmember commented Dec 10, 2019

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.

@jkasten2
Copy link
Member

@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.

@canado
Copy link

canado commented Dec 18, 2019

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

@ghost
Copy link

ghost commented Jan 4, 2020

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

@caglardurmus
Copy link

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

@ghost
Copy link

ghost commented Jan 6, 2020

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

@canado
Copy link

canado commented Jan 6, 2020

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

@ghost
Copy link

ghost commented Jan 7, 2020

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

@canado
Copy link

canado commented Jan 7, 2020

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?

@jkasten2
Copy link
Member

jkasten2 commented Jan 9, 2020

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 #514 (comment) 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.

@jkasten2 jkasten2 closed this as completed Jan 9, 2020
@OneSignal OneSignal locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests