Local Notification Configuration

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dcpbarrington
Posts: 87
Joined: Tue Nov 13, 2007 6:40 pm

Local Notification Configuration

Post 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
newtronsols
Posts: 192
Joined: Tue Mar 11, 2014 12:57 pm

Re: Local Notification Configuration

Post 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?
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Local Notification Configuration

Post by Simon »

Hi dcpbarrington,
It's a current bug
http://quality.runrev.com/show_bug.cgi?id=13927

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
gliacca
Posts: 17
Joined: Tue Oct 14, 2014 9:09 am

Re: Local Notification Configuration

Post 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
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Local Notification Configuration

Post by Simon »

Hi Gianluca,
Yes, it's fixed in liveCode 6.7.1 RC 3.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
gliacca
Posts: 17
Joined: Tue Oct 14, 2014 9:09 am

Re: Local Notification Configuration

Post 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
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Local Notification Configuration

Post 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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
gliacca
Posts: 17
Joined: Tue Oct 14, 2014 9:09 am

Re: Local Notification Configuration

Post 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
Post Reply