isAuthenticated method
check if User is Authenticated on current opened Page
Implementation
Future<bool> isAuthenticated() async {
try {
final result = await wpClient.evaluateJs(
'''typeof window.WPP !== 'undefined' && window.WPP.conn.isAuthenticated();''',
tryPromise: false,
);
return result == true || result?.toString() == "true";
} catch (e) {
WhatsappLogger.log(e.toString());
return false;
}
}