Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@capacitor-community/firebase-analytics

Package Overview
Dependencies
Maintainers
38
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor-community/firebase-analytics - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0-0

2

package.json
{
"name": "@capacitor-community/firebase-analytics",
"version": "1.0.1",
"version": "2.0.0-0",
"description": "A native plugin for firebase analytics.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/capacitor-community/firebase-analytics",

@@ -31,7 +31,3 @@ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p>

```bash
# Capacitor v3
npm install @capacitor-community/firebase-analytics@latest
# Capacitor v2
npm install @capacitor-community/firebase-analytics@capacitor2-lts
```

@@ -42,7 +38,3 @@

```bash
# Capacitor v3
yarn add @capacitor-community/firebase-analytics@latest
# Capacitor v2
yarn add @capacitor-community/firebase-analytics@capacitor2-lts
```

@@ -53,24 +45,8 @@

```bash
# Update the native plugins and dependencies referenced in package.json
npx cap sync
```
On iOS, no further steps are needed.
> **Note:** You may also need to run **File > Sync Project with Gradle Files** in order for Android Studio to recognize the import.
On Android, register the plugin in your main activity:
```java
import com.getcapacitor.community.firebaseanalytics.FirebaseAnalytics;
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
registerPlugin(FirebaseAnalytics.class);
}
}
```
> **Note:** You may need to run **File > Sync Project with Gradle Files** in order for Android Studio to recognize the import.
## Configuration

@@ -281,6 +257,3 @@

- add `google-services.json` to your `android/app` folder
- `[extra step]` in android case we need to tell Capacitor to initialise the plugin:
> on your `MainActivity.java` file add `import com.getcapacitor.community.firebaseanalytics.FirebaseAnalytics;` and then inside the init callback `add(FirebaseAnalytics.class);`
Now you should be set to go. Try to run your client using `ionic cap run android --livereload --address=0.0.0.0`.

@@ -304,3 +277,3 @@

npm uninstall --save capacitor-analytics
npm install --save-prod @capacitor-community/firebase-analytics
npm install --save-prod @capacitor-community/firebase-analytics@latest
```

@@ -310,10 +283,9 @@

Update the plugin import:
Remove the old plugin import:
```diff
-import io.stewan.capacitor.analytics.AnalyticsPlugin;
+import com.getcapacitor.community.firebaseanalytics.FirebaseAnalytics;
```
Update the `init()` call to use the new plugin import:
Update the `init()` call to remove the old plugin import. You may be able to remove the entire `init()` call if there is nothing else in there.

@@ -326,3 +298,2 @@ ```diff

- add(AnalyticsPlugin.class);
+ add(FirebaseAnalytics.class);
}});

@@ -329,0 +300,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc