got timed notification working

This commit is contained in:
BroodjeAap 2020-11-29 14:48:12 +01:00
parent 0b63598ee7
commit 949c1300e6
2 changed files with 20 additions and 1 deletions

View file

@ -1,6 +1,25 @@
package net.broodjeaap.ohthatsa
import android.media.RingtoneManager
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugins.GeneratedPluginRegistrant
import java.util.*
class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
MethodChannel(flutterEngine.dartExecutor, "net.broodjeaap.othatsa").setMethodCallHandler {
call: MethodCall, result: MethodChannel.Result ->
if ("getAlarmUri" == call.method) {
result.success(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM).toString())
}
if ("getTimeZoneName" == call.method) {
result.success(TimeZone.getDefault().getID())
}
}
}
}

View file

@ -23,7 +23,7 @@ final BehaviorSubject<String> selectNotificationSubject =
BehaviorSubject<String>();
const MethodChannel platform =
MethodChannel('dexterx.dev/flutter_local_notifications_example');
MethodChannel('net.broodjeaap.othatsa');
class ReceivedNotification {
ReceivedNotification({