- Home /
Google +1 Button on Unity Android
Is there a way to prompt a user to +1 our Unity Android application from within the game itself?
This appears to be possible through a native Android application through the PlusOneButton: http://developer.android.com/reference/com/google/android/gms/plus/PlusOneButton.html
I'm interested in it too. Have you found your answer yet?
has any one figured out this yet? It would be great help!
Answer by pafla · Sep 17, 2015 at 10:27 AM
You could create an Android Java plugin. That would of course require some knowledge of Android App development.
http://docs.unity3d.com/Manual/PluginsForAndroid.html https://blog.nraboy.com/2014/06/creating-an-android-java-plugin-for-unity3d/
Also, there is an Asset for this (and other Google related stuff):
https://www.assetstore.unity3d.com/en/#!/content/10825
Thnx for your time. As i have learned program$$anonymous$$g through Unity. Its pretty hard for me to grasp basic ideas of plugins and accessing Google APIs. I would need a step by step guide for dummies :P
I have integrated Google Play Services SD$$anonymous$$ though. Would it anyhow help with integrating g+1 Button? By what i have searched on internet. I think i have to access this for integration. But i have no idea where to start from :S
I have searched all over the internet for this. All they have provided is the code for Android SD$$anonymous$$.
If you just need this plus one button, I would strongly recommend to just buy the above mentioned Asset, it will save you a lot of time. If, however, you want to learn how this all works (might come in handy later), here are some hints on where you could start.
Unity Android Plugins are very much like normal Android Apps written in Java. So one good first step for you would be to first create an app with Java, probably featuring the +1 button. It should not be hard to find tutorials for this. https://developer.android.com/training/basics/firstapp/index.html http://stackoverflow.com/questions/8843550/adding-a-google-1-button-in-android-app
After that, you can look into the basics of how to add native Android code to Unity. There are also a lot of tutorials for that, Google will help you out there. http://www.lorenzonuvoletta.com/how-to-create-a-native-android-plugin-for-unity/
If you have managed both, it should only be a matter of putting things together.
Great! I'll try the above links. I'm at a learning stage so time is not an issue. Thanks!