Event.PUSH_REGISTRATION_ERROR

Available since version: Gideros 2011.6

Description:

Event is received when application failed to register for push notifications, after calling registerForPushNotifications, which means you should retry later.
There might be different reasons, but most common is that server was unavailable or there was no Internet connection.

Value:

Event.PUSH_REGISTRATION_ERROR = "pushRegistrationError"

Examples:

Registering for push notifications

--retrieve shared instance
local mngr = NotificationManager.getSharedInstance()

--if registration completed succesfully
mngr:addEventListener(Event.PUSH_REGISTRATION, function(e)
	--getting device token
	local token = e.deviceToken
	
	--sending token to your server
	local loader = UrlLoader.new("http://yourdomain.com/register.php?token="..token)
	loader:addEventListener(Event.COMPLETE, function()
		--token succesfuly deliverd
	end)
end)

--if registration failed
mngr:addEventListener(Event.PUSH_REGISTRATION_ERROR, function(e)
	--device could not been registered now
	--try again later
	print(e.error)
end)


--try to register for push notifications
mngr:registerForPushNotifications("953841987672")