This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:direct_reply_notification/data-service.dart'; | |
import 'package:direct_reply_notification/flutter-method-channel.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
FlutterMethodChannel.instance.configureChannel(); | |
} | |
class MyApp extends StatelessWidget { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
class DataService { | |
StreamController<String> ideaController; | |
static final DataService instance = DataService._init(); | |
DataService._init() { | |
ideaController = StreamController(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:direct_reply_notification/data-service.dart'; | |
import 'package:flutter/services.dart'; | |
class FlutterMethodChannel { | |
static const channelName = 'channel'; | |
MethodChannel methodChannel; | |
static final FlutterMethodChannel instance = FlutterMethodChannel._init(); | |
FlutterMethodChannel._init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.direct_reply_notification | |
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.util.Log | |
import androidx.core.app.RemoteInput | |
class NotificationReceiver : BroadcastReceiver() { | |
override fun onReceive(context: Context, intent: Intent) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.direct_reply_notification | |
import io.flutter.embedding.engine.FlutterEngine | |
import io.flutter.plugin.common.MethodChannel | |
object NativeMethodChannel { | |
private const val CHANNEL_NAME = "channel" | |
private lateinit var methodChannel: MethodChannel | |
fun configureChannel(flutterEngine: FlutterEngine) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:direct_reply_notification/flutter-method-channel.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
FlutterMethodChannel.instance.configureChannel(); // configure method channel | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/services.dart'; | |
class FlutterMethodChannel { | |
static const channelName = 'channel'; // this channel name needs to match the one in Native method channel | |
MethodChannel methodChannel; | |
static final FlutterMethodChannel instance = FlutterMethodChannel._init(); | |
FlutterMethodChannel._init(); | |
void configureChannel() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.direct_reply_notification | |
import android.os.Bundle | |
import io.flutter.embedding.android.FlutterActivity | |
import io.flutter.embedding.engine.FlutterEngine | |
class MainActivity: FlutterActivity() { | |
override fun configureFlutterEngine(flutterEngine: FlutterEngine) { | |
super.configureFlutterEngine(flutterEngine) | |
NativeMethodChannel.configureChannel(flutterEngine) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.direct_reply_notification | |
import io.flutter.embedding.engine.FlutterEngine | |
import io.flutter.plugin.common.MethodChannel | |
object NativeMethodChannel { | |
private const val CHANNEL_NAME = "channel" | |
private lateinit var methodChannel: MethodChannel | |
fun configureChannel(flutterEngine: FlutterEngine) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
</activity> | |
<!-- add the line below to register receiver --> | |
<receiver android:name=".NotificationReceiver"/> | |
</application> |
NewerOlder