Pitfalls in development mobile app with Phonegap Build

  • Jan 16

It is quite easy to use Phonegap Build with Ionic Framework. You just need to upload the files and get back the compiled apps. But there are two pitfalls I met during the development of an mobile application.

The first is that local storage is not persistent. I use Lawnchair for data storage and the default one is 'dom' storage. This storage does not need any particular permission. It comes with web view. After digging awhile, I realize that you need to have the default permission for Phonegap in order to use it:

<preference name="permissions" value="none"/>

Another issue is the use of cordova clipboard. The example of using it is:

cordova.plugins.clipboard.copy(text);

And you will get error of undefined cordova.plugins.clipboard. If you check the cordova clipboard in the plugin repository of Phonegap, you will realize that it links to a release version of cordova clipboard, which uses this code:

window.plugins.copy(text);

So next time, you need to check the document more carefully.