diff --git a/www/js/modules/notification/service.js b/www/js/modules/notification/service.js index e5124b1b7b7ee550a3b9cdf975bd86044d41cfe6..7c0d7a703a032988387770c53abadd98b7dd6ab5 100644 --- a/www/js/modules/notification/service.js +++ b/www/js/modules/notification/service.js @@ -28,12 +28,6 @@ var deviceData = ionic.Platform.device(); deviceData = Object.assign(deviceData, {locale: locale}); - window.FirebasePlugin.getToken(function (token) { - deviceData.token = token; - }, function (error) { - deviceData.token = 'errorGettingToken' + error; - }); - window.FirebasePlugin.onTokenRefresh(function (token) { deviceData.token = token; }, function (error) { @@ -42,7 +36,7 @@ if (typeof deviceData.token === 'undefined' || deviceData.token == null) { deviceData.token = 'tokenCannotBeCreated'; - } + } } else { //Mock deviceData diff --git a/www/js/modules/purchase/service.js b/www/js/modules/purchase/service.js index 25bbd7f63ea4d02be7e99fcba5d3440f2d059093..e62ef208d87bbc2698a8338b1ed0550bc6819a9e 100644 --- a/www/js/modules/purchase/service.js +++ b/www/js/modules/purchase/service.js @@ -18,7 +18,7 @@ var transactionData = {}; if (window.cordova) { inAppPurchase - .buy(purchaseId) + .subscribe(purchaseId) .then(function (data) { transactionData = { transactionId: data.transactionId, diff --git a/www/js/pages/football/controller.js b/www/js/pages/football/controller.js index d1c1a2964088ac07d3d8dd2336ba6090f8657013..8dee0ef8d2f1e1f6c5f458ab554cca81870cd8e8 100644 --- a/www/js/pages/football/controller.js +++ b/www/js/pages/football/controller.js @@ -96,11 +96,8 @@ var ionContentObj = angular.element(document.querySelector('ion-content')); var leagueHeight = angular.element(document.querySelector('.pack-item'))[0].scrollHeight; - console.log('toto'); - if (self.shouldUp && $scope.selected.length > 0) { list.css('marginBottom', '47px'); - console.log(ionic.Platform.isIOS()); if (ionic.Platform.isIOS()) { ionContentObj.css('marginBottom', '47px'); } @@ -124,6 +121,7 @@ $scope.buyContent = function () { var pack = self.findPack($scope.selected.length); + console.log(self.uuid); PurchaseService.buyContent(self.uuid, pack, $scope.selected); }; diff --git a/www/js/pages/tabs/controller.js b/www/js/pages/tabs/controller.js index e9135c44f129bdd88f7a2023b0f64aba4b5886bb..634bde31cd8904dd4ddd523bcb6488a438595fd7 100644 --- a/www/js/pages/tabs/controller.js +++ b/www/js/pages/tabs/controller.js @@ -55,7 +55,8 @@ $scope.buyContent = function () { if (self.pack !== '') { - PurchaseService.buyContent(self.uuid, self.pack, $scope.selected); + var uuid = window.cordova ? ionic.Platform.device().uuid : '7f4a6a40e5c87157'; + PurchaseService.buyContent(uuid, self.pack, $scope.selected); } }; diff --git a/www/js/pages/tennis/controller.js b/www/js/pages/tennis/controller.js index 806d17e46b6b2cd6b5bdba963f7a81ffdb001bae..cae04efa6b2056396f847aa4f668f69d0dcaa608 100644 --- a/www/js/pages/tennis/controller.js +++ b/www/js/pages/tennis/controller.js @@ -157,13 +157,17 @@ }; $scope.parseDate = function (date) { - var locale = window.navigator.language.split('-')[0]; - date = date.split(' ')[0].split('-'); - - if (locale === "fr") { - return date[2] + '/' + date[1] + '/' + date[0].substr(-2); + if (typeof date === 'undefined' || date == "") { + return ""; } else { - return date[1] + '/' + date[2] + '/' + date[0].substr(-2); + var locale = window.navigator.language.split('-')[0]; + date = date.split(' ')[0].split('-'); + + if (locale === "fr") { + return date[2] + '/' + date[1] + '/' + date[0].substr(-2); + } else { + return date[1] + '/' + date[2] + '/' + date[0].substr(-2); + } } };