Skip to content

onGetUserProfile ​

Get Sensitive User Information ​

This method is used to obtain sensitive original App user information. Its main purpose: to provide sensitive App user information to the game.


Method Declaration ​

java
/**
 * Triggered when the SDK requests the user's detailed profile (User Profile).
 * Usually involves fields more detailed than basic information, such as gender, region, and real-name status.
 *
 * @param handle   The state handle used to return the processing result to the SDK.
 * @param dataJson A JSON string containing the list of requested detailed attributes.
 */
void onGetUserProfile(SUDOPStateHandle handle, SUDOPOnGetUserProfileParams params);

Runtime Behavior ​

  • On-demand trigger: When a player taps to view a detailed profile card in the game, or when the game needs to assign an initial role/skin based on gender, the engine initiates this request.
  • Asynchronous closed loop: Since detailed profiles may be stored on different business servers, the App can gather all the fields and return them together via handle.success(resultJson).

Example Code ​

Implement the on-demand assembly and return of detailed profiles:

java
@Override
public void onGetUserProfile(SUDOPStateHandle handle, SUDOPOnGetUserProfileParams params) {
    // Obtain the encrypted user information via a backend request; see the demo code
    String user_profile_data = requestServer();
    handle.success(user_profile_data);
}

Notes ​

  • Data consistency: Ensure that the returned userId matches the ID in the request, to avoid data mismatches.
  • Field conventions: In addition to the constant fields predefined by SUDOP, if the game requires custom extended fields, the JSON key names must be agreed upon with the game developer.
  • Non-mandatory: Not all games call this interface. If the game only needs the avatar and nickname, usually only onGetUserInfo is triggered.