cordova-plugin-nativestorage: callbacks don't seem to work on iOS 10 beta 7

First I wanted to thank you for the awesome plugin ๐Ÿ˜„

On iOS 10 (beta 7) the global NativeStorage Object is accessible, along with all documented methods. Unfortunately none of the callbacks get executed.

This example code works in iOS 9 but gives no output whatsoever (web Inspector, xcode console) in iOS 10:

NativeStorage.setItem('sample', 'abc', function () {console.log(arguments)}, function () {console.log(arguments)})

I know itโ€™s still beta but do you plan on adding iOS 10 support?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19

Most upvoted comments

@alokrajiv:

In your index.html that you are loading on app startup, add the following entries to your Content-Security-Policy meta tag:

gap://ready file:

An example of a โ€˜liberalโ€™ CSP which should enable pretty much all content (not really recommended) is:

<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline' 'unsafe-eval' 'self' gap://ready file: ws://<url to ws endpoint> cdvfile:; child-src * 'unsafe-inline' 'unsafe-eval' blob:; img-src * 'self' data: blob:;" />

Remove what you donโ€™t need, and specify <url to ws endpoint> if you use websockets.

Will this work for Ionic 2? Adding this to index.html does not fix the issue.