variable watch in Corona

Hi,

How I should do variable watch in Corona. Currently working on push notification. When successfully registered, then I need to update text to “Registered”. Let say I do it like this

local gcmStatus = nil local function onNotification(event) if event.type == "remoteRegistration" then gcmStatus = "Registered" end end

When running code like above, when GCM is registering, variable gcmStatus not updating to “Registered”.

Did you add the listener?

If not, add this line after your function:

Runtime:addEventListener( "notification", onNotification )

Did you add the listener?

If not, add this line after your function:

Runtime:addEventListener( "notification", onNotification )