Page 1 of 1

App crashes on receiving push notification

Posted: Fri Jul 18, 2014 6:04 am
by shoshinsha
Hi,
I am developing an app that receives push notifications but I'm having problem where the app will crash/exit automatically when:
- user taps on the push notification and launch the app
- notification arrives when app is still active

I've only used simple functions within the pushNotificationReceived:

on pushNotificationReceived tMessage
##update status on given field to "Notification Received"
......
##do some functions
......
end pushNotificationReceived

Really appreciate it if anyone can help me out. Thanks!!

p.s. I'm using LC version 6.6.2 to publish my app.

Re: App crashes on receiving push notification

Posted: Fri Jul 18, 2014 10:03 am
by LCNeil
Hi shoshinsha,

This sounds like a bug as the app should not crash after functions are executed when a push notification is received. Have you tried removing the functions to see if the crash still occurs?

You may wish to try waiting a short amount of period, after the push notification opens the app, to execute any handlers that call your functions as this may provide a solution. Something like a non-blocking "send in time"

e.g.

Code: Select all

   send "doFunctions" to me in 1 second
Kind Regards,


Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com

Re: App crashes on receiving push notification

Posted: Tue Jul 29, 2014 3:00 am
by shoshinsha
Hi Neil,

Thanks for your reply!

I've tried using the send in time function but it's still the same...
I've tried removing the functions within onPushNotificationReceived as well. The result is the same... :(