Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
add firebase core dependency in example app
  • Loading branch information
Chris Yang committed Oct 8, 2019
commit 46b97e8c8b1c92189bb607c6e9699eed2db38be4
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry;
import io.flutter.plugins.firebase.core.FirebaseCorePlugin;
import io.flutter.plugins.firebase.firebaseremoteconfig.FirebaseRemoteConfigPlugin;

public class MainActivity extends FlutterActivity {
Expand All @@ -10,5 +12,9 @@ public class MainActivity extends FlutterActivity {
public void configureFlutterEngine(FlutterEngine flutterEngine) {
super.configureFlutterEngine(flutterEngine);
flutterEngine.getPlugins().add(new FirebaseRemoteConfigPlugin());

ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(flutterEngine);
FirebaseCorePlugin.registerWith(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto from other PR

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have missed some updates about the V2 embedding. I took a look of other firebase plugin migration PR and figured we don't have to use the ShimPluginRegistry to manually register the firebase core plugin anymore. And instead we need to add the e2e plugin. So I have updated the file the same. Could you please take another look see if it is good to merge? @xster

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant rather that https://github.com/FirebaseExtended/flutterfire/blob/master/packages/firebase_core/android/src/main/java/io/flutter/plugins/firebase/core/FirebaseCorePlugin.java has a v2 embedding implementation. Shouldn't it just work if you did flutterEngine.getPlugins.add(new FirebaseCorePlugin());?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see thanks! Will update the dependency as well.

shimPluginRegistry.registrarFor("io.flutter.plugins.firebase.core.FirebaseCorePlugin"));
}
}