IMPORTANT UPDATE GameThrive SDK 1.4.0

We made some big changes in our GameThrive 1.4.0 update which requires you to make the following changes if your using Corona 2014.2393 or later.

1. Open main.lua and update GameThrive.HandleLaunchArgs(launchArgs, “APPID”, callback) to GameThrive.Init(“APPID”, “googleProjectNumber”, callback)

Example:

local launchArgs = ... GameThrive.HandleLaunchArgs(launchArgs, "5eb5a37e-b458-11e3-ac11-000c2940e62c", DidReceiveRemoteNotification)

Should now be:

GameThrive.Init("f51b0afc-483c-11e4-9c8a-fba5466a0e1d", "703422764264", DidReceiveRemoteNotification)

2. Open config.lua and remove the whole notification = {} selection.

3. If your game is for iOS under “plist = {” add this line.

UIBackgroundModes = {"remote-notification"},

.

New Features:

1. Delayed iOS notification prompt option.

You can now delay the iOS system prompt asking to accept notifications to a later time. Just call GameThrive.DisableAutoRegister() before GameThrive.Init(…) to delay the prompt. Then call GameThrive.RegisterForNotifications() anytime to show the prompt.

2. Interactive Notifications with Action Buttons.

On gamethrive.com when creating a new notifications under Options section there is a “Include Action Buttons” option. The buttons you add here will show up in the notification on iOS 8 and Android 4.1+ devices. When the user press one just look for the id in additionalData.actionSelected. You can use this example code in your DidReceiveRemoteNotification function to try it out.

if (additionalData and additionalData.actionSelected) then    native.showAlert("Button Pressed!", "ButtonID:" .. additionalData.actionSelected, { "OK"} ) end

3.  Xcode 5 and 6 compatible

The GameThrive plugin will work with both Xcode 5(iOS SDK 7.1) and Xcode 6(iOS SDK 8). This fixes the “registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later” error without having to work around it.

See our blog for even more details on this update https://gamethrive.com/blog/interactive-notifications-with-ios-8-and-android-4-1-and-more/

1.4.3 Change Log (2014-10-06)

* iOS 8 - Updated to our latest native iOS plugin which now correctly reports users as unsubscribed on gamethrive.com if they pressed ‘don’t allow’ to the notification prompt.

* iOS 8 - If the user changes notification setting for your app in the system settings then gamethrive.com will reflect the changes when the user goes back to your app.

1.4.4 Change Log (2014-10-14)

* IconNotificationDefault-*.png now works again for Android remote notifications.

* Fixed iOS issue where IdsAvaialble’s callback would not fire a 2nd time in cases where it should of.

I built and submitted my app to Apple 24 hours ago using a build after 2393. Any problem with already built apps?

Is it now possible to delay the notification question dialog or is that coming a bit later?

Nope, no problem with the previous version. We updated GameThrive for Corona to use our native code which requires changes to your projects.

Just updated the post to include the 2 bigger changes in the update, which does include the delaying of the notification question dialog.

Very nice!

If user declines registration first time around can I later call GameThrive.RegisterForNotifications()  if I manage to convert them to use notifications?

Once they say no you can’t prompt you can’t prompt again unfortunately due to how iOS handles it. Calling GameThrive.RegisterForNotifications() will just do nothing. I have tested this on iOS 6, 7, and 8. If need to reset the prompt for testing on your own device you can follow these instructions however:

  1. Uninstall your app and reboot.

  2. Set the system clock 1 day ahead and reboot again.

  3. Re-install your app and test again.

What a nightmare to test.

One problem. The delayed popup works which is great. But the IdsAvailableCallback callback did not fire when I replied to the popup.

[lua]GameThrive.IdsAvailableCallback(IdsAvailable)[/lua]

Edit: Tested on iOS7, iPhone 4, verified 2x

Did the IdsAvailableCallback fire once before pushes were accepted with the playerId? It is tried into when the playerId is available but we can look into firing it again when the push token becomes available in the next update of our plugin.

Thanks for the update @jkasten - I just did a build and panicked a little when my app didnt open haha

Just wondering though… is there anything I can subscribe to to get updates like this in the future?  or are you able to email your user base to let them know a change has happened? 

either way, awesome free service and the delay registration is a great idea and i will be using it!

Cheers

Dave

Looks like its fired in subsequent (fresh) launches, but its most important to get this during registration.

Personally I subscribe to this forum, but yeah an email would be nice. Not the fault of GameThrive but this automated updating plugin system Corona uses is terrifying.

Hey all. We just sent out an email with more details. We’ll send out an email any time there’s an important update like this one.

You can also follow us on Twitter https://twitter.com/gamethrive

Looks like you fixed this, verified working. Really fantastic. 

I found a new issue.

If you delay the notifications and leave the app (suspend it) the notification popup pops up regardless.   Now the app itself is suspended and therefore can not react to the IdsAvailableCallback (so I can not send playerID to my server) along with other disadvantages (like having a “No” options in a pre-popup warning and then the possibility of enabling notification at a later time).

We haven’t change anything around the IdsAvailableCallback yet. Did you test on the same device and iOS version?

If you are calling DisableAutoRegister() before Init() then the iOS system prompt asking for notification permissions could never show without the app being active. When are you calling RegisterForNotifications()?

I’m not calling it at all, that is the problem. But still the notification popup shows when you suspend the app. I’m going to make a minimized version and see it its the same.

Regarding IdsAvailableCallback, yes I was on a different device and version, I will double check it and report back.

I haven’t seen the system prompt asking for push permissions show when the app asking for it wasn’t in focus under any condition actually. Can you provide details on how you produced this?

With IdsAvailableCallback, did you just go from iOS 7.1 to iOS 8? Apple changed a lot of things between these 2 iOS versions with push notifications. We are working on trying to make the IdsAvailableCallback work consistent between these 2 versions so game devs don’t have to worry about coding for this iOS behavior change.

Working on how to reproduce the suspend notification popup now.

Yes I was going from 7.1 to iOS 8.0.2 in regards to IdsAvailableCallback.

Oh shiii, I was setting a local notification on suspend that triggers the popup. Totally forgot about that. Sorry about that.

Sorry for the frequent posting. My previous post was incorrect (although it probably does trigger the popup).  The real reason it was doing it in my case was native.setProperty(“applicationIconBadgeNumber”, 10)

That seemingly has nothing to do with notifications but still pops up the notification popup. Perhaps you can have it in “Gotchas” in your documentation.

Hmm, it seem that Corona is requesting permission for you when that is called.

Setting badge numbers in iOS does require notification permissions actually. The user can go into the system setting>Notifications then disable “Badge App Icon”. Good idea on the Gotchas since this came up. Didn’t realize Corona auto asks for push permission when setting applicationIconBadgeNumber.