Local Notification with UTC Time Android

Hello there,

I have developed an application that has the local notifications.

The calculation is performed with UTC time. On IOS no problem, all OK, but on Android the local notification does not work.

I have compiled for iOS and Android your example of Local Notification (Corona version 1120).

Also this example, the notification does not work with UTC time (START WITH UTC), on Android.

The notification by the time (START WITH TIME) works.
Any idea?

All the best

Pasquale

Can you provide an example of how you’re coding the notification?

Unfortunately, this is a known bug on Android.

The only work-around is to provide a duration in seconds instead of a UTC time table.  You can do so as follows…

local secondsFromNow = os.difftime( os.time(), os.time( myUtcTime ) )

Thanks for the tip, I’ll try.
 

Pasquale,

We sneaked in a quick fix for this issue. The fix will be made available in daily build #1126, tomorrow.

Hello Joshua Quick,

I downloaded the 1126 version but the bug is still present. the same formula does not work …

time = os.date( “!*t”, os.time() + notificationTime )

Note:

It also happens a strange thing with the new version (1126):

CodeHelper and Corona Complete crashes when launch the simulator.

Before going well

Outlaw works.

Thanks for yours fast support.

All the best

Pasquale

Pasquale,

I re-tested this today and confirmed that a UTC date only works on Android within a 12 hour period of a day.  It’s an AM/PM issue and being mishandled on the Java side.  *Slaps forehead*

We won’t be able to push out a fix for this until about 2 weeks from now since we’re readying the next release version of Corona.  It missed the deadline.  So, the only solution at the moment is to use the work-around I posted up above where you schedule a notification based on an duration instead of a UTC date/time value.  That’ll work on both iOS and Android.  Sorry about the inconvenience.

Joshua,

thanks for your support.

For the moment I solved and published the app in Google Play with your suggestions and some other tip and it works :slight_smile:

kind Regards

Pasquale

Oh good.  I’m glad my solution helped you finish your release.

Just so you know, I did get approval to get this fixed (for real this time… honest!) yesterday and the fix is available in today’s daily build.  Oh and that Corona Simulator crash has been resolved as well.  Thank you for your patience and for informing us of this notification issue.

Yes, confirm that the new version of Corona sdk works very well now also with the IDE “Corona Complete” and “Code Helper”.

In the next upgrade of the app will use UTC time again.
 

Very fast support!

Thank you

Pasquale

Can you provide an example of how you’re coding the notification?

Unfortunately, this is a known bug on Android.

The only work-around is to provide a duration in seconds instead of a UTC time table.  You can do so as follows…

local secondsFromNow = os.difftime( os.time(), os.time( myUtcTime ) )

Thanks for the tip, I’ll try.
 

Pasquale,

We sneaked in a quick fix for this issue. The fix will be made available in daily build #1126, tomorrow.

Hello Joshua Quick,

I downloaded the 1126 version but the bug is still present. the same formula does not work …

time = os.date( “!*t”, os.time() + notificationTime )

Note:

It also happens a strange thing with the new version (1126):

CodeHelper and Corona Complete crashes when launch the simulator.

Before going well

Outlaw works.

Thanks for yours fast support.

All the best

Pasquale

Pasquale,

I re-tested this today and confirmed that a UTC date only works on Android within a 12 hour period of a day.  It’s an AM/PM issue and being mishandled on the Java side.  *Slaps forehead*

We won’t be able to push out a fix for this until about 2 weeks from now since we’re readying the next release version of Corona.  It missed the deadline.  So, the only solution at the moment is to use the work-around I posted up above where you schedule a notification based on an duration instead of a UTC date/time value.  That’ll work on both iOS and Android.  Sorry about the inconvenience.

Joshua,

thanks for your support.

For the moment I solved and published the app in Google Play with your suggestions and some other tip and it works :slight_smile:

kind Regards

Pasquale

Oh good.  I’m glad my solution helped you finish your release.

Just so you know, I did get approval to get this fixed (for real this time… honest!) yesterday and the fix is available in today’s daily build.  Oh and that Corona Simulator crash has been resolved as well.  Thank you for your patience and for informing us of this notification issue.

Yes, confirm that the new version of Corona sdk works very well now also with the IDE “Corona Complete” and “Code Helper”.

In the next upgrade of the app will use UTC time again.
 

Very fast support!

Thank you

Pasquale