How to erase the data from launchArgs array after the remote notification is handled?

I write a code with using remote push Android feature.

When user receives the remote notification and taps on it, the program is launched, and I handle the event according to launchArgs array data (till now everything is fine).

But if user exists the application and opens it again, without receive any new notification, the launchArgs array still has its previous data.
I tried to set launchArgs = nil or launchArgs.notification = nil when I handle the notification event, but it doesn’t works.

So how can I “to say” to Corona that I already handled the launchArgs data and to set it to nil to to empty array for next launch of the application? [import]uid: 172733 topic_id: 34511 reply_id: 334511[/import]

You are not supposed to modify the launch arguments. It’s global data that tells you how your app was launched from a cold start.

A better way to handle a received push notification is something like this…
[lua]-- Handles received notifications.
local function onNotification(event)
– Do something with the received notification.
end

– Set up a notification event handler.
Runtime:addEventListener(“notification”, onNotification)

– If this app has been started up by the user tapping a notification,
– then route the notification event to the above notification handler.
local launchArgs = …
if launchArgs and launchArgs.notification then
onNotification(launchArgs.notification)
end[/lua]
[import]uid: 32256 topic_id: 34511 reply_id: 137403[/import]

You are not supposed to modify the launch arguments. It’s global data that tells you how your app was launched from a cold start.

A better way to handle a received push notification is something like this…
[lua]-- Handles received notifications.
local function onNotification(event)
– Do something with the received notification.
end

– Set up a notification event handler.
Runtime:addEventListener(“notification”, onNotification)

– If this app has been started up by the user tapping a notification,
– then route the notification event to the above notification handler.
local launchArgs = …
if launchArgs and launchArgs.notification then
onNotification(launchArgs.notification)
end[/lua]
[import]uid: 32256 topic_id: 34511 reply_id: 137403[/import]