Home > Mobile >  Ionic App is crashing after login, when I run build on Android emulator
Ionic App is crashing after login, when I run build on Android emulator

Time:09-17

Note : its and ionic (Capacitor) project and i am using Android Studio for testing.

   requestNotificationsPermissions(): void {
        PushNotifications.requestPermission().then(result => {
            if (result.granted) {
                PushNotifications.register();
            }
        }).catch((err: any) => {
            console.log(err);
        });
    }

CodePudding user response:

I see you are using PushNotifications.

It used to happen to me when I forgot to include google-services.json in my Android project folder. If that is the case, include google-services.json inside android/app/ folder.

See the official plugin docs: https://capacitorjs.com/docs/apis/push-notifications#android

  • Related