# Important: Google Play Games/Online Subsystem login flow breaking changes in 4.9

**URL:** <https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860>\
**Category:** Mobile\
**Tags:** unreal-engine, Android\
**Created:** [July 28, 2015, 6:49pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860 "2015-07-28T18:49:40Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Gerleve](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan\_Gerleve](https://forums.unrealengine.com/u/Ryan_Gerleve)\
**Post date:** [July 28, 2015, 6:49pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/1 "2015-07-28T18:49:40Z")

</div>

Hey everyone,

Since the full release notes aren’t available as of this post, and [4.9 Preview 1 is available now](https://forums.unrealengine.com/showthread.php?78220-Unreal-Engine-4-9-Preview), I wanted to let everyone know about a breaking change in 4.9 regarding login to Google Play Games services. For those of you following the GitHub master branch, [the change is in this commit](https://github.com/EpicGames/UnrealEngine/commit/4a6eccd449649a9b507605edacea32ef215da77f).

Most of these changes also apply to Game Center on iOS, so for any iOS specific issues, please [refer to this thread](https://forums.unrealengine.com/showthread.php?78249-Important-Game-Center-Online-Subsystem-login-flow-breaking-changes-in-4-9).

Up through 4.8, the Google Play online subsystem (if enabled) would automatically start the login process, and potentially show the Google login UI, during engine startup - the game had no way of controlling when the UI came up, and in addition, it was causing timing issues that we had to work around in the engine.

To address these problems, in 4.9 the Google Play sign-in process and login UI is no longer triggered automatically at startup. We have implemented the IOnlineExternalUI::ShowLoginUI function for Google Play and added a new Blueprint node, “Show External Login UI”, which wraps this function. The existing “Connect to Service” node has been deprecated and we encourage everyone to switch to using “Show External Login UI” in their Blueprints. This returns control of the login process and UI to the game, so you’re free to activate it at a time that’s appropriate for you. Many games will be able to call it during a BeginPlay event - this will be after the engine has been initialized and any startup movie has finished playing.

![LoginUI_BP.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/1/4/d144621878b37747deaba7a165ba5bce56a6ff56.png)

In addition, we have implemented IOnlineIdentity::Logout for Google Play, and exposed “Logout” and “Is Logged In” Blueprint nodes. Using these, it should now be possible to implement a sign-in/sign-out button, as recommended by [Google’s quality checklist](https://developers.google.com/games/services/checklist).

![Logout_BP.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/6/c/86cc19a3ec43579792ed533cff5fa9591305e22c.png)

![IsLoggedIn_BP.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/c/0/bc0dfb36dd3d18a96067d1fbf0f04ec097628535.png)

Feel free to post any feedback about these changes here - though for specific bug reports, please post them on [AnswerHub](https://answers.unrealengine.com/)!

---

<div class="post-metadata">

**Author:** ![MaxL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MaxL](https://forums.unrealengine.com/u/MaxL)\
**Post date:** [July 28, 2015, 7:06pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/2 "2015-07-28T19:06:33Z")

</div>

Just last week a poster wished you could sign in whenever rather then at the start and it’s already implemented.  
Good job!

---

<div class="post-metadata">

**Author:** ![KillerSneak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killersneak/32/754802_2.png) [@KillerSneak](https://forums.unrealengine.com/u/KillerSneak)\
**Post date:** [July 31, 2015, 7:32pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/3 "2015-07-31T19:32:31Z")

</div>

Great ill try this out right now. Every build fails for me after 4.4 with google play services enabled (already have a topic running here: [Can't "Alpha" test from google play - Rendering - Unreal Engine Forums](https://answers.unrealengine.com/questions/253779/cant-alpha-test-from-google-play.html))

how does this interact with the JNI local reference table? As that is the problem I’m having I’m wondering if this will interact with the JNI differently as it doesn’t get loaded at engine start now and we can finally have people choose to log in or out with for example a button.

---

<div class="post-metadata">

**Author:** ![KillerSneak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killersneak/32/754802_2.png) [@KillerSneak](https://forums.unrealengine.com/u/KillerSneak)\
**Post date:** [August 2, 2015, 2:27pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/4 "2015-08-02T14:27:57Z")

</div>

So the button and workflow actually works, to bad logging into google play services still make a game crash.

[Can't "Alpha" test from google play - Rendering - Unreal Engine Forums](https://answers.unrealengine.com/questions/253779/cant-alpha-test-from-google-play.html) ← makes building games for Android quite useless at the moment.

---

<div class="post-metadata">

**Author:** ![Ryan\_Gerleve](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan\_Gerleve](https://forums.unrealengine.com/u/Ryan_Gerleve)\
**Post date:** [August 3, 2015, 10:50pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/5 "2015-08-03T22:50:11Z")

</div>

> [@KillerSneak;345664](#):
>
> how does this interact with the JNI local reference table? As that is the problem I’m having I’m wondering if this will interact with the JNI differently as it doesn’t get loaded at engine start now and we can finally have people choose to log in or out with for example a button.

I doubt this is related. We are currently using Google’s C++ SDK for Play Games services, so we don’t have access to the JNI that interacts with Google Play, it’s all compiled into Google’s library. The new login flow does mean that instead of initializing the Google Play library at engine startup, it will be initialized the first time a login call is made - so any JNI calls that the Google C++ library makes during the login process will occur a bit later. That’s the only difference that comes to mind.

---

<div class="post-metadata">

**Author:** ![KillerSneak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killersneak/32/754802_2.png) [@KillerSneak](https://forums.unrealengine.com/u/KillerSneak)\
**Post date:** [August 4, 2015, 12:42pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/6 "2015-08-04T12:42:43Z")

</div>

> [@Ryan Gerleve;347884](#):
>
> I doubt this is related. We are currently using Google’s C++ SDK for Play Games services, so we don’t have access to the JNI that interacts with Google Play, it’s all compiled into Google’s library. The new login flow does mean that instead of initializing the Google Play library at engine startup, it will be initialized the first time a login call is made - so any JNI calls that the Google C++ library makes during the login process will occur a bit later. That’s the only difference that comes to mind.

Well indeed you changed the library and the way UE4 interacts with it between 4.3 and 4.8 and I think UE4 is handling it wrong. A JNI overflow (512 characters max etc) only happens when local references do not get deleted/unloaded/destroyed (how ever you want to call it) it’s being looked at by one of epic’s staff at the moment and I hope it will be fixed @ 4.10

When using the cache achievements node it also makes a call to get all achievements. I’m using the same as Tappy Chicken to handle the achievements and leaderboards yet on login the game always crashes with the JNI error overflow. I think it’s because of Incremental Achievements not being handled as it should some how (local references don’t get deleted)

Anyway I’m going off-topic here sorry. The new login system itself as described in this topic works as intended.

---

<div class="post-metadata">

**Author:** ![Pesk92](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pesk92](https://forums.unrealengine.com/u/Pesk92)\
**Post date:** [August 13, 2015, 11:39am UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/8 "2015-08-13T11:39:14Z")

</div>

Hi. This new login flow is great for most purposes. I have a question about the “show external login UI” node in blueprints:

When is the “On success” event or “On failure” event executed?  
Is it when the login screen shows up, or when the user presses login or cancel?

When my game starts it will show the external login UI and then, if successful, it will try to read from the leaderboard. So I want it to wait until the user has pressed login before it fires the event “On Success” or “On Failure”.

Thanks

---

<div class="post-metadata">

**Author:** ![Pesk92](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pesk92](https://forums.unrealengine.com/u/Pesk92)\
**Post date:** [August 13, 2015, 11:51am UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/9 "2015-08-13T11:51:42Z")

</div>

And in fact the read leaderboard integer node doesn’t seem to be working at all in 4.9

---

<div class="post-metadata">

**Author:** ![Ryan\_Gerleve](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan\_Gerleve](https://forums.unrealengine.com/u/Ryan_Gerleve)\
**Post date:** [August 13, 2015, 2:36pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/10 "2015-08-13T14:36:01Z")

</div>

> [@Pesk92;354636](#):
>
> When is the “On success” event or “On failure” event executed?  
> Is it when the login screen shows up, or when the user presses login or cancel?

The success or failure pin will execute after the user has interacted with the system UI - “on success” after the user presses login and “on failure” if the login failed or after the user pressed cancel. “On success” might also fire without the system UI appearing, if Google Play could log the user in automatically.

> [@Pesk92;354640](#):
>
> And in fact the read leaderboard integer node doesn’t seem to be working at all in 4.9

I’m not aware of any changes to leaderboard handing between 4.8 and 4.9, although as before it will require a successful login to work properly. If you’re sure you’re reading the leaderboard after a successful login, and it appears to be a bug, feel free to post a bug report on Answerhub.

---

<div class="post-metadata">

**Author:** ![Pesk92](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pesk92](https://forums.unrealengine.com/u/Pesk92)\
**Post date:** [August 13, 2015, 6:33pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/11 "2015-08-13T18:33:57Z")

</div>

> [@Ryan Gerleve;354754](#):
>
> The success or failure pin will execute after the user has interacted with the system UI - “on success” after the user presses login and “on failure” if the login failed or after the user pressed cancel. “On success” might also fire without the system UI appearing, if Google Play could log the user in automatically.
> 
> I’m not aware of any changes to leaderboard handing between 4.8 and 4.9, although as before it will require a successful login to work properly. If you’re sure you’re reading the leaderboard after a successful login, and it appears to be a bug, feel free to post a bug report on Answerhub.

Thanks for the reply. That is perfect. However, after successful login the read leaderboard integer will always fail and fire its On Failure event instead of the On Success event. Write to leaderboard and showing the leaderboard works perfectly, so I think it might be a bug. Hence I have posted it on answerhub as you suggested and hope they will figure it out.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2a687cc6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2a687cc6](https://forums.unrealengine.com/u/anonymous_user_2a687cc6)\
**Post date:** [September 20, 2015, 2:23pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/12 "2015-09-20T14:23:44Z")

</div>

> [@Ryan Gerleve;354754](#):
>
> I’m not aware of any changes to leaderboard handing between 4.8 and 4.9, although as before it will require a successful login to work properly. If you’re sure you’re reading the leaderboard after a successful login, and it appears to be a bug, feel free to post a bug report on Answerhub.

I am using “Show External Login UI” node on Begin Play of my Level BP. When I launch it on my Android device, it executes the print node present in “On Failure” execution pin always.

---

<div class="post-metadata">

**Author:** ![Ryan\_Gerleve](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan\_Gerleve](https://forums.unrealengine.com/u/Ryan_Gerleve)\
**Post date:** [September 21, 2015, 2:35pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/13 "2015-09-21T14:35:19Z")

</div>

> [@ambhar;383125](#):
>
> I am using “Show External Login UI” node on Begin Play of my Level BP. When I launch it on my Android device, it executes the print node present in “On Failure” execution pin always.

Hi ambhar,

Is your project set up correctly to use Google Play Games? Basic instructions can be found in [this thread](https://forums.unrealengine.com/showthread.php?21803-Google-Play-Setup). If so, please check the logcat output, it may have more information to help figure out what’s going on.

---

<div class="post-metadata">

**Author:** ![dejan.dp.popovic](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dejan.dp.popovic](https://forums.unrealengine.com/u/dejan.dp.popovic)\
**Post date:** [June 18, 2024, 3:19pm UTC](https://forums.unrealengine.com/t/important-google-play-games-online-subsystem-login-flow-breaking-changes-in-4-9/36860/14 "2024-06-18T15:19:09Z")

</div>

I have correctly setup my google play services, logging in and leaderboard functionality within my game with shipping builds deployed to internal testers in the game store, but I cannot log OUT on a log out button click. I use the Logout blueprint node but it doesnt work under ANY/ALL circumstances. In other words, I cannot get the On Success path to fire on Log OUT. Can ANYONE please tell me how to simply log out of google play?
