title: cordova-ionic ngCordova ios or iPhone file read error code 5 ENCODING_ERR
body: <p>i am using cordova-ionic framework to build app. i am new to the iOS or iPhone
  in my requirement, i have to read a file in the app. i am reading file in the android app but same code showing error (code: 5).</p>
  
  <p>i am following code types: </p>
  
  <p>in android: </p>
  
  <pre><code>$cordovaFile.writeFile(( 'user.json', data, {'append':false} )).then(function(result) {
    alert('file created.');
      alert(JSON.stringify(result));
  }, function(err) {
      // An error occured. Show a message to the user
      alert('file writed');
      alert(JSON.stringify(err));
  });
  </code></pre>
  
  <p>i can create file, writing, reading data and removing the file but in ios phone i am not able to create file using the same code.</p>
  
  <p>in iPhone:</p>
  
  <pre><code>var data = {"user":{"name":"errer","email":"sdsdff@gmail.com","username":"sdfsdfsd"}};
  
  $cordovaFile.writeFile(( 'user.json', data, {'append':false} )).then(function(result) {
      // Success!
      alert('file created.');
      alert(JSON.stringify(result));
  }, function(err) {
      // An error occured. Show a message to the user
      alert('file writed');
      alert(JSON.stringify(err));
  });
  </code></pre>
  
  <p>i just change my directory is cordova.file.cacheDirecotry/cordova.file.applicationDirectory</p>
  
  <pre><code>$cordovaFile.createFile(( cordova.file.cacheDirecotry+'user.json', true )).then(function(result) {
      // Success!
      alert('file created.');
      alert(JSON.stringify(result));
  }, function(err) {
      // An error occured. Show a message to the user
      alert('file writed');
      alert(JSON.stringify(err));
  });
  </code></pre>
  
  <p>all way getting the error like code: 12 or code: 5</p>
  
  <p>please help me to solve this or give me a idea to get application file path</p>