getJidFromPhoneNumber static method

Future<String?> getJidFromPhoneNumber({
  1. required String mobileNumber,
  2. required String countryCode,
})

Retrieves the JID associated with a given phone number.

This method queries the Mirrorfly to find the JID associated with the specified mobile number and country code. It is useful for converting a user's phone number into their JID, which is required for various operations within the Mirrorfly platform.

Parameters: mobileNumber - The mobile number of the user whose JID is to be retrieved. countryCode - The country code of the user's mobile number.

Returns: A Future<String?> that completes with the JID associated with the given phone number or null if the JID cannot be found or an error occurs.

Example usage:

String? jid = await Mirrorfly.getJidFromPhoneNumber(
  mobileNumber: "1234567890",
  countryCode: "+1",
);
if (jid != null) {
  print("JID: $jid");
} else {
  print("JID not found or error occurred");
}

Implementation

static Future<String?> getJidFromPhoneNumber(
    {required String mobileNumber, required String countryCode}) async {
  return FlyChatFlutterPlatform.instance
      .getJidFromPhoneNumber(mobileNumber, countryCode);
}