node_modules/nativescript-plugin-firebase/firebase.ios.js
// rather than hijacking the appDelegate for these we'll be a good citizen and listen to the notifications
rather than hijacking the appDelegate for these we'll be a good citizen and listen to the notifications
rather than hijacking the appDelegate for these we ' ll be a good citizen and listen to the notifications
function prepAppDelegate() {
    if (typeof (FIRMessaging) !== "undefined") {
        firebase_common_1.firebase._addObserver("com.firebase.iid.notif.refresh-token", function (notification) { return firebase_common_1.firebase._onTokenRefreshNotification(notification.object); });
        firebase_common_1.firebase._addObserver(UIApplicationDidFinishLaunchingNotification, function (appNotification) {
            if (applicationSettings.getBoolean("registered", false)) {
                firebase_common_1.firebase._registerForRemoteNotifications();
            }
        });
        firebase_common_1.firebase._addObserver(UIApplicationDidBecomeActiveNotification, function (appNotification) {
            firebase_common_1.firebase._processPendingNotifications();
            if (!firebase_common_1.firebase._messagingConnected) {
                firebase_common_1.firebase._messagingConnectWithCompletion();
            }
        });
        firebase_common_1.firebase._addObserver(UIApplicationDidEnterBackgroundNotification, function (appNotification) {
            if (firebase_common_1.firebase._messagingConnected) {
                FIRMessaging.messaging().disconnect();
            }
        });
        firebase_common_1.firebase._addObserver(UIApplicationWillEnterForegroundNotification, function (appNotification) {
            if (firebase_common_1.firebase._messagingConnected !== null) {
                FIRMessaging.messaging().connectWithCompletion(function (error) {
                    if (!error) {
                        firebase_common_1.firebase._messagingConnected = true;
                    }
                });
            }
        });
    }
    firebase_common_1.firebase.addAppDelegateMethods(getAppDelegate());
}
function prepAppDelegate ( ) { if ( typeof ( FIRMessaging ) !== "undefined" ) { firebase_common_1 . firebase . _addObserver ( "com.firebase.iid.notif.refresh-token" , function ( notification ) { return firebase_common_1 . firebase . _onTokenRefreshNotification ( notification . object ) ; } ) ; firebase_common_1 . firebase . _addObserver ( UIApplicationDidFinishLaunchingNotification , function ( appNotification ) { if ( applicationSettings . getBoolean ( "registered" , false ) ) { firebase_common_1 . firebase . _registerForRemoteNotifications ( ) ; } } ) ; firebase_common_1 . firebase . _addObserver ( UIApplicationDidBecomeActiveNotification , function ( appNotification ) { firebase_common_1 . firebase . _processPendingNotifications ( ) ; if ( ! firebase_common_1 . firebase . _messagingConnected ) { firebase_common_1 . firebase . _messagingConnectWithCompletion ( ) ; } } ) ; firebase_common_1 . firebase . _addObserver ( UIApplicationDidEnterBackgroundNotification , function ( appNotification ) { if ( firebase_common_1 . firebase . _messagingConnected ) { FIRMessaging . messaging ( ) . disconnect ( ) ; } } ) ; firebase_common_1 . firebase . _addObserver ( UIApplicationWillEnterForegroundNotification , function ( appNotification ) { if ( firebase_common_1 . firebase . _messagingConnected !== null ) { FIRMessaging . messaging ( ) . connectWithCompletion ( function ( error ) { if ( ! error ) { firebase_common_1 . firebase . _messagingConnected = true ; } } ) ; } } ) ; } firebase_common_1 . firebase . addAppDelegateMethods ( getAppDelegate ( ) ) ; }
rather than hijacking the appDelegate for these we'll be a good citizen and listen to the notifications
rather than hijacking the appDelegate for these we ' ll be a good citizen and listen to the notifications
// see https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/178 for why we're not using a constant here // guarded this with a preference so the popup "this app wants to send notifications" // is not shown until the dev intentionally wired a listener (see other usages of _registerForRemoteNotifications()) // Firebase notifications (FCM) // Firebase notifications (FCM)