Page 1 of 1

Badge Notification

Posted: Mon Dec 16, 2013 4:41 pm
by marcelloe
I want to use the badge notification to put a number next to the icon if there is an image in one of the Graphics. Do I need to use the Push notification that is used in the lesson?

Thanks

Mark

Re: Badge Notification

Posted: Tue Dec 17, 2013 1:38 pm
by LCNeil
HI Mark,

All you would need to do is use the iphoneSetNotificationBadgeValue command to set this number when an image is imported.

You can test this by creating a button and then placing the following script-

on mouseUp
iphoneSetNotificationBadgeValue 10
end mouseUp

You should notice the number "10" next to your iOS app icon.

Kind Regards

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding


Re: Badge Notification

Posted: Tue Dec 17, 2013 8:29 pm
by marcelloe
This is what i am trying to do to set the badge notification. Am I on the right path?

Code: Select all

function iphoneSetNotificationBadgeValue ()
 repeat with x = 1 to 5
if image x is not empty then
 iphoneSetNotificationBadgeValue to x
end repeat
end if
end iphoneSetNotificationBadgeValue

Re: Badge Notification

Posted: Wed Dec 18, 2013 12:13 pm
by LCNeil
Hi Mark,

You were almost there :)

A few things i noted were-

- You were trying to call the iphoneSetNotificationBadgeValue as a function. For simplicity I have turned this into a handler.
- You are not setting iphoneSetNotificationBadgeValue in your script so you need to remove the "to"
- the end if was in the wrong place (swapped with end repeat)

Code: Select all

on iphoneSetBadge
   repeat with x = 1 to 5
      if image x is not empty then
         iphoneSetNotificationBadgeValue x
      end if
   end repeat
end iphoneSetBadge
Kind Regards

Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding