Hello,
I am upgrading my app to ios 8. I am want to take device token for push notification but I am not able to get device token. Below is my code which I am using for getting device token.
Config.lua
application =
{
content =
{
graphicsCompatibility = 1,
width = 375,
height = 667,
scale = “letterBox”,
xAlign = “center”,
yAlign = “center”,
device=“iphone6”,
imageSuffix =
{
["@2x-667h"] = 1.7786,
},
},
notification =
{
iphone =
{
types = { “badge”, “sound”, “alert” }
}
}
}
other.lua
local function notificationListener( event )
local alert = native.showAlert(“event.type”, event.type, {“OK”}, listener)
if ( event.type == “remote” or event.type == “local” ) then
--handle the push or local notification
elseif ( event.type == “remoteRegistration” ) then
--code to register your device with the service
local DeviceID = event.token
native.showAlert( “Alert”, “An internet connection is required to use this application.”…DeviceID, { “Exit” } )
end
end
Runtime:addEventListener( “notification”, notificationListener )
Thanks in advance