نقل البيانات إلى الإصدار 2 من "خدمات ألعاب Play" (باستخدام Java أو Kotlin)

يوضّح هذا المستند كيفية نقل الألعاب الحالية من الإصدار 1 من حزمة تطوير البرامج (SDK) للألعاب إلى الإصدار 2 من حزمة تطوير البرامج (SDK) للألعاب.

قبل البدء

يمكنك استخدام أي بيئة تطوير متكاملة (IDE) مفضّلة، مثل "استوديو Android"، لنقل لعبتك. أكمِل الخطوات التالية قبل نقل البيانات إلى "ألعاب الإصدار 2":

تعديل الطلبات المرتبطة

  1. في ملف build.gradle الخاص بالوحدة، ابحث عن هذا السطر في التبعيات على مستوى الوحدة.

    implementation "com.google.android.gms:play-services-games-v1:+"

    استبدِلها بالرمز التالي:

    implementation "com.google.android.gms:play-services-games-v2:version"

    استبدِل version بـ أحدث إصدار من حزمة تطوير البرامج (SDK) للألعاب.

  2. بعد تعديل التبعيات، تأكَّد من إكمال جميع الخطوات الواردة في هذا المستند.

تحديد رقم تعريف المشروع

لإضافة رقم تعريف مشروع حزمة تطوير البرامج (SDK) الخاصة "بخدمات ألعاب Play" إلى تطبيقك، أكمِل الخطوات التالية:

  1. في ملف AndroidManifest.xml، أضِف عنصر <meta-data> والسمات التالية إلى عنصر <application>:

    <manifest>
      <application>
        <meta-data android:name="com.google.android.gms.games.APP_ID"
                   android:value="@string/game_services_project_id"/>
      </application>
    </manifest>
    

    حدِّد مرجع مصدر السلسلة @string/game_services_project_id باستخدام معرّف مشروع "خدمات الألعاب" في ألعابك كقيمة. يمكنك العثور على معرّف مشروع &quot;خدمات الألعاب&quot; ضمن اسم لعبتك في صفحة الإعدادات على Google Play Console.

  2. في ملف res/values/strings.xml، أضِف مرجعًا لمورد سلسلة واضبط رقم تعريف مشروعك كقيمة. مثلاً:

    <!-- res/values/strings.xml -->
    <resources>
      <!-- Replace 0000000000 with your game’s project id. Example value shown above.  -->
      <string translatable="false"  name="game_services_project_id"> 0000000000 </string>
    </resources>
    

نقل البيانات من خدمة "تسجيل الدخول باستخدام حساب Google" القديمة

استبدِل الفئة GoogleSignInClient بالفئة GamesSignInClient.

Java

ابحث عن الملفات التي تحمل الفئة GoogleSignInClient.

import com.google.android.gms.auth.api.signin.GoogleSignIn;
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;

// ... existing code

@Override
public void onCreate(@Nullable Bundle bundle) {
    super.onCreate(bundle);

    // ... existing code

    GoogleSignInOptions signInOption =
        new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN).build();
    
    // Client used to sign in to Google services
    GoogleSignInClient googleSignInClient =
        GoogleSignIn.getClient(this, signInOptions);
}

وعدِّلها إلى ما يلي:

import com.google.android.gms.games.PlayGamesSdk;
import com.google.android.gms.games.PlayGames;
import com.google.android.gms.games.GamesSignInClient;

// ... existing code

@Override
public void onCreate(){
    super.onCreate();
    PlayGamesSdk.initialize(this);
    // Client used to sign in to Google services
    GamesSignInClient gamesSignInClient =
        PlayGames.getGamesSignInClient(getActivity());
}

Kotlin

ابحث عن الملفات التي تحمل الفئة GoogleSignInClient.

import com.google.android.gms.auth.api.signin.GoogleSignIn
import com.google.android.gms.auth.api.signin.GoogleSignInClient
import com.google.android.gms.auth.api.signin.GoogleSignInOptions

// ... existing code

val signInOptions = GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN

// ... existing code

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    val googleSignInClient: GoogleSignInClient =
        GoogleSignIn.getClient(this, signInOptions)
}

وعدِّلها إلى ما يلي:

import com.google.android.gms.games.PlayGames
import com.google.android.gms.games.PlayGamesSdk
import com.google.android.gms.games.GamesSignInClient

