Hi,
I have tried 5 times to get push certifications to work in itunes but building my test app for notifications just doesn’t work. Nothing happens with device on the phone. I have followed this tut on parse for getting the keys https://parse.com/tutorials/ios-push-notifications and my app really stripped down just to test if something happens. Before this code i used this code from corona labs docs http://docs.coronalabs.com/guide/events/appNotification/index.html but the only thing I got there was that local event.type was nil. Ive tried so many different options but don’t know what else to do I have tried this code to https://github.com/jlooper/DessertOMeter-GFX2 and a new user is being created on parse but its the same there, the push notifications event is nil.
local function onNotification( event )
print(“my device id is”,event.token)
if event.type == “remoteRegistration” then
if event.token ~= nil then
--save the deviceToken as a global so we can grab it later
deviceToken = event.token
else
print(“no token returned, too bad”)
end
elseif event.type == “remote” then
native.showAlert( “Hello there”, event.alert , { “OK” } )
end
end
local notificationListener = function( event )
native.setProperty( “applicationIconBadgeNumber”, 0 )
end
– The notification Runtime listener should be handled from within “main.lua”
Runtime:addEventListener( “notification”, onNotification )
config.lua
application =
{
content =
{
width = 360,
height = 480,
scale = “letterBox”,
xAlign = “center”,
yAlign = “center”,
imageSuffix =
{
["@2x"] = 1.5,
["@4x"] = 3.0,
},
},
notification =
{
iphone = {
types = {
“badge”, “sound”, “alert”
}
}
}
}