local pushwoosh = require( "pushwoosh" )
local function onNotification( event )
native.showAlert( "remote notification", json.encode( event.data ), { "OK" } )
local function onRegistrationSuccess( event )
print( "Registered on Pushwoosh" )
local function onRegistrationFail( event )
native.showAlert( "Notification Registration Failed", "An Error Contacting the Server has Occurred. Please try again later from the application settings.", { "OK" } )
Runtime:addEventListener( "pushwoosh-notification", onNotification )
Runtime:addEventListener( "pushwoosh-registration-success", onRegistrationSuccess )
Runtime:addEventListener( "pushwoosh-registration-fail", onRegistrationFail )
pushwoosh.registerForPushNotifications( "PUSHWOOSH_APPLICATION_ID", launchArgs ) -- specify your application Id