<commit_before>'use strict';
angular.module('copayApp.services')
  .factory('pushNotificationsService', function($http, $rootScope, $log, isMobile, storageService, configService, lodash, isCordova) {
    var root = {};
    var defaults = configService.getDefaults();
    var usePushNotifications = isCordova && !isMobile.Windows();

    root.pushNotificationsInit = function() {
      if (!usePushNotifications) return;

      var config = configService.getSync();
      if (!config.pushNotifications.enabled) return;

      var push = PushNotification.init(defaults.pushNotifications.config);

      push.on('registration', function(data) {
        $log.debug('Starting push notification registration');
        storageService.setDeviceToken(data.registrationId, function() {
          $rootScope.$emit('Local/pushNotificationsReady');
        });
      });

      push.on('notification', function(data) {
        $log.debug('Push notification event: ', data.message);
        /* data.message,
         data.title,
         data.count,
         data.sound,
         data.image,
         data.additionalData
        */
      });

      push.on('error', function(e) {
        $log.warn('Error trying to push notifications: ', e);
      });
    };

    root.enableNotifications = function(walletsClients) {
      if (!usePushNotifications) return;

      var config = configService.getSync();
      if (!config.pushNotifications.enabled) return;

      storageService.getDeviceToken(function(err, token) {
        lodash.forEach(walletsClients, function(walletClient) {
          var opts = {};
          opts.type = isMobile.iOS() ? "ios" : isMobile.Android() ? "android" : null;
          opts.token = token;
          root.subscribe(opts, walletClient, function(err, response) {
            if (err) $log.warn('Subscription error: ' + err.message);
            else $log.debug('Subscribed to push notifications service: ' + JSON.stringify(response));
          });
        });
      });
    }
<commit_msg>remove unnecessary methods<commit_after>'use strict';
angular.module('copayApp.services')
  .factory('pushNotificationsService', function($http, $rootScope, $log, isMobile, storageService, configService, lodash, isCordova) {
    var root = {};
    var defaults = configService.getDefaults();
    var usePushNotifications = isCordova && !isMobile.Windows();

    root.pushNotificationsInit = function() {
      if (!usePushNotifications) return;

      var config = configService.getSync();
      if (!config.pushNotifications.enabled) return;

      var push = PushNotification.init(defaults.pushNotifications.config);

      push.on('registration', function(data) {
        $log.debug('Starting push notification registration');
        storageService.setDeviceToken(data.registrationId, function() {
          $rootScope.$emit('Local/pushNotificationsReady');
        });
      });
    };

    root.enableNotifications = function(walletsClients) {
      if (!usePushNotifications) return;

      var config = configService.getSync();
      if (!config.pushNotifications.enabled) return;

      storageService.getDeviceToken(function(err, token) {
        lodash.forEach(walletsClients, function(walletClient) {
          var opts = {};
          opts.type = isMobile.iOS() ? "ios" : isMobile.Android() ? "android" : null;
          opts.token = token;
          root.subscribe(opts, walletClient, function(err, response) {
            if (err) $log.warn('Subscription error: ' + err.message);
            else $log.debug('Subscribed to push notifications service: ' + JSON.stringify(response));
          });
        });
      });
    }

{'fraction_non_alphanumeric': 0.13113854595336077, 'fraction_numerical': 0.0, 'mean_word_length': 3.0021953896816687, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4430528', 'n_tokens_mistral': 999, 'n_tokens_neox': 972, 'n_words': 192}