playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.47k stars 966 forks source link

Using GPS with Facebook and Admob and failed authentication #2530

Open Teddymac22 opened 5 years ago

Teddymac22 commented 5 years ago

I am attempting to update the Facebook SDK as they are requiring an update. I am using the Facebook Unity SDK version 7.15.1. I have Admob installed as well. I have tried using newer versions of GPS such as 9.60, but then the app will not even start.

My currently published version works fine with all three. And my older development version (the one with the outdated Facebook SDK) works fine as well. Just when I attempt to update all three plugins the GPS fails to login. The green GPS box appears as if it is attempting to login, but shortly after it closes and the callback says it failed to authenticate.

Perhaps there is some configuration of SDK versions that will work? I have another project going that does not use Admob and when I updated to GPS 0.9.60 and the new Facebook SDK it appears to be working. So the only difference it seems would be the Admob.

Any ideas on what SDK versions I could use?

So the versions and configurations are: Unity version 2018.3.8f1 Gradle Build GPS 0.9.53 (Fails to Authenticate) Facebook SDK 7.15.1 Admob 3.15.1

The older working version... Unity Internal Build 2018.2.14f1 GPS 0.9.42 Admob ??? Facebook 7.10

Working No Admob App Unity version 2018.3.8f1 Gradle Build GPS 0.9.60 Facebook SDK 7.15.1

Teddymac22 commented 5 years ago

Update... I have removed Admob from the one project. We'll call it App A. I then Updated GPS to 0.9.60. Now both apps have the same version of GPS, Facebook SDK, and no Admob.

Still App A will not let me log into GPS or Facebook when uploaded to Internal or Alpha testing. GPS does not even get a callback of failed. If I check Development Build Facebook works, but GPS gets a failed to log in. Apparently this is intended because of this post here.

On App B, GPS and Facebook works when I build the app to the device with Development Build unchecked. I am scared to see what happens if I check it as I don't want to break it.

So in summary...

Neither version uses Google's App Signing feature. App A -GPS nor Facebook work when uploaded as Internal or Alpha -There was an older Beta version and there is a live Production version.
Unity version 2018.3.8f1 Gradle Build GPS 0.9.60 Facebook SDK 7.15.1

App B -GPS and Facebook work when downloaded from Beta and when installed directly from Untiy to device. -It works with Unity with Development Build unchecked -This app has no Production version but has a Beta version. Unity version 2018.3.8f1 Gradle Build GPS 0.9.60 Facebook SDK 7.15.1

Teddymac22 commented 5 years ago

Update 2...

Thanks to the post here I figured out how to get GPS working with Development Build checked in the build settings. However, it is not working when I download the Internal or the Alpha builds.

Teddymac22 commented 5 years ago

I believe I have finally found the solution. While reading through another bug report I found this post... https://github.com/playgameservices/play-games-plugin-for-unity/issues/2534#issuecomment-488186463

Which provided this link... https://answers.unity.com/questions/1598905/google-play-game-services-not-working-in-unity.html

Turns out it was a Gradle release build issue and had nothing to do with Facebook (or it seems). The solution highlighted in green fixed the issue for me. Which means you open Publishing Settings, then check the User Proguard File. This will auto generate a text file. Open that file in an editor and add the two lines: -keep class com.google.games.* { ; } -keep interface com.google.games. { *; }

I had to also set Minify Release and Debug to none or it wouldn't build.