Created
August 26, 2020 08:15
-
-
Save vreamer/f0d5a38dd07d210fe2d7a1e2c2de10bd to your computer and use it in GitHub Desktop.
Invoke 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
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) { | |
val remoteInput = RemoteInput.getResultsFromIntent(intent) | |
if (remoteInput != null) { | |
val title = remoteInput.getCharSequence( | |
NotificationHelper.KEY_TEXT_REPLY).toString() | |
Log.d("NotificationReceiver", title) | |
NativeMethodChannel.showNewIdea(title) // add this line to invoke method channel | |
NotificationHelper.showNotification(context) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment