Cancel Local Notification by passing notification id(of type UserData)

Hi,
In my app i am allowing user to schedule local notification. The user also has the ability to modify the notification at a later stage. When the user modifies the notification, i need to:

1. Cancel old notification
2. Schedule the new notification.

I am struggling to implement cancel notification feature. As per API, i can use

 system.cancelNotification(notificationID)

I just learned that notificationID is of the type: userdata, which is kind of a pointer to C/C++ object

At the first place, when the user schedules a new notification, i do get a handle to userdata notification id using the following code

 local notificationId = system.scheduleNotification()

My struggle is how to persist this userData object. Because, the user could come back after 2 days to modify a scheduled notification. I need to persist the old notification id(userdata objects) to cancel them using system.cancelNotification

Has anyone encountered this or has any suggestion how to handle this.

The only other option is to cancel all notification and then reschedule them again..But then what is the use of the parameter notification in the cancelNotification function.

Any help is appreciated.

thx,
Bejoy

views:1658 update:2012/1/3 13:02:13
corona forums © 2003-2011