Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: Not Selected
more ▼

asked Feb 09 '15 at 05:39 PM in C++ Programming

avatar image

664 21 18 177

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Feb 10 '15 at 08:57 AM

avatar image

266 17 19 42

avatar image BaderThanBad Feb 10 '15 at 09:17 AM

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).

avatar image BaderThanBad Feb 10 '15 at 12:34 PM

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).

avatar image Dredok Feb 10 '15 at 03:15 PM

I'm glad it helped :-)

avatar image Lordink Nov 27 '15 at 02:22 PM

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.

avatar image BaderThanBad Nov 30 '15 at 04:17 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question