whats “the ionic way” to set/get preferences - i’m gazing at:

where I can do

window.applicationPreferences.set('syncURL', '',
  function() {
    $log.log('syncURL pref. stored'); 
  function(error) {
    $log.log('error:', error);   

window.applicationPreferences.get("syncURL", function(value) {
  $log.log('syncURL:', value); 
    }, function(error) {
    $log.log('error:', error);   

other candidates:

it would of course be niece to use it with ngCordova -




There hasn’t been too much talk about setting preferences. But following angular practices should get you started. ngCordova is open source, so you can always make a PR and make an angular wrapper for the plugin you select :smile:

thx for the response !

i’ll look into make a PR for ngCordova then :smile:

if someone has other suggestions for a pref. plugin then let me know…

Preferably the first one because it suppers plugman and the api looks pretty straight forward

… so you can always make a PR and make an angular wrapper for the plugin you select

PR created

let me know if the implementation is sane…



1 Like


I’m using the ngCordova preferences plugin. I can’t seem to read existing preferences, but if I set a preference, then read it (both using $cordovaPreferences) it works. It seems like it doesn’t see the settings defined in the plist, and when I set a pref with the same identifier, it doesn’t update the settings viewable from the settings app on the device. Any help would be appreciated.


@pshields ok better late then never:

did you solve your problem - one thing is to be sure to use the right plugin it was changed from:


long story

if that did not solve your problem you would have upload a full app project somewhere / codepen wont work here - then I others might can help you further.



I greatly appreciate the info. I’ll try that when I next working on the project, as the client likely has some changes they want to make anyway.


$cordovaPreferences.get(‘name_identifier’) /.set doesn’t return callback.

Anyone having the same problem with beta 14 and Android 4.4.4?

@mhartington @pshields @pellekrogholt

Same problem
$cordovaPreferences.get and $cordovaPreferences.set doesn’t return callback

Has anyone been able to get $cordovaPreferences GET or SET to work within Ionic? Is there an alternative way to read iOS Settings.bundle in Ionic?

@mhartington Do you know what can we do?

Have you tried wrapping your usage of the plugin in $ionicPlatform.ready?

$ionicPlatform.ready(function () {
   $cordovaPreferences.get('name_identifier').then(function (name) {
    $ = name;

@alexweber15 It worked for you?

I actually haven’t tried, just in my experience with ngCordova you usually have to do that to get it to work… :slight_smile:

I have tried the following text, but it doesn’t works. Only the alert(1) is shown.

$ionicPlatform.ready(function () {
   $cordovaPreferences.set('name_identifier', 'hi').then(function (name) {
      $cordovaPreferences.get('name_identifier').then(function (result) {

Check this:

Nice find! Again, In my experience, some of the ngCordova plugins aren’t really worth it because they add only marginal value as opposed to actually using the cordova plugins directly (and in that case it’s crucial to wrap it in the ready() call).

Hi Everyone, I am working on Ionic 2 application. For preferences I wish to use the cordova plugin suggested in one of the answers above. I understand on IOS a plist file will be generated which can be modified from Application Settings in IOS as a means to update settings. How and where can I have a similar page/functionality on android?