diff --git a/android/app/src/main/kotlin/net/defined/mobile_nebula/MainActivity.kt b/android/app/src/main/kotlin/net/defined/mobile_nebula/MainActivity.kt index 29b4dda..a78be8d 100644 --- a/android/app/src/main/kotlin/net/defined/mobile_nebula/MainActivity.kt +++ b/android/app/src/main/kotlin/net/defined/mobile_nebula/MainActivity.kt @@ -54,12 +54,11 @@ class MainActivity: FlutterActivity() { } override fun configureFlutterEngine(flutterEngine: FlutterEngine) { + super.configureFlutterEngine(flutterEngine) appContext = context //TODO: Initializing in the constructor leads to a context lacking info we need, figure out the right way to do this sites = Sites(flutterEngine) - - GeneratedPluginRegistrant.registerWith(flutterEngine) - + ui = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL) ui!!.setMethodCallHandler { call, result -> when(call.method) { @@ -99,7 +98,7 @@ class MainActivity: FlutterActivity() { apiClient = APIClient(context) - ContextCompat.registerReceiver(context, refreshReceiver, IntentFilter(ACTION_REFRESH_SITES), RECEIVER_NOT_EXPORTED) + ContextCompat.registerReceiver(context, refreshReceiver, IntentFilter(ACTION_REFRESH_SITES), ContextCompat.RECEIVER_NOT_EXPORTED) enqueueDNUpdater() } diff --git a/lib/models/Site.dart b/lib/models/Site.dart index 46ee231..df98dfc 100644 --- a/lib/models/Site.dart +++ b/lib/models/Site.dart @@ -93,7 +93,7 @@ class Site { this.rawConfig = rawConfig; this.lastManagedUpdate = lastManagedUpdate; - _updates = EventChannel('net.defined.nebula/$id'); + _updates = EventChannel('net.defined.nebula/${this.id}'); _updates.receiveBroadcastStream().listen((d) { try { _updateFromJson(d);