diff --git a/www/i18n/en.json b/www/i18n/en.json index 04049d222..0ad663610 100644 --- a/www/i18n/en.json +++ b/www/i18n/en.json @@ -245,11 +245,18 @@ } }, + "intro": { + "permissions": { + "locationPermExplanation-android-lt-6": "you accepted the permission during installation. You don't need to do anything now.", + "locationPermExplanation-android-gte-6": "please select 'allow'", + "locationPermExplanation-ios-lt-13": "please select 'Always allow'. This allows us to protect you even when you are not actively using the app", + "locationPermExplanation-ios-gte-13": "please select 'when in use' now. After a few days, you will be asked whether you want to give the app background permission. Please say 'Always Allow' at that time. This allows us to protect you even when you are not actively using the app" + } + }, "consent":{ "button-accept": "I accept", "button-decline": "I refuse" }, - "updatecheck":{ "downloading-update": "Downloading UI-only update", "extracting-update": "Extracting UI-only update", @@ -257,5 +264,9 @@ "download-new-ui": "Download new UI-only update?.", "download-not-now": "Not now", "download-apply": "Apply" + }, + "sensor_explanation":{ + "button-accept": "OK", + "button-decline": "Stop" } } diff --git a/www/js/intro.js b/www/js/intro.js index 43da7f16d..c4adf1de5 100644 --- a/www/js/intro.js +++ b/www/js/intro.js @@ -18,12 +18,31 @@ angular.module('emission.intro', ['emission.splash.startprefs', }); }) -.controller('IntroCtrl', function($scope, $state, $ionicSlideBoxDelegate, +.controller('IntroCtrl', function($scope, $state, $window, $ionicSlideBoxDelegate, $ionicPopup, $ionicHistory, ionicToast, $timeout, CommHelper, StartPrefs, $translate, $cordovaFile) { + + $scope.platform = $window.device.platform; + $scope.osver = $window.device.version.split(".")[0]; + if($scope.platform.toLowerCase() == "android") { + if($scope.osver < 6) { + $scope.locationPermExplanation = $translate.instant('intro.permissions.locationPermExplanation-android-lt-6'); + } else { + $scope.locationPermExplanation = $translate.instant("intro.permissions.locationPermExplanation-android-gte-6"); + } + } + + if($scope.platform.toLowerCase() == "ios") { + if($scope.osver < 13) { + $scope.locationPermExplanation = $translate.instant("intro.permissions.locationPermExplanation-ios-lt-13"); + } else { + $scope.locationPermExplanation = $translate.instant("intro.permissions.locationPermExplanation-ios-gte-13"); + } + } + console.log("Explanation = "+$scope.locationPermExplanation); $scope.getConsentFile = function () { var lang = $translate.use(); - $scope.consentFile = "templates/intro/consent.html"; + $scope.consentFile = "templates/intro/sensor_explanation.html"; if (lang != 'en') { var url = "www/i18n/intro/consent-" + lang + ".html"; $cordovaFile.checkFile(cordova.file.applicationDirectory, url).then( function(result){ @@ -33,7 +52,7 @@ angular.module('emission.intro', ['emission.splash.startprefs', }, function (err) { window.Logger.log(window.Logger.LEVEL_DEBUG, "Consent file not found, loading english version, error is " + JSON.stringify(err)); - $scope.consentFile = "templates/intro/consent.html"; + $scope.consentFile = "templates/intro/sensor_explanation.html"; }); } }