I tread the corona blog page about Gamethrive and decided to sign up. I went through the certificates, push notification registration, delete past cert etc but can’t get the app to popup asking if notifications are allowed or sent notifications from game thrive.com
I am using Corona SDK 2014.2322 and an iPhone 5 with 7.1.1
main.lua
-- This function gets called when the player opens a notification or one is received when the app is open and active. function DidReceiveRemoteNotification(message, additionalData, isFirstOpen) if (additionalData and additionalData.discount) then native.showAlert( "Discount!", message, { "OK" } ) -- Take player to your game store elseif(additionalData and additionalData.bonusCredits) then if (isFirstOpen) then -- Add credits here end native.showAlert( "Bonus Credits!", message, { "OK" } ) -- Take player your game store or inventory end end local launchArgs = ... local GameThrive = require ( "plugin.GameThrivePushNotifications" ) GameThrive.HandleLaunchArgs(launchArgs, "removed", DidReceiveRemoteNotification)
build.settings
settings = { orientation = { default = "portrait", supported = {"portrait"}, --supported = { "landscapeLeft", "landscapeRight", "portrait", "portraitUpsideDown" }, }, plugins = { -- key is the name passed to Lua's 'require()' ["plugin.GameThrivePushNotifications"] = { -- required publisherId = "com.gamethrive", }, }, etc
Config.lua
--http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/ if string.sub(system.getInfo("model"),1,4) == "iPad" then application = { content = { width = 360, height = 480, scale = "letterBox", fps = 60, xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { -- Push Notifications -- google = { projectNumber = "############" }, iphone = { types = { "badge", "sound", "alert" } } } } elseif string.sub(system.getInfo("model"),1,2) == "iP" and display.pixelHeight \> 960 then application = { content = { width = 320, height = 568, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } elseif string.sub(system.getInfo("model"),1,2) == "iP" then application = { content = { width = 320, height = 480, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } elseif display.pixelHeight / display.pixelWidth \> 1.72 then application = { content = { width = 320, height = 570, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } else application = { content = { width = 320, height = 512, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } end
Ideas.