{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic-native/issues/108","repository_url":"https://api.github.com/repos/driftyco/ionic-native","labels_url":"https://api.github.com/repos/driftyco/ionic-native/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic-native/issues/108/comments","events_url":"https://api.github.com/repos/driftyco/ionic-native/issues/108/events","html_url":"https://github.com/driftyco/ionic-native/issues/108","id":145799171,"number":108,"title":"Degree of ngCordova API conformance strictness","user":{"login":"rapropos","id":2531128,"avatar_url":"https://avatars.githubusercontent.com/u/2531128?v=3","gravatar_id":"","url":"https://api.github.com/users/rapropos","html_url":"https://github.com/rapropos","followers_url":"https://api.github.com/users/rapropos/followers","following_url":"https://api.github.com/users/rapropos/following{/other_user}","gists_url":"https://api.github.com/users/rapropos/gists{/gist_id}","starred_url":"https://api.github.com/users/rapropos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapropos/subscriptions","organizations_url":"https://api.github.com/users/rapropos/orgs","repos_url":"https://api.github.com/users/rapropos/repos","events_url":"https://api.github.com/users/rapropos/events{/privacy}","received_events_url":"https://api.github.com/users/rapropos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-04T20:46:27Z","updated_at":"2016-06-11T13:38:46Z","closed_at":"2016-06-11T13:38:46Z","body":"Apologies if this is documented somewhere or if this isn't the proper way to raise this topic (as an issue), but are there rules as to how precisely ionic-native must mimic the API signature of previous ngCordova plugins?\r\n\r\nAs an example, the recent [File plugin addition](https://github.com/driftyco/ionic-native/pull/76) lists the lack of existence of `options.append` and `options.truncate` as the reason that `writeFile` has not yet been implemented. I assume this is referring to the following code in [the ngCordova version of the File plugin](https://github.com/driftyco/ng-cordova/blob/master/src/plugins/file.js):\r\n\r\n```\r\n        writeFile: function (path, fileName, text, replaceBool) {\r\n          var q = $q.defer();\r\n\r\n          if ((/^\\//.test(fileName))) {\r\n            q.reject('file-name cannot start with \\/');\r\n          }\r\n\r\n          replaceBool = replaceBool ? false : true;\r\n\r\n          var options = {\r\n            create: true,\r\n            exclusive: replaceBool\r\n          };\r\n\r\n          try {\r\n            $window.resolveLocalFileSystemURL(path, function (fileSystem) {\r\n              fileSystem.getFile(fileName, options, function (fileEntry) {\r\n                fileEntry.createWriter(function (writer) {\r\n                  if (options.append === true) {\r\n                    writer.seek(writer.length);\r\n                  }\r\n\r\n                  if (options.truncate) {\r\n                    writer.truncate(options.truncate);\r\n                  }\r\n```\r\n\r\nAs best as I can see, `options.append` and `options.truncate` can't ever be set, so they're basically dead code. They could be useful, though. So I was thinking that it would be possible to replace the `replaceBool`with an `options` object that can contain the boolean properties \"replace\", \"append\", and \"truncate\". For backwards compatibility, if a boolean is passed as `options`, it would be treated as a lone \"replace\" option. So calling code migrating from ngCordova would still work as expected, but new code targeting the ionic-native version could take advantage of more fine-grained control of options.\r\n\r\nIs this sort of thing considered desirable, or do you want absolutely no deviation from the calling conventions that were established with ngCordova?"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic-native/issues/comments/225362328","html_url":"https://github.com/driftyco/ionic-native/issues/108#issuecomment-225362328","issue_url":"https://api.github.com/repos/driftyco/ionic-native/issues/108","id":225362328,"user":{"login":"ihadeed","id":13794420,"avatar_url":"https://avatars.githubusercontent.com/u/13794420?v=3","gravatar_id":"","url":"https://api.github.com/users/ihadeed","html_url":"https://github.com/ihadeed","followers_url":"https://api.github.com/users/ihadeed/followers","following_url":"https://api.github.com/users/ihadeed/following{/other_user}","gists_url":"https://api.github.com/users/ihadeed/gists{/gist_id}","starred_url":"https://api.github.com/users/ihadeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ihadeed/subscriptions","organizations_url":"https://api.github.com/users/ihadeed/orgs","repos_url":"https://api.github.com/users/ihadeed/repos","events_url":"https://api.github.com/users/ihadeed/events{/privacy}","received_events_url":"https://api.github.com/users/ihadeed/received_events","type":"User","site_admin":false},"created_at":"2016-06-11T13:38:46Z","updated_at":"2016-06-11T13:38:46Z","body":"Hey sorry I missed this earlier.\r\n\r\nFeel free to do anything as long as it matches this repo's style. There is no need to stick to ngCordova's conventions!"}}
{"actor":{"display_login":"ihadeed"}}