// ... existing code

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    PlayGamesSdk.initialize(this)
    // client used to sign in to Google services
    val gamesSignInClient: GamesSignInClient =
        PlayGames.getGamesSignInClient(this)
}

تعديل رمز GoogleSignIn

لا تتوافق واجهة برمجة التطبيقات GoogleSignIn مع الإصدار 2 من حزمة تطوير البرامج للألعاب. استبدِل رمز واجهة برمجة التطبيقات GoogleSignIn بواجهة برمجة التطبيقات GamesSignInClient كما هو موضّح في المثال التالي.

لطلب رمز دخول من جهة الخادم، استخدِم طريقة GamesSignInClient.requestServerSideAccess(). لمزيد من المعلومات، يُرجى الاطّلاع على تعديل فئات الوصول من جهة الخادم.

Java

ابحث عن الملفات التي تحمل الفئة GoogleSignIn.

// Request code used when invoking an external activity.
private static final int RC_SIGN_IN = 9001;

private boolean isSignedIn() {
    GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);
    GoogleSignInOptions signInOptions =
    GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN;
    return GoogleSignIn.hasPermissions(account, signInOptions.getScopeArray());
}

private void signInSilently() {
    GoogleSignInOptions signInOptions =
        GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN;
    GoogleSignInClient signInClient = GoogleSignIn.getClient(this, signInOptions);
    signInClient
        .silentSignIn()
        .addOnCompleteListener(
            this,
            task -> {
            if (task.isSuccessful()) {
                // The signed-in account is stored in the task's result.
                GoogleSignInAccount signedInAccount = task.getResult();
                showSignInPopup();
            } else {
                // Perform interactive sign in.
                startSignInIntent();
            }
        });
}

private void startSignInIntent() {
    GoogleSignInClient signInClient = GoogleSignIn.getClient(this,
        GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN);
    Intent intent = signInClient.getSignInIntent();
    startActivityForResult(intent, RC_SIGN_IN);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == RC_SIGN_IN) {
        GoogleSignInResult result =
        Auth.GoogleSignInApi.getSignInResultFromIntent(data);
        if (result.isSuccess()) {
            // The signed-in account is stored in the result.
            GoogleSignInAccount signedInAccount = result.getSignInAccount();
            showSignInPopup();
        } else {
            String message = result.getStatus().getStatusMessage();
            if (message == null || message.isEmpty()) {
                message = getString(R.string.signin_other_error);
        }
        new AlertDialog.Builder(this).setMessage(message)
            .setNeutralButton(android.R.string.ok, null).show();
        }
    }
}

private void showSignInPopup() {
Games.getGamesClient(requireContext(), signedInAccount)
    .setViewForPopups(contentView)
    .addOnCompleteListener(
        task -> {
            if (task.isSuccessful()) {
                logger.atInfo().log("SignIn successful");
            } else {
                logger.atInfo().log("SignIn failed");
            }
        });
  }

وعدِّلها إلى ما يلي:

private void signInSilently() {
    gamesSignInClient.isAuthenticated().addOnCompleteListener(isAuthenticatedTask -> {
    boolean isAuthenticated =
        (isAuthenticatedTask.isSuccessful() &&
            isAuthenticatedTask.getResult().isAuthenticated());
        if (isAuthenticated) {
            // Continue with Play Games Services
        } else {
            // If authentication fails, either disable Play Games Services
            // integration or
            // display a login button to prompt players to sign in.
            // Use`gamesSignInClient.signIn()` when the login button is clicked.
        }
    });
}

@Override
protected void onResume() {
    super.onResume();
    // When the activity is inactive, the signed-in user's state can change;
    // therefore, silently sign in when the app resumes.
    signInSilently();
}

Kotlin

ابحث عن الملفات التي تحمل الفئة GoogleSignIn.

// Request codes we use when invoking an external activity.
private val RC_SIGN_IN = 9001

// ... existing code

private fun isSignedIn(): Boolean {
    val account = GoogleSignIn.getLastSignedInAccount(this)
    val signInOptions = GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN
    return GoogleSignIn.hasPermissions(account, *signInOptions.scopeArray)
}

private fun signInSilently() {
    val signInOptions = GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN
    val signInClient = GoogleSignIn.getClient(this, signInOptions)
    signInClient.silentSignIn().addOnCompleteListener(this) { task ->
        if (task.isSuccessful) {
            // The signed-in account is stored in the task's result.
            val signedInAccount = task.result
            // Pass the account to showSignInPopup.
            showSignInPopup(signedInAccount)
        } else {
            // Perform interactive sign in.
            startSignInIntent()
        }
    }
}

