adding control for non ios and android device in pushnotifications registration

This commit is contained in:
Gabriel Bazán 2016-01-20 15:28:56 -03:00
commit 1d3e74164d
2 changed files with 6 additions and 6 deletions

View file

@ -103,13 +103,10 @@ if [ ! -d $PROJECT ]; then
cordova plugin add cordova-plugin-statusbar cordova plugin add cordova-plugin-statusbar
checkOK checkOK
cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=bitcoin
checkOK
cordova plugin add phonegap-plugin-push@1.2.3 cordova plugin add phonegap-plugin-push@1.2.3
checkOK checkOK
cordova plugin add https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin.git --variable URL_SCHEME=bitcoin cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=bitcoin
checkOK checkOK
cordova plugin add cordova-plugin-inappbrowser cordova plugin add cordova-plugin-inappbrowser

View file

@ -5,6 +5,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
var SOFT_CONFIRMATION_LIMIT = 12; var SOFT_CONFIRMATION_LIMIT = 12;
self.isCordova = isCordova; self.isCordova = isCordova;
self.isChromeApp = isChromeApp; self.isChromeApp = isChromeApp;
self.pushDeviceType = isMobile.iOS() || isMobile.Android();
self.isSafari = isMobile.Safari(); self.isSafari = isMobile.Safari();
self.onGoingProcess = {}; self.onGoingProcess = {};
self.historyShowLimit = 10; self.historyShowLimit = 10;
@ -12,7 +13,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.prevState = 'walletHome'; self.prevState = 'walletHome';
document.addEventListener('deviceready', function() { document.addEventListener('deviceready', function() {
if (isMobile.Android() || isMobile.iOS()) { if (self.pushDeviceType) {
storageService.getDeviceToken(function(err, token) { storageService.getDeviceToken(function(err, token) {
$timeout(function() { $timeout(function() {
if (!token) pushNotificationsService.pushNotificationsInit(); if (!token) pushNotificationsService.pushNotificationsInit();
@ -1285,7 +1286,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}); });
$rootScope.$on('Local/SubscribeNotifications', function(event) { $rootScope.$on('Local/SubscribeNotifications', function(event) {
pushNotificationsService.enableNotifications(); if (self.pushDeviceType) {
pushNotificationsService.enableNotifications();
}
}); });
$rootScope.$on('Local/UnsubscribeNotifications', function(event, walletId, cb) { $rootScope.$on('Local/UnsubscribeNotifications', function(event, walletId, cb) {