Ejemplo n.º 1
0
 function OnlineMonitor() {
     var _this = _super.call(this, ['online']) || this;
     _this.online_ = true;
     // We've had repeated complaints that Cordova apps can get stuck "offline", e.g.
     // https://forum.ionicframework.com/t/firebase-connection-is-lost-and-never-come-back/43810
     // It would seem that the 'online' event does not always fire consistently. So we disable it
     // for Cordova.
     if (typeof window !== 'undefined' &&
         typeof window.addEventListener !== 'undefined' &&
         !util_2.isMobileCordova()) {
         window.addEventListener('online', function () {
             if (!_this.online_) {
                 _this.online_ = true;
                 _this.trigger('online', true);
             }
         }, false);
         window.addEventListener('offline', function () {
             if (_this.online_) {
                 _this.online_ = false;
                 _this.trigger('online', false);
             }
         }, false);
     }
     return _this;
 }
Ejemplo n.º 2
0
 PersistentConnection.prototype.sendConnectStats_ = function () {
     var stats = {};
     var clientName = 'js';
     if (util_6.CONSTANTS.NODE_ADMIN) {
         clientName = 'admin_node';
     }
     else if (util_6.CONSTANTS.NODE_CLIENT) {
         clientName = 'node';
     }
     stats['sdk.' + clientName + '.' + app_1.default.SDK_VERSION.replace(/\./g, '-')] = 1;
     if (util_7.isMobileCordova()) {
         stats['framework.cordova'] = 1;
     }
     else if (util_7.isReactNative()) {
         stats['framework.reactnative'] = 1;
     }
     this.reportStats(stats);
 };