private fun startSignInIntent() {
    val signInClient = GoogleSignIn.getClient(this, GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN)
    val intent = signInClient.signInIntent
    startActivityForResult(intent, RC_SIGN_IN)
}

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (requestCode == RC_SIGN_IN) {
        val result = Auth.GoogleSignInApi.getSignInResultFromIntent(data)
        if (result.isSuccess) {
            // The signed-in account is stored in the result.
            val signedInAccount = result.signInAccount
            showSignInPopup(signedInAccount) // Pass the account to showSignInPopup.
        } else {
            var message = result.status.statusMessage
            if (message == null || message.isEmpty()) {
                message = getString(R.string.signin_other_error)
        }
        AlertDialog.Builder(this)
            .setMessage(message)
            .setNeutralButton(android.R.string.ok, null)
            .show()
        }
    }
}

private fun showSignInPopup(signedInAccount: GoogleSignInAccount) {
    // Add signedInAccount parameter.
    Games.getGamesClient(this, signedInAccount)
        .setViewForPopups(contentView) // Assuming contentView is defined.
        .addOnCompleteListener { task ->
        if (task.isSuccessful) {
            logger.atInfo().log("SignIn successful")
        } else {
            logger.atInfo().log("SignIn failed")
        }
    }
}

وعدِّلها إلى ما يلي:

private fun signInSilently() {
    gamesSignInClient.isAuthenticated.addOnCompleteListener { isAuthenticatedTask ->
        val isAuthenticated = isAuthenticatedTask.isSuccessful &&
        isAuthenticatedTask.result.isAuthenticated
        if (isAuthenticated) {
            // Continue with Play Games Services
        } else {
            // To handle a user who is not signed in, either disable Play Games Services integration
            // or display a login button. Selecting this button calls `gamesSignInClient.signIn()`.
        }
    }
}

override fun onResume() {
    super.onResume()
    // Since the state of the signed in user can change when the activity is
    // not active it is recommended to try and sign in silently from when the
    // app resumes.
    signInSilently()
}

إضافة الرمز GamesSignInClient

إذا تم تسجيل دخول اللاعب بنجاح، عليك إزالة زر تسجيل الدخول إلى "خدمات ألعاب Play" من لعبتك. إذا اختار المستخدم عدم تسجيل الدخول عند تشغيل اللعبة، واصِل عرض زر يتضمّن رمز "خدمات ألعاب Play"، وابدأ عملية تسجيل الدخول باستخدام GamesSignInClient.signIn().

Java

private void startSignInIntent() {
    gamesSignInClient
        .signIn()
        .addOnCompleteListener( task -> {
            if (task.isSuccessful() && task.getResult().isAuthenticated()) {
                // sign in successful
            } else {
                // sign in failed
            }
        });
  }

Kotlin

private fun startSignInIntent() {
    gamesSignInClient
        .signIn()
        .addOnCompleteListener { task ->
            if (task.isSuccessful && task.result.isAuthenticated) {
                // sign in successful
            } else {
                // sign in failed
            }
        }
  }

إزالة رمز تسجيل الخروج

أزِل الرمز الخاص بـ GoogleSignInClient.signOut.

أزِل الرمز البرمجي الموضّح في المثال التالي:

Java

// ... existing code

private void signOut() {
    GoogleSignInClient signInClient = GoogleSignIn.getClient(this,
    GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN);
    signInClient.signOut().addOnCompleteListener(this,
    new OnCompleteListener() {
        @Override
        public void onComplete(@NonNull Task task) {
           // At this point, the user is signed out.
        }
    });
}

Kotlin

// ... existing code

private fun signOut() {
    val signInClient = GoogleSignIn.getClient(this, GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN)
    signInClient.signOut().addOnCompleteListener(this) {
    // At this point, the user is signed out.
    }
}

التحقّق من نجاح عملية تسجيل الدخول تلقائيًا

أدرِج الرمز التالي للتحقّق مما إذا كنت قد سجّلت الدخول تلقائيًا وأضِف المنطق المخصّص إذا كان متاحًا.

Java

