Can't Trigger Callback functions for Google Play SDK

I am trying to incorporate the google play games services library with the engine so I can implement functionality that I need which is not implemented as of yet by epic. I can use the library just functions and most functions work, but functions that have a callback and are running on the UI thread do not trigger the supplied callback.

For example, when I first started I tried using the Achievements()->ShowAllUI with a callback. The UI would appear fine the first time, but when I dismiss it with the back option the callback I gave does not trigger, and any further attempts to reopen the UI would hand out an ERROR_UI_BUSY status. I got around this by downgrading to 1.1 when I was using 1.3 and using the same exact deprecated function being used by epic (which has no callback and says returns immediately when user has dismissed UI). And it is working fine, my implementation works fully with achievements. However, now I have run into a problem with the Saved Game service. There is no similar function to the one which works so they for the most part have callbacks which are not being trigger.

I am assuming somewhere in the java code the callbacks aren’t being linked but I have no idea, any help or direction with this issue would be much appreciated.

Hi BaderThanBad,
I have worked on my own implementation of gplay SavedGames. I use 1.3 sdk (in my own experimentation i have found its more stable, with 1.1 I managed to lose/corrupt several savegames).

The issue with UIs happens also with Leaderboards.

I have this as a pending task but you can have a look at android_support.h

In my logcat I can see this:
E/GamesNativeSDK(19062): Trying to show UI while waiting for a result from an existing UI. Please ensure that OnActivityResult is forwarded to the Games C++ SDK from your Java activity. See android_support.h for more details.

I’m sorry I can not provide more details but its in my TODO list right now, my next steps will be to modify the GameActivity.java according to the explanation provided in android_support.h

I hope it helps.

Thanks, keep me updated. I was guessing it had something to do with OnActivityResult, but I couldn’t figure where or how I was gonna go about it. Also, im not using source and got this far, but I wouldn’t mind doing so.

Im getting it to save and load successfully from the drive, only UI’s with callbacks are my issue so far since they don’t trigger callbacks (the open function’s callback is working fine apparently).

Thanks for the help, I managed to get it working! I did not even need source, I just modified the GameActivity.java from the launcher android build directory and it compiles it when it is building for deployment. I used a method similar to the google play sdk examples (linking the functions from java to c++ and implementing them there). Looks like i’ll upgrade to 1.3 too (the only reason I downgraded was to use the deprecated function).

I’m glad it helped :slight_smile:

hey man, any luck with the Google Play Saved Games? I would greatly appreciate if you could share this code e.g. as a plugin.

I’ve successfully implemented the Google Play Saved Games, but alas I do not have access to the source code as of now. I haven’t touched unreal engine in a couple of updates, but I am sure that it would be not too hard to implement.
For this specific problem I think the issue was that the OnActivityResult needed to call the google sdk’s on activity result and that would let the google sdk know that the UI was closed.
If you run into any hurdles I am sure someone on the answerhub will help you out, push comes to shove give me a reply so I get an email notification :). Best of luck.