I'm trying to log different default events using Google Analytics for Firebase. I have added a line in my code to make the app crash. App crashes when I press toast button due to the presence of throw inside onClickListener. As per Firebase documentation, the crash should log default "app_exception". But I am not able to see that event in my events dashboard. Please suggest alternate ways of logging this event.
My Code is as follows:
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
mFirebaseAnalytics.setAnalyticsCollectionEnabled(true);
bundle = new Bundle();
bundle.putString("App_launched","Launch sucessfull");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT,bundle);
toastBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Bundle bundle=new Bundle();
bundle.putString("Toast_launched","New Toast");
mFirebaseAnalytics.logEvent("Toast_launched",bundle);
mFirebaseAnalytics.setCurrentScreen(MainActivity.this,"Dummy Screen",null);
Toast.makeText(getApplicationContext(),"Toast",Toast.LENGTH_LONG).show();
mFirebaseAnalytics.setUserProperty("age","21");
throw new RuntimeException("This is a crash");
}
});