Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sky/shell/platform/android/io/flutter/view/FlutterView.java
Original file line number Diff line number Diff line change
Expand Up @@ -610,15 +610,15 @@ public interface OnMessageListener {
* Called when a message is received from the Flutter app.
* @return the reply to the message (can be null)
*/
String onMessage(String message);
String onMessage(FlutterView view, String message);
};

public interface OnMessageListenerAsync {
/**
* Called when a message is received from the Flutter app.
* @param response Used to send a reply back to the app.
*/
void onMessage(String message, MessageResponse response);
void onMessage(FlutterView view, String message, MessageResponse response);
}

public interface MessageResponse {
Expand All @@ -636,13 +636,13 @@ public void onConnectionError(MojoException e) {}
public void sendString(String messageName, String message, SendStringResponse callback) {
OnMessageListener listener = mOnMessageListeners.get(messageName);
if (listener != null) {
callback.call(listener.onMessage(message));
callback.call(listener.onMessage(FlutterView.this, message));
return;
}

OnMessageListenerAsync asyncListener = mAsyncOnMessageListeners.get(messageName);
if (asyncListener != null) {
asyncListener.onMessage(message, new MessageResponseAdapter(callback));
asyncListener.onMessage(FlutterView.this, message, new MessageResponseAdapter(callback));
return;
}

Expand Down