me.apla.cordova.app-preferences icon indicating copy to clipboard operation
me.apla.cordova.app-preferences copied to clipboard

iOS and local Browser not working :(

Open quersumme opened this issue 8 years ago • 2 comments

Hello everybody,

I have problems with cordova-plugin-app-preferences in my ionic environment. :-(

I use the following code:

$ionicPlatform.ready(function() {
    $cordovaPreferences.store('key', 'myMagicValue')
      .success(function(value) {
        $scope.data.pref = "Success: " + value;
      })
      .error(function(error) {
        $scope.data.pref = "Error: " + error;
      })
});
    $cordovaPreferences.fetch('key')
      .success(function(value) {
        $scope.data.pref_read = value;
      })
      .error(function(error) {
        $scope.data.pref_read = "Error: "+value;
      })

On the android emulator is

  • $scope.data.pref: Success: OK
  • $scope.data.pref_read: myMagicValue

On the iOS emulator is:

  • $scope.data.pref: Success: null
  • $scope.data.pref_read:

On the Chrome browser (ionic serve) is:

  • $scope.data.pref: Error: Error: Plugin not enabled
  • $scope.data.pref_read:

I have done the following steps so far:

  • Installed ngCordova
  • Plugin installed with: cordova plugin add cordova-plugin-app-preferences --save
  • added ng-cordova.js:
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
  • added ngCordova' in my starter module: var app = angular.module('app', ['ionic', 'angularMoment', 'ngCordova'])
  • injected $cordovaPreferences in controller: app.controller('introCtrl', function($scope, $state, $ionicPlatform, $cordovaPreferences, $ionicSlideBoxDelegate) {

Can anyone help me?

Thank you, Tobias


Please specify your environment

Plugin version:

  • [x] released version: 0.99.2
  • [x] repository master

Toolchain:

  • [ ] Cordova cli
  • [ ] Phonegap cli
  • [ ] Phonegap cloud
  • [x] Ionic
  • [ ] Other: _____

Platforms affected:

  • [ ] Android
  • [x] iOS/macOS
  • [x] LocalStorage fallback for browser and blackberry
  • [ ] Windows and Windows Phone 8.1 and later
  • [ ] Windows Phone 8 and earlier (deprecated)

What the scope of your problem:

  • [x] General functionality (store/fetch/remove/clearAll)
  • [ ] Suites
  • [ ] Cloud synchronization and events
  • [ ] Preferences pane generation and display

quersumme avatar Sep 07 '16 14:09 quersumme

also same problem here

ThodorisElissaios avatar Nov 17 '16 04:11 ThodorisElissaios

Same problem for me also..

nagubabu avatar Jan 27 '17 11:01 nagubabu