Hi Rob,
Here is my code, when testing on my iPhone 4S (v7.1) I don’t get the remoteRegistration event at all, not even an error. This same code works on my Android Galaxy Tab 10.1.
local function onNotification( event )
if event.type == “remote” then
print(“we received a push notification!”)
if event.alert == nil then
native.showAlert(“visitor id Mobile”, “event.alert was nil!!!”, {“OK”})
else
local notificationString = event.alert
local strLen = notificationString:len()
vMobileNumber = notificationString:match("%b()")
local numLen = vMobileNumber:len()
local alertString = notificationString:sub(1,(strLen - numLen))
vMobileNumber = vMobileNumber:sub(2,(numLen - 1))
system.vibrate()
native.showAlert(“visitor id Mobile”, alertString, {“OK”, “Call”, “SMS”}, onNotificationClick)
end – if
elseif ( event.type == “remoteRegistration” ) then
if event.token ~= nil then
DT.deviceToken = event.token
if string.sub( system.getInfo(“model”), 1, 2 ) == “iP” then
registerVIDDevice()
end – if
else
DT.deviceToken = nil
native.showAlert(“visitor id Mobile”, “No token returned from remote registration”, {“OK”})
end – if
end – if
end – function
Runtime:addEventListener( “notification”, onNotification )
EDIT: Sorry I forgot to mention that my Galaxy tab is running the app on an older version of Corona, not the 2189 build.
Regards,
Trent