@capacitor-community/firebase-analytics
Advanced tools
Comparing version 1.0.1 to 2.0.0-0
{ | ||
"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 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
115838
2
343
1