[Tutorial] - [Android] - Setting Up Google Play Services for Cocos2d-x

  • GAZ99 admin
    Likes 2

    Problem Description

    Video Link:

     

    Google Developer Console : https://play.google.com/apps/publish/

    Helper Files Link : https://github.com/cpinan/Cocos2dX_GooglePlayGamesServices – credit to Carlos Eduardo Piñan Indacochea

    Code To Add To AndroidManifest.xml

    <!-- Required for Google Play Services -->
            <meta-data
                android:name="com.google.android.gms.games.APP_ID"
                android:value="@string/google_play_game_app_id" />
            <meta-data
                android:name="com.google.android.gms.version"
                android:value="@integer/google_play_services_version" />
    
    <!-- End here requirement for Google Play Services -->
    
    <uses-permission android:name="android.permission.INTERNET"/>

    Strings to add to proj.android/res/values/strings.xml:

    <string name="google_play_game_app_id">YOUR APP ID HERE</string>
        
    <string name="gamehelper_alert">Not working yet, sorry.</string>
    <string name="gamehelper_sign_in_failed">Failed to sign in. Please check your network connection and try again.</string>
    <string name="gamehelper_app_misconfigured">The application is incorrectly configured. Check that the package name and signing certificate match the client ID created in Developer Console. Also, if the application is not yet published, check that the account you are trying to sign in with is listed as a tester account. See logs for more information.</string>
    <string name="gamehelper_license_failed">License check failed.</string>
    <string name="gamehelper_unknown_error">Unknown error.</string>
    <string name="fail_submit_score_leaderboard">Fail to submit {score} to leaderboard: {leaderboardID} or need sign in.</string>
    <string name="fail_unlock_achievement">Fail unlocking achievement: {achievementID} or need sign in.</string>
    <string name="fail_increment_achievement">Fail increment achievement: {achievementID} in steps: {numSteps} or need sign in.</string>
    <string name="fail_show_achievements">Fail showing achievements or need sign in.</string>
    <string name="fail_show_leaderboards">Fail showing leaderboards or need sign in.</string>
    <string name="fail_show_leaderboard">Fail showing leaderboard: {leaderboardID} or need sign in.</string>

    Gaz


Login to reply