private void checkIfAutomaticallySignedIn() {
gamesSignInClient.isAuthenticated().addOnCompleteListener(isAuthenticatedTask -> {
boolean isAuthenticated =
    (isAuthenticatedTask.isSuccessful() &&
    isAuthenticatedTask.getResult().isAuthenticated());

    if (isAuthenticated) {
        // Continue with Play Games Services
        // If your game requires specific actions upon successful sign-in,
        // you can add your custom logic here.
        // For example, fetching player data or updating UI elements.
    } else {
        // Disable your integration with Play Games Services or show a
        // login button to ask  players to sign-in. Clicking it should
        // call GamesSignInClient.signIn().
        }
    });
}

Kotlin

private void checkIfAutomaticallySignedIn() {
gamesSignInClient.isAuthenticated()
    .addOnCompleteListener { task ->
    val isAuthenticated = task.isSuccessful && task.result?.isAuthenticated ?: false

        if (isAuthenticated) {
            // Continue with Play Games Services
        } else {
            // Disable your integration or show a login button
        }
    }
}

تعديل أسماء وطُرق فئات العملاء

عند الانتقال إلى الإصدار 2 من "خدمات ألعاب Google"، تختلف الطرق المستخدَمة للحصول على أسماء فئات العملاء. استخدِم طرق PlayGames.getxxxClient() المقابلة بدلاً من طرق Games.getxxxClient().

على سبيل المثال، بالنسبة إلى LeaderboardsClient، استخدِم PlayGames.getLeaderboardsClient() بدلاً من الطريقة Games.getLeaderboardsClient().

أزِل أي رمز مرتبط بالفئتين GamesClient وGamesMetadataClient، لأنّه ليس لدينا أي فئات بديلة في الإصدار 2 من "ألعاب Google Play".

Java

ابحث عن الرمز الخاص بـ LeaderboardsClient.

import com.google.android.gms.games.LeaderboardsClient;
import com.google.android.gms.games.Games;

@Override
public void onCreate(@Nullable Bundle bundle) {
    super.onCreate(bundle);
        // Get the leaderboards client using Play Games services.
    LeaderboardsClient leaderboardsClient = Games.getLeaderboardsClient(this,
        GoogleSignIn.getLastSignedInAccount(this));
}

وعدِّلها إلى ما يلي:

import com.google.android.gms.games.LeaderboardsClient;
import com.google.android.gms.games.PlayGames;

 @Override
public void onCreate(@Nullable Bundle bundle) {
    super.onCreate(bundle);
        // Get the leaderboards client using Play Games services.
        LeaderboardsClient leaderboardsClient = PlayGames.getLeaderboardsClient(getActivity());
}

Kotlin

ابحث عن الرمز الخاص بـ LeaderboardsClient.

import com.google.android.gms.games.LeaderboardsClient
import com.google.android.gms.games.Games
// Initialize the variables.
private lateinit var leaderboardsClient: LeaderboardsClient

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    leaderboardsClient = Games.getLeaderboardsClient(this,
        GoogleSignIn.getLastSignedInAccount(this))
}

وعدِّلها إلى ما يلي:

import com.google.android.gms.games.LeaderboardsClient
import com.google.android.gms.games.PlayGames
    // Initialize the variables.
private lateinit var leaderboardsClient: LeaderboardsClient

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    leaderboardsClient = PlayGames.getLeaderboardsClient(this)
}

وبالمثل، استخدِم الطرق المناسبة للعملاء التاليين: AchievementsClient أو EventsClient أو GamesSignInClient أو PlayerStatsClient أو RecallClient أو SnapshotsClient أو PlayersClient.

تعديل فئات الوصول من جهة الخادم

لطلب رمز دخول من جهة الخادم، استخدِم طريقة GamesSignInClient.requestServerSideAccess() بدلاً من طريقة GoogleSignInAccount.getServerAuthCode().

لمزيد من المعلومات، راجِع إرسال رمز مصادقة الخادم.

يوضّح المثال التالي كيفية طلب رمز مميّز للدخول من جهة الخادم.

Java

