fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
623 stars 995 forks source link

White screen After Splash screen #432

Open monsif opened 6 years ago

monsif commented 6 years ago

Cordova CLI: 7.1.0 Ionic Framework Version: 3.8.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 3.0.1 ios-deploy version: 1.9.2 ios-sim version: 5.0.13 OS: macOS Sierra Node Version: v6.11.5 Xcode version: Xcode 8.3.3 Build version 8E3004b

constructor(private nav: NavController, private auth: AuthService, private alertCtrl: AlertController, private fcm: FCM, private loadingCtrl: LoadingController, private fb: Facebook) {
    fcm.getToken().then(token=> {
      alert(token);
      //backend.registerToken(token);
    });

> Following is giving white screen
    fcm.onNotification().subscribe(data=> {
      if (data.wasTapped) {
        console.log("Received in background");
        alert(JSON.stringify(data));
      } else {
        console.log("Received in foreground");
        alert(JSON.stringify(data));
      }
    });
     this.fcm.onTokenRefresh().subscribe(token=> {
     alert("Token was refreshed :" + token);
     });
  }
shivsuthanmhub commented 6 years ago

@monsif - Please double check your app.module.ts file "Providers" section whether "FCM" added.

For example:

import { FCM } from '@ionic-native/fcm';

providers: [ StatusBar, SplashScreen, {provide: ErrorHandler, useClass: IonicErrorHandler}, FCM
]

monsif commented 6 years ago

@shivsuthanmhub yes i do have FCM in providers:

  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    AuthService,
    MarkersService,
    Facebook,
    Geolocation,
    Camera,
    File,
    FCM,
    Properties,
    Diagnostic,
    PermissionsService
  ]
karlmendes commented 6 years ago

+1

do u install on android 7.0 ?

monsif commented 6 years ago

on ios 10, i think there was a conflict with facebook plugin, i injected FCM service in another page and everything is working fine.

abcdurga commented 6 years ago

I am not using facebook plugin but still getting white screen after splash screen in ios devices. Any fix ??

abcdurga commented 6 years ago

White screen issue resolved by updating the following:-

"ionic-angular": "^3.9.2", "cordova-ios": "~4.5.4", "cordova-plugin-fcm": "^2.1.2",