05/15/2024 15:19:45

Guest Channel Description

I. Overview

I. Overview

The Guest mode is a mode in which the user can login as the guest mode to experience the game and can be used as a new platform type alongside with WeChat and mobile QQ. MSDK generates a unique GuestId based on cellphone hardware information, similar to WeChat openId, from which the in-game openId is generated.

II. Android Guest Description

II. Android Guest Description

2.1 Guest Principle

Android GuestId is gotten by superimposing several device properties in the Android device that are not arbitrarily changed and then hashing them. It is one-to-one with MSDK's openid. So a change in GuestId can cause openid to change.

2.2 Guest Generation Rules

The concrete generation logic of Android GuestId is shown in the following diagram

Android guest creation process

2.3 Guest ID -- UUID

UUID, a universal unique identifier, refers to a number generated on a machine. It guarantees to be unique to all machines in the same time and space

UUID.randomUUID ().toString ();

2.4 Loss of Guest Account

1.When the application data is deleted, reinstalled or cleaned up, the guest account will certainly be lost.
2.When the user resets or restores the factory settings, the guest account will certainly be lost.

Due to the easy loss of Android guest account, the game should guide its users to log into it with channel accounts or bind its guest account with the channel accounts.
III. iOS Guest Description

III. iOS Guest Description

3.1 Guest Principle

MSDK iOS generates OpenID with the app's IDFV (identifierForVendor) as GuestID to enter the game to experience it without logging in it. MSDK provides optional services for the game to write GuestID into Keychain for storage. Try to ensure to obtain the same GuestID to retain the old guest account after the user uninstall the app and then re-install it.

3.2 IDFV

IDFV is the unique identifier that Apple provides to app vendor (publisher). App IDFV under the same Vender is the same.

Relationship between Vendor and Bundle ID:

  • In iOS 6, the first two components of bundle ID are used to generate Vendor ID. If bundle ID has only one component, the entire bundle ID is used.
  • In iOS 7, except for the last component, all components of bundle ID are used to generate Vendor ID. If bundle ID has only one component, the entire bundle ID is used.

[info] If app is not from App Store (such as the enterprise app and the app still under development), Vendor ID will be calculated based on the bundle ID of the app.

Bundle ID iOS 6.x iOS 7.x
com.tencent.app1 com.tencent.app1 com.tencent.app1
com.tencent.msdk.app1 com.tencent.msdk.app1 com.tencent.msdk.app1
example example example

When app is installed on iOS devices (or other apps from the same publisher are installed the devices), the value of IDFV remains unchanged. In the following conditions, IDFV will change:

  1. After a device upgrades or downgrades the system, it is reactivated and configured as a new device;
  2. Restore and erase device data;
  3. When the user removes all apps of the publisher from device and then reinstalls one or more apps;
  4. When installing the test version with Xcode or installing app on device with AD-Hoc distribution version

3.3 Keychain Storage

Keychain is a secure storage container in iOS device and can store sensitive information such as username, password, network password and authentication token for different apps. Keychain is a system-level SQLite database located in /private/var/Keychains/keychain-3.db, ​​and all data saved by it is encrypted.

Keychain items stored in iOS system have a property Keychain access group. Each app can only access these Keychain items which it has permission to access. This authorization comes from the description file that signs the app, which is based on the prefix Team ID of the current App ID.

iOS appID

  1. After opening keychain sharing, the system will also use the first accessGroup in the configuration by default
  2. If the first one does not exist or keychain sharing is not opened, it will use bunldId as the default accessGroup
  3. Use case: A does not open keychain sharing but save data; B opens keychain sharing. B can use A's bunldId as the key to get A's data
  4. It is recommended to add bunldId as the first accessGroup. This can reduce the possibility of data loss caused the deletion of non-BundleId's accessGroup due to version upgrade

3.4 App Transfer

Apple developers can use iTunes Connect to transfer eligible apps to other accounts in case of purchases, asset purchases or similar situations. When you transfer an app, the app will still be available in App Store or Mac App Store, all ratings and comments will be retained, and users will continue to have right to access future updates.

App transfer official website documentation iTunes Connect Developer Help About App Transfer

After an app is transferred, the App ID associated with it will also be transferred to the recipient's developer account, and different developer accounts' Team IDs will be different. The transferred app's App ID has the new Team ID as the prefix. If the previous versions have written data to Keychain, when you use the new developer account to update the app to App Store, you will receive warnings from Potential Loss of Keychain Access. This will cause the loss of the data written by the previous versions to Keychain, so the new version will be unable to access the data.

[info] Precaution

  1. The app's Bundle ID will not change after the transfer. If the transferred App ID was Wildcard App ID in the past, it will be converted to an explicit App ID that exactly matches the app's bundle ID.
    2.A one-time loss in keychain data will occur if you switch your App ID prefix and understand that it's not possible for a transferred app to maintain access to the prior keychain associated with the App ID prefix of the previous owner.
    3.The keychain access will only be lost after an update to the app is released on the App Store.

3.4.1 Impact of app transfer on guest account loss

enables MSDK Keychain to store the game of the guest GuestID. If there is an app transfer, there will be a large risk of losing the guest account.

[info] Precaution If you have not used any Keychain storage features, you will not be affected by the app transfer.

After the transferred app is upgraded, the GuestID stored in Keychain must be lost. Guest login will call the system interface to get new IDFV for login. If the IDFV is the same as the IDFV previously stored in Keychain, the previous guest account will be retained; otherwise, the guest account will be lost. So whether the guest account is lost depends on whether the IDFV value changes during the period ranging from the user's logging in the old versions of app as a guest to the new version of app

The following table shows the impact of app transfer on guest accounts in different situations.

Was the old version ever uninstalled? Installation mode of the new version Was guest ever lost? Remarks
Yes, it was uninstalled Uninstalle and then install Yes, it was lost IDFV has changed
Yes, it was uninstalled App Store upgrade Yes, it was lost IDFV has changed
No, it was not uninstalled App Store upgrade Retained IDFV has no change

[info] Precaution

  1. Either system upgrade or system restoration can inevitably lead to the loss of the guest account. It is not needed to give specific explanation for this;
  2. The above table does not consider the case where other apps from the same publisher are installed on the device.



Copyright © 2024 MSDK.
All rights reserved.

results matching ""

    No results matching ""