ابحث عن رمز الصف GoogleSignInOptions.

    private static final int RC_SIGN_IN = 9001;
    private GoogleSignInClient googleSignInClient;

    private void startSignInForAuthCode() {
        /** Client ID for your backend server. */
        String webClientId = getString(R.string.webclient_id);
        GoogleSignInOptions signInOption = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN)
            .requestServerAuthCode(webClientId)
            .build();

        GoogleSignInClient signInClient = GoogleSignIn.getClient(this, signInOption);
        Intent intent = signInClient.getSignInIntent();
        startActivityForResult(intent, RC_SIGN_IN);
    }

    /** Auth code to send to backend server */
    private String mServerAuthCode;

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == RC_SIGN_IN) {
            GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
        if (result.isSuccess()) {
            mServerAuthCode = result.getSignInAccount().getServerAuthCode();
        } else {
            String message = result.getStatus().getStatusMessage();
            if (message == null || message.isEmpty()) {
                message = getString(R.string.signin_other_error);
            }
            new AlertDialog.Builder(this).setMessage(message)
                .setNeutralButton(android.R.string.ok, null).show();
        }
      }
    }
  

وعدِّلها إلى ما يلي:

  private void startRequestServerSideAccess() {
      GamesSignInClient gamesSignInClient = PlayGames.getGamesSignInClient(this);
      gamesSignInClient
          .requestServerSideAccess(OAUTH_2_WEB_CLIENT_ID,
           /* forceRefreshToken= */ false, /* additional AuthScope */ scopes)
          .addOnCompleteListener(task -> {
              if (task.isSuccessful()) {
                  AuthResponse authresp = task.getResult();
                  // Send the authorization code as a string and a
                  // list of the granted AuthScopes that were granted by the
                  // user. Exchange for an access token.
                  // Verify the player with Play Games Services REST APIs.
              } else {
                // Authentication code retrieval failed.
              }
        });
  }
  

Kotlin

ابحث عن رمز الصف GoogleSignInOptions.

  // ... existing code

  private val RC_SIGN_IN = 9001
  private lateinit var googleSignInClient: GoogleSignInClient

  // Auth code to send to backend server.
  private var mServerAuthCode: String? = null

  private fun startSignInForAuthCode() {
      // Client ID for your backend server.
      val webClientId = getString(R.string.webclient_id)

      val signInOption = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN)
          .requestServerAuthCode(webClientId)
          .build()

      googleSignInClient = GoogleSignIn.getClient(this, signInOption)
      val intent = googleSignInClient.signInIntent
      startActivityForResult(intent, RC_SIGN_IN)
  }

  override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
      super.onActivityResult(requestCode, resultCode, data)
      if (requestCode == RC_SIGN_IN) {
          val result = Auth.GoogleSignInApi.getSignInResultFromIntent(data)
          if (result.isSuccess) {
              mServerAuthCode = result.signInAccount.serverAuthCode
          } else {
              var message = result.status.statusMessage
              if (message == null || message.isEmpty()) {
                  message = getString(R.string.signin_other_error)
              }
              AlertDialog.Builder(this).setMessage(message)
                  .setNeutralButton(android.R.string.ok, null).show()
            }
        }
  }
  

وعدِّلها إلى ما يلي:

  private void startRequestServerSideAccess() {
  GamesSignInClient gamesSignInClient = PlayGames.getGamesSignInClient(this);
      gamesSignInClient
          .requestServerSideAccess(OAUTH_2_WEB_CLIENT_ID, /* forceRefreshToken= */ false,
          /* additional AuthScope */ scopes)
          .addOnCompleteListener(task -> {
              if (task.isSuccessful()) {
                  AuthResponse authresp = task.getResult();
                  // Send the authorization code as a string and a
                  // list of the granted AuthScopes that were granted by the
                  // user. Exchange for an access token.
                  // Verify the player with Play Games Services REST APIs.
              } else {
                // Authentication code retrieval failed.
              }
        });
  }
  

النقل من GoogleApiClient

بالنسبة إلى عمليات الدمج القديمة الحالية، قد تعتمد لعبتك على GoogleApiClient إصدار واجهة برمجة التطبيقات من حزمة تطوير البرامج (SDK) الخاصة "بخدمات ألعاب Play". تم إيقاف هذه الميزة نهائيًا في أواخر عام 2017 واستبدالها ببرامج "لا تتطلّب اتصالاً". لإجراء عملية النقل، يمكنك استبدال الفئة GoogleApiClient بفئة مكافئة "بدون اتصال". يسرد الجدول التالي عمليات الربط الشائعة بين الفئات من الإصدار 1 إلى الإصدار 2 من "ألعاب":

