Merge pull request 'Unlock for Android' (#6) from theme into unlock

Reviewed-on: #6
This commit is contained in:
Dan Ballard 2021-01-28 12:24:35 -08:00
commit ac42583993
2 changed files with 12 additions and 8 deletions

View File

@ -71,11 +71,11 @@ class MainActivity: FlutterActivity() {
Log.i("MainActivity.kt", "got event chan: " + eventbus_chan + " launching corouting...")
GlobalScope.launch(Dispatchers.IO) {
while(true) {
val jsonEvent = Cwtch.getAppBusEvent()
Log.i("MainActivity.kt", "got appbusEvent: " + jsonEvent)
launch(Dispatchers.Main) {
eventbus_chan.invokeMethod("AppbusEvent", jsonEvent)
}
//val jsonEvent = Cwtch.getAppBusEvent()
// Log.i("MainActivity.kt", "got appbusEvent: " + jsonEvent)
// launch(Dispatchers.Main) {
// //eventbus_chan.invokeMethod("AppbusEvent", jsonEvent)
//}
}
}
@ -90,8 +90,12 @@ class MainActivity: FlutterActivity() {
val pass = (call.argument("pass") as? String) ?: "";
Cwtch.createProfile(nick, pass)
}
"LoadProfiles" -> {
val pass = (call.argument("pass") as? String) ?: "";
Cwtch.loadProfiles(pass)
}
"GetProfiles" -> result.success(Cwtch.getProfiles())
"ACNEvents" -> result.success(Cwtch.acnEvents())
// "ACNEvents" -> result.success(Cwtch.acnEvents())
"ContactEvents" -> result.success(Cwtch.contactEvents())
"GetContacts" -> {
val onion = (call.argument("profile") as? String) ?: "";

View File

@ -32,8 +32,8 @@ class CwtchGomobile implements Cwtch {
androidHomeDirectory = getApplicationDocumentsDirectory();
androidLibraryDir = appInfoPlatform.invokeMethod('getNativeLibDir');
final appbusEventChannel = MethodChannel(appbusEventChannelName);
appbusEventChannel.setMethodCallHandler(this._handleAppbusEvent);
// final appbusEventChannel = MethodChannel(appbusEventChannelName);
// appbusEventChannel.setMethodCallHandler(this._handleAppbusEvent);
}
Future<void> Start() async {