getIdentity static method
getIdentity
Returns the current identity
Available Platforms
Web, Android, iOS
Implementation
static Future<GleapUserProperty?> getIdentity() async {
if (!kIsWeb && !io.Platform.isAndroid && !io.Platform.isIOS) {
debugPrint(
'getIdentity is not available for current operating system',
);
return null;
}
try {
dynamic userProperty = await _channel.invokeMethod('getIdentity');
return GleapUserProperty.fromJson(json.decode(json.encode(userProperty)));
} catch (err) {
return null;
}
}