games v2 (الحالية) الإصدار 1 من الألعاب (قديم)
com.google.android.gms.games.AchievementsClient com.google.android.gms.games.achievement.Achievements
com.google.android.gms.games.LeaderboardsClient com.google.android.gms.games.leaderboard.Leaderboard
com.google.android.gms.games.SnapshotsClient com.google.android.gms.games.snapshot.Snapshots
com.google.android.gms.games.PlayerStatsClient com.google.android.gms.games.stats.PlayerStats
com.google.android.gms.games.PlayersClient com.google.android.gms.games.Players
com.google.android.gms.games.GamesClientStatusCodes com.google.android.gms.games.GamesStatusCodes

إنشاء اللعبة وتشغيلها

لإنشاء التطبيق وتشغيله على &quot;استوديو Android&quot;، اطّلِع على إنشاء تطبيقك وتشغيله.

اختبار لعبتك

تأكَّد من أنّ لعبتك تعمل على النحو المصمَّمة له من خلال اختبارها. تعتمد الاختبارات التي تجريها على ميزات لعبتك.

في ما يلي قائمة بالاختبارات الشائعة التي يجب إجراؤها.

  1. تم تسجيل الدخول بنجاح.

    1. تعمل ميزة "تسجيل الدخول التلقائي". يجب أن يكون المستخدم مسجّلاً الدخول إلى "خدمات ألعاب Play" عند تشغيل اللعبة.

    2. يتم عرض النافذة المنبثقة الترحيبية.

      مثال على نافذة منبثقة للترحيب
      مثال على نافذة منبثقة للترحيب (انقر للتكبير).

    3. يتم عرض رسائل السجل الناجحة. نفِّذ الأمر التالي في الوحدة الطرفية:

      adb logcat | grep com.google.android.

      يظهر مثال على رسالة سجل ناجحة على النحو التالي:

      [$PlaylogGamesSignInAction$SignInPerformerSource@e1cdecc
      number=1 name=GAMES_SERVICE_BROKER>], returning true for shouldShowWelcomePopup.
      [CONTEXT service_id=1 ]
  2. ضمان اتّساق عناصر واجهة المستخدم:

    1. يتم عرض النوافذ المنبثقة ولوحات الصدارة والإنجازات بشكل صحيح ومتسق على أحجام الشاشات المختلفة وبمختلف الاتجاهات في واجهة مستخدم &quot;خدمات ألعاب Play&quot;.

    2. لا يظهر خيار تسجيل الخروج في واجهة مستخدم "خدمات ألعاب Play".

    3. تأكَّد من إمكانية استرداد معرّف اللاعب بنجاح، ومن أنّ الإمكانات من جهة الخادم تعمل على النحو المتوقّع، إذا كان ذلك منطبقًا.

    4. إذا كانت اللعبة تستخدم المصادقة من جهة الخادم، اختبِر مسار requestServerSideAccess بشكل شامل. تأكَّد من أنّ الخادم يتلقّى رمز التفويض ويمكنه استبداله برمز مميّز للوصول. اختبِر سيناريوهات النجاح والفشل لأخطاء الشبكة وسيناريوهات client ID غير صالحة.

إذا كانت لعبتك تستخدم أيًا من الميزات التالية، اختبِرها للتأكّد من أنّها تعمل بالطريقة نفسها كما كانت قبل عملية النقل:

  • قوائم الصدارة: إرسال النتائج والاطّلاع على قوائم الصدارة تحقَّق من الترتيب الصحيح وعرض أسماء اللاعبين ونتائجهم.
  • الإنجازات: فتح قفل الإنجازات والتأكّد من تسجيلها وعرضها بشكل صحيح في واجهة مستخدم "ألعاب Play"
  • الألعاب المحفوظة: إذا كانت اللعبة تستخدم الألعاب المحفوظة، تأكَّد من أنّ حفظ مستوى التقدّم في اللعبة وتحميله يعملان بشكل سليم. ويُعدّ هذا الأمر مهمًا بشكل خاص لاختبار التطبيق على أجهزة متعددة وبعد تحديثات التطبيق.

مهام ما بعد نقل البيانات

أكمِل الخطوات التالية بعد نقل بياناتك إلى الإصدار 2 من "ألعاب Google Play".

نشر اللعبة

أنشئ حِزم APK وانشر اللعبة في Play Console.

  1. في قائمة Android Studio، اختَر إنشاء > إنشاء حِزم/حِزم APK > إنشاء حِزم APK.
  2. انشر لعبتك. لمزيد من المعلومات، راجِع مقالة نشر التطبيقات الخاصة من Play Console.