Updates & fixes
parent
229efb2e25
commit
b677be9e3c
@ -0,0 +1,32 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class WhatsappMethodChannel {
|
||||
static const MethodChannel _channel = MethodChannel('whats_app_otp');
|
||||
|
||||
FutureOr<void> handleHandShake() async {
|
||||
try {
|
||||
await _channel.invokeMethod("performHandShake");
|
||||
|
||||
} on PlatformException catch (e) {
|
||||
print("Failed to launch PenguinIn: '${e.message}'.");
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> isWhatsAppInstalled() async {
|
||||
try {
|
||||
return await _channel.invokeMethod("isWhatsAppInstalled");
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> startListening() async {
|
||||
try{
|
||||
return await _channel.invokeMethod("startListening");
|
||||
}catch(e){
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue