IMPORTANT UPDATE GameThrive SDK 1.4.0

Glad to hear your up and running. Also nice to hear that you like the new action buttons feature too.

Let us know if you have any more questions or suggestions for GameThrive.

Hi Josh,

Ok, so I created a brand new app in the portal.  I reset my push stuff on my phone to get a clean start and then did the following:

  1. Freshly installed my app

  2. Loaded my app but didnt go to the screen where is asks for the permission,

  3.  at this point i look at gamethrive portal and i can see a new user has been created (but no subscribed)

  4. Check my logs and can see the playerid call back has been called - all ok - as you said, player id but no push token yet

  5. I now go to my screen where i’ll be prompted for push notifications - I choose yes

  6. I now expect a second call to the playerid call back but it never happened.  I got the registered with apple and gamethrive log messages but thats it.

Can you confirm it should be working as I expect?

I have this in my main.lua

function IdsAvailable(playerID, pushToken) print("GameThrive: PLAYER\_ID:" .. playerID) settings.gtPlayerId = playerID if pushToken then -- nil if user did not accept push notifications on iOS print("PUSH\_TOKEN:" .. pushToken) settings.pushToken = pushToken end settings:save() end GameThrive.DisableAutoRegister() GameThrive.Init(glo.push.gameThriveKey, glo.push.googleProjId, DidReceiveRemoteNotification)     GameThrive.IdsAvailableCallback(IdsAvailable) -- this gets the ID but no push token

and then in another scene - scene1.lua i have this:

 local function regNotification( event ) if "clicked" == event.action then settings.push = true settings:save() GameThrive.RegisterForNotifications() end end if settings.push ~= true then native.showAlert( "Alerts", "For the best game experience, we can send you a notification when it's your turn.\n\n If this is ok, please touch allow on the next alert.", { "OK" }, regNotification ) end

Do you think it is because the id callback is in main? its a global function so it should work i tink

Thanks

Dave

(I also sent myself a test push from the portal and I recieved it ok)

Dave,

I just looked over our code that binds the lua callback to our Objective-c library and just saw it unbinds it after the first call. Sorry about this issue, we are planning on making a small update on Tuesday and can get a fix for this in there too.

Thanks.

Hey Dave,

Just pushed GameThrive SDK v1.4.4 with the IdsAvailable fix and should be available in the next 2 or 3 hours. You can check for the version number in the terminal before you build or in Xcode after it is running on the device.

Thanks.

thanks for that josh :slight_smile:

appreciate the quick turn around! 

I’ll check it out tonight when I get home

Cheers

Dave

Hi Josh,

I have finally had my app approved in the app store but im having issues with the IdsAvailable callback for some installs. this is what should be happening:

  1. user installs my app

  2. opens app and at which point the following is executed:

    GameThrive.DisableAutoRegister() GameThrive.Init(push.gameThriveKey, push.googleProjId, DidReceiveRemoteNotification)

  3.  at this point a user record is created in the gamethrive  portal (but not subscribed)

  4.  after 30 seconds?  due to disable auto register, my Availableid call back is triggered and I set the player ID.  no push token yet.

  5.  User registers (and I create an entry in my databse with gamethrive player Id) and main screen loads - now I call

    GameThrive.RegisterForNotifications() 

  6. Assuming new user allows push, I get a second call to the playerid with a push token.  At which point I update my database like so:

    function IdsAvailable(playerID, pushToken) print(“GameThrive: PLAYER_ID:” … playerID) settings.gtPlayerId = playerID if pushToken then print(“PUSH_TOKEN:” … pushToken) settings.pushToken = pushToken end settings:save() – if user has been created then update if settings.userID ~= nil then print(“update parse with push info”) mod_user.updateUser() end end

The problem is, in some instances - the IdsAvailable just doesnt get called (I know we’ve had problems with this in the past).  At the very least I should be getting the player id from the initial ‘init’ in step 2 even if later on they dont allow push (if that happened i should see your player id in my db and nil for push token).

Are you aware of any issues at your end?  At the moment more than 50% of my players will not be getting push notifications.  I can see that the init is half happening as there seems to be new users in your portal but they are not subscribed.

Really hope this is any easy one to fix.  Let me know if you need more info,

I’ve tried to replicate this but of course it always works for me!

Cheers

Dave

it doesn’t seem to be specific to any device /  os version…  I have not seen this happen on any android devices but Im barely getting downloads in the play store at the moment…

The app was just approved to the apple app store yesterday so it’s mainly iOS at the moment (but could be android too)

Thanks

nevermind guys, I thinks it something I have done - sorry for wasting your time  :unsure:  i can replicate it now

Hey David,

Glad you figured it out. Could you let us know what fixed your issue was once you know for sure what it was? It would help us help others quicker and help anyone who might search and find this topic.

Thanks.