Hello Everyone! I spent more time to did it🥴. how to integrate firebase crashlytics with the ionic project in vue or angular. A Google Firebase Crashlytics plugin to enable capture of crash reports.
- first we need to install Cordova in your project
npm i -g cordova
- Install cordova-plugin-firebase-crashlytics
ionic cordova plugin add cordova-plugin-firebase-crashlytics
npm install @awesome-cordova-plugins/firebase-crashlytics
3.next we go to create new firebase account
- Go To your firebase console https://console.firebase.google.com/u/0/
first step to Add Project then put name
second step to go create a project here if you want to google analytics to if you don't want GA just click toggle it's disabled and click to continue
now we are created the project successfully.
next we had a project overview dashboard in there left hand side we have been Release & Monitoring click and go firebase crashlytics dashboard page view like this
The next thing to do go to add firebase to your android app
register your app note: put your app id like this: com.test.firebase
Download config file to your local storage
note: if you should check your project inside google-service.json file exist or not exist if not exist find and put file .it's automatically generate to your platform inside android. if not generated go to put manually. then only you can integrate firebase crashlytics. I to stuck this step I did not add so its firebase crashlytics didn't work so need to check if it's there or not .
Adding required configuration files in your config.xml file
Cordova supports a resource-file tag for easy copying of resource files. Firebase SDK requires google-services.json on Android platforms.
Put google-services.json and into the root directory of your Cordova project Add new tag for the Android platform
<platform name="android">
...
**<resource-file src="google-services.json" target="app/google-services.json" />**
</platform>
...
<platform name="ios">
...
<resource-file src="GoogleService-Info.plist" />
</platform>
This way config files will be copied on the Cordova prepare step.
then go to your project put some logging in firebase crashlytics
for example test
firebaseCrashlytics.crash();
above line go to crash your app then go to check your dashboard what are the events failed status view dashboard page .here we can see elaborate detail about the crash.
finally, we will see below the dashboard
if you have any doubt regarding this put your comment in comment section
I hope it will helpful for someone🙂🙂