Skip to content

Commit

Permalink
fix(firestore): cleaned up use of previous method channel (#11758)
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley committed Oct 23, 2023
1 parent 0578182 commit 8cfc69b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
Expand Up @@ -32,7 +32,6 @@
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.EventChannel;
import io.flutter.plugin.common.EventChannel.StreamHandler;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.StandardMethodCodec;
import io.flutter.plugins.firebase.core.FlutterFirebasePlugin;
import io.flutter.plugins.firebase.core.FlutterFirebasePluginRegistry;
Expand Down Expand Up @@ -70,7 +69,6 @@ public class FlutterFirebaseFirestorePlugin
io.flutter.plugins.firebase.firestore.FlutterFirebaseFirestoreMessageCodec.INSTANCE);

private BinaryMessenger binaryMessenger;
private MethodChannel channel;

private final AtomicReference<Activity> activity = new AtomicReference<>(null);

Expand Down Expand Up @@ -129,9 +127,6 @@ public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {

@Override
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
channel.setMethodCallHandler(null);
channel = null;

removeEventListeners();

binaryMessenger = null;
Expand Down
Expand Up @@ -115,14 +115,8 @@ - (instancetype)init:(NSObject<FlutterBinaryMessenger> *)messenger {
}

+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
FlutterMethodChannel *channel =
[FlutterMethodChannel methodChannelWithName:kFLTFirebaseFirestoreChannelName
binaryMessenger:[registrar messenger]
codec:_codec];

FLTFirebaseFirestorePlugin *instance =
[[FLTFirebaseFirestorePlugin alloc] init:[registrar messenger]];
[registrar addMethodCallDelegate:instance channel:channel];

#if TARGET_OS_OSX
// TODO(Salakar): Publish does not exist on MacOS version of FlutterPluginRegistrar.
Expand Down

0 comments on commit 8cfc69b

Please sign in to comment.