[Resolved] Broken iOS Push?

Hey, i’ve noticed some strange behaviour as of build 928 and up with the “remoteRegistration” event; the push notification listener no longer seems to get called so we no longer get a push token. Everything works in 927 and previous.

Has anyone else noticed this?

[import]uid: 105599 topic_id: 32377 reply_id: 332377[/import]

Hey James,

Have you filed a bug report about this? If so could I please get the case #? If not please do, with a simple attachment the team can use to reproduce. The fact you know build number it first started appearing in should be a big help.

Thanks,
Peach :slight_smile: [import]uid: 52491 topic_id: 32377 reply_id: 128825[/import]

I’ve just reduced the code to the min required for push to work…and now i get a token even in the latest build for my test case…so something else has changed between build 927 and 928 that is causing my listener not to be called, but it now only seems indirectly related to push. I’ll see if i can’t figure out the correlating factor. [import]uid: 105599 topic_id: 32377 reply_id: 128864[/import]

So i moved the registration of the notification listener to earlier in my code, and it works now.

I guess somewhere between build 927 and 928, my notification listener started getting registered AFTER the token had been already been delivered by iOS, and so the event never fired because it had already happened.

Basically, i have a number-based-index table that i use to store anon functions, each of which is responsible for loading a resource…on boot i loop through this table and call each of the functions (after each call i update a loading-progress bar and show a “Play” button when all functions have been called)…the notification listener registration was in one of these funcs, loaded latently within the loop. Taking the registration of the listener-function out of this resource-loading loop and dropping it right into the start of my main.lua file seems to have solved the problem.

BUT i wonder if this could happen at some time in the future anyways? Is there some chance that iOS will still deliver the token “too early”? i.e. when does the event fire exactly and where is the line of “registered in time to get the token” and “registered too late! nothing works!”? :slight_smile: [import]uid: 105599 topic_id: 32377 reply_id: 128865[/import]

TL;DR

Not a corona bug. Register your notification listener as early as possible in your code, or you might miss the the push token being delivered and your event will never fire, thereby making you want to jump out a 2nd story window. [import]uid: 105599 topic_id: 32377 reply_id: 128866[/import]

Hey James,

Have you filed a bug report about this? If so could I please get the case #? If not please do, with a simple attachment the team can use to reproduce. The fact you know build number it first started appearing in should be a big help.

Thanks,
Peach :slight_smile: [import]uid: 52491 topic_id: 32377 reply_id: 128825[/import]

I’ve just reduced the code to the min required for push to work…and now i get a token even in the latest build for my test case…so something else has changed between build 927 and 928 that is causing my listener not to be called, but it now only seems indirectly related to push. I’ll see if i can’t figure out the correlating factor. [import]uid: 105599 topic_id: 32377 reply_id: 128864[/import]

So i moved the registration of the notification listener to earlier in my code, and it works now.

I guess somewhere between build 927 and 928, my notification listener started getting registered AFTER the token had been already been delivered by iOS, and so the event never fired because it had already happened.

Basically, i have a number-based-index table that i use to store anon functions, each of which is responsible for loading a resource…on boot i loop through this table and call each of the functions (after each call i update a loading-progress bar and show a “Play” button when all functions have been called)…the notification listener registration was in one of these funcs, loaded latently within the loop. Taking the registration of the listener-function out of this resource-loading loop and dropping it right into the start of my main.lua file seems to have solved the problem.

BUT i wonder if this could happen at some time in the future anyways? Is there some chance that iOS will still deliver the token “too early”? i.e. when does the event fire exactly and where is the line of “registered in time to get the token” and “registered too late! nothing works!”? :slight_smile: [import]uid: 105599 topic_id: 32377 reply_id: 128865[/import]

TL;DR

Not a corona bug. Register your notification listener as early as possible in your code, or you might miss the the push token being delivered and your event will never fire, thereby making you want to jump out a 2nd story window. [import]uid: 105599 topic_id: 32377 reply_id: 128866[/import]