Gamethrive not working (new user)

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.

When I view my  apps status on gamethrive.com it says 3 users (number goes up each time I recompile the app for the device.

But under segments I can’t see any users?

Jun  1 23:26:25 removed [2771] <Warning>: Runtime error

/Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:292: attempt to concatenate field ‘token’ (a nil value)

stack traceback:

/Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:292: in function </Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:270>

?: in function <?:218>

Hi FearTec. Sorry for the delay.

I think the issue may be that the provisioning profile you have in xcode doesn’t have the aps-environment setting in it.

In the apple developer center you may need to regenerate your provisioning profile here: https://developer.apple.com/account/ios/profile/profileList.action?type=limited

Select the provisioning profile for your app, then click edit, and then “Generate”.

Once you’re done, in xcode you need to refresh your provisioning profiles. Follow the directions under “Refresh Provisioning Profiles in Xcode” on this page: https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html#//apple_ref/doc/uid/TP40012582-CH30-SW26

Finally, restart Corona simulator and rebuild your app.

Good luck! And let us know if that resolves the issue.

I would say also for you to try it on another device (or reset the settings of your device). 

The runtime error is because your app didn’t receive the push token, so your app is not configured to receive push (so, you need to go back to the Apple Portal to configure it) or you denied the push when your app opened at the first time.

Thanks will try, I’m sure i had it setup right. Maybe time for a device rebuild.

I previously regenerated my certificates/provisioning profiles :frowning:

Is this ok

push.jpg

Yes. Now download it and install it in your Mac.

All sorted, it tuned out i has an old app certificate (with the same name) in corona and I was building my app for that.

This is awesome.

When I view my  apps status on gamethrive.com it says 3 users (number goes up each time I recompile the app for the device.

But under segments I can’t see any users?

Jun  1 23:26:25 removed [2771] <Warning>: Runtime error

/Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:292: attempt to concatenate field ‘token’ (a nil value)

stack traceback:

/Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:292: in function </Users/hiptic/Documents/GameThrive/SDK/Corona/SDK/shared/plugin_GameThrivePushNotifications.lua:270>

?: in function <?:218>

Hi FearTec. Sorry for the delay.

I think the issue may be that the provisioning profile you have in xcode doesn’t have the aps-environment setting in it.

In the apple developer center you may need to regenerate your provisioning profile here: https://developer.apple.com/account/ios/profile/profileList.action?type=limited

Select the provisioning profile for your app, then click edit, and then “Generate”.

Once you’re done, in xcode you need to refresh your provisioning profiles. Follow the directions under “Refresh Provisioning Profiles in Xcode” on this page: https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html#//apple_ref/doc/uid/TP40012582-CH30-SW26

Finally, restart Corona simulator and rebuild your app.

Good luck! And let us know if that resolves the issue.

I would say also for you to try it on another device (or reset the settings of your device). 

The runtime error is because your app didn’t receive the push token, so your app is not configured to receive push (so, you need to go back to the Apple Portal to configure it) or you denied the push when your app opened at the first time.

Thanks will try, I’m sure i had it setup right. Maybe time for a device rebuild.

I previously regenerated my certificates/provisioning profiles :frowning:

Is this ok

push.jpg

Yes. Now download it and install it in your Mac.

All sorted, it tuned out i has an old app certificate (with the same name) in corona and I was building my app for that.

This is awesome.