Page 1 of 1

Local Notification Configuration

Posted: Mon Nov 17, 2014 7:04 pm
by dcpbarrington
Forum,

I'm porting my app from Android to iOS using LiveCode V6.6.5 and I'm running into an issue getting Local Notifications to work on iOS V8.1.

Based on the Dictionary, the two system should use exactly the same parameters to create a local Notification and it is working just fine on Android. Here is my code.

Code: Select all

function scheduleLocalEvent pType pTime pMessage pAlertDate pAlertTime
   
   -- Create Local Notification Payload which has multiple elements to be used by the localNotificationReceived handler
   put pType & "|" & pAlertDate & "|" & pAlertTime & "|" & pMessage after tEventPayload
   -- Create the Notification
   if environment() is mobile then
      mobileCreateLocalNotification pMessage, tEventTitle, tEventPayload, pTime, "True", 0
      put the Result into tNotificationID
      put "New Alert" && tEventTitle && pTime && tNotificationID & return after fld "debug" on card "Events"  -- DEBUG
     end if
   if tNotificationID is not an Integer then
      logSaverError "Invalid Notification ID=" & tNotificationID & "for Event:" & tEventTitle
   end if
   return tNotificationID   
end scheduleLocalEvent
In the debug statement, the mobileCreateLocalNotification returns an ID = 1 for all the calls, which cannot be correct.

Is there something special that I need to set up in iOS to allow the application to use Local Notifications?

I DO NOT have Push Notifications enabled in the app. Is that a problem?

Thanks for the help
DCP

Re: Local Notification Configuration

Posted: Tue Nov 18, 2014 12:42 am
by newtronsols
Just a guess as I only have it working on Android and no iOS experience, but is the future notification time being calculated the same on iOS as Android i.e. is your conversion of future date/time to seconds giving the same answer on both platforms in LC?

Re: Local Notification Configuration

Posted: Tue Nov 18, 2014 12:49 am
by Simon
Hi dcpbarrington,
It's a current bug
http://quality.runrev.com/show_bug.cgi?id=13927

Simon

Re: Local Notification Configuration

Posted: Fri Jan 09, 2015 2:28 pm
by gliacca
Hi Simon,
I am not able to access the quality system in the link below.
The bug is still open?
May I have more information?

Thanks,
Gianluca

Re: Local Notification Configuration

Posted: Fri Jan 09, 2015 8:22 pm
by Simon
Hi Gianluca,
Yes, it's fixed in liveCode 6.7.1 RC 3.

Simon

Re: Local Notification Configuration

Posted: Sat Jan 10, 2015 1:35 am
by gliacca
Sorry but I have to tell you that I am running LC 7.0 on Mac virtual machine and I still have the same bug on iOS 8.1.
Have you any idea about this?
Thanks a lot,
Gianluca

Re: Local Notification Configuration

Posted: Sat Jan 10, 2015 1:45 am
by Simon
Hi Gianluca,
Sorry but the version numbers are not sequentially up-to-date.
That is, 6.7.1 RC3 can have updates that 7.0 does not (confusing right?). See, there are these 2 strands going, 6.7 and 7.0 and they both are getting updates. 7.0 probably went "Stable" before 6.7.1 RC3.
7.0.1 may have the update in it
http://downloads.livecode.com/livecode/

But I'm running the notifications in 6.7.1 Stable.

Simon

Re: Local Notification Configuration

Posted: Sat Jan 10, 2015 8:21 am
by gliacca
Hi Simon,
I just installed the 7.0.1 version on Mac and the notifications are now enabled on iOS 8 virtual device.
Thanks a lot for your help.
Ciao,
Gianluca