[Solved] can we integrate google play services (game center ) in cocos2d-x ios and android game in xcode

@cpinan Thanks

Some questions

  1. Is it possible to login Google Play Services when only needed, say only when player submit score? Right now it will try to connect during start
  2. Is it possible to show Ad when only needed, say in-game only? Right now it will try to connect during start
  3. Is it possible to change the position of AdMob without changing the java files?
    Right now if I want to show the Ad at the bottom, I need to update the parameter in UtilActivity.java

params.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;

to

params.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;

Thank you.

@winipcfg
we can login when needed.You can put a login google button and it will only be logged in when you want and click the buttonā€¦
regarding the other two pointsā€¦I havenā€™t done yetā€¦to I dont know about them

If I follow the link (https://developers.google.com/games/services/training/signin) by setting layout xml file and update java files, the G+ icon was displayed but it still try to login at start. After that I got an error and application crash.

I am checking the following information (#4, #5) and will retry later
https://github.com/playgameservices/android-samples/blob/master/FAQ.txt

@winipcfg
i made a button login of google services in iosā€¦but i am not unable to do it in android. Have you got success in thatā€¦

HI. thanks for the code. How do I make it work with Android to get leaderboard and achievements. I see an iOS example, is there an android example also??!??!

Also, will this work with 2.2.3 also???

@cpinan can I use Cocos2dX_GooglePlayGamesServices with cocos2d-x 3.3 and how to integrate it into an existing project?

1 Like