getUserProfile method
Future<void>
getUserProfile(
- String jid,
- dynamic callback(
- FlyResponse response
- bool fromserver = false,
- bool saveasfriend = false,
override
This method is used to get the user profile.
Implementation
@override
Future<void> getUserProfile(
String jid, Function(FlyResponse response)? callback,
[bool fromserver = false, bool saveasfriend = false]) async {
String? profileResponse;
try {
profileResponse = await mirrorFlyMethodChannel.invokeMethod(
'getUserProfile',
{"jid": jid, "server": fromserver, "saveasfriend": saveasfriend});
var res = convertProfileJsonFromString(profileResponse);
callback?.call(FlyResponse(true, res, "user profile fetched"));
} on PlatformException catch (e) {
LogMessage.d("Platform Exception =", " $e");
callback?.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
FlyException(e.code, e.message, e.details)));
} on Exception catch (e) {
LogMessage.d("Exception ", " $e");
callback?.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
FlyException(FlyErrorCode.unHandle, FlyErrorMessage.unHandle, e)));
}
}