Persistent data with Cordova on iOS - javascript

I'm developing a leaderboard for my game (written in JS) and I need to locally store some user's infos between more .html and .js pages, just like the username for the login and bestscore.
I did it using localStorage and on the desktop browser it worked with no issue at all, same for the Android app wrapped with Cordova. However, testing it in iOS resulted in localStorage wiped out on every app restart! Googling it out I decided to switch to localForage. Again, Android and Desktop (Chrome on Mac) works just fine but on iOS datas get wiped out when app is closed from the multitasking. I tried both WEBSQL and INDEXEDDB as localForage drivers. I tested on two different iPhones (iOS 10.3.2 and iOS 10.3.3) and both were NOT running out of memory. I use CocoonJS to wrap the files. Any help please? Don't absolutely know where this issue is coming from. Thank you in advance.

About LocalStorage on ios
iOS stores localStorage data in a location that may be cleaned out by the OS when space is required.
You can try plugin-based, sql-lite or something like it.

Related

html5 based game not working in android

I have an html5 game that was designed that will not work on android phones. The client is saving their website to their android device as a webapp and when they open the app from their homescreen, when they click on the link for the game, all they are getting is a black screen. I am thinking that because they are getting this issue, when they save the app to their phone, it is saving a cached version and will not allow the necessary files to load for the game. When they try this on the desktop, it works perfectly, as well when they try on any apple device it will work, only because when you click a link on a webapp saved to the homescreen on an apple device it breaks out of the shell and opens safari browser.
Is there any way to make the link to the game break out of an android webapp that is saved to the homescreen so that it can open in a web browser instead of inside the app?
Any suggestions are welcome.
The link to the app is http://mobilesourceapps.com/pondwiser
Thanks again guys!
Try PhoneGap. An auto-builder. http://phonegap.com/ it will compile the mobile versions for Android. There is also a version-download for IOS from the App Store. This might help you. Without code is tricky.

Complete data loss Ionic / Cordova LocalStorage and Websql iOS 8.4.1

My app is build with Ionic / Cordova 5.0.0 - Using SQLite (PouchDB) for the majority of the data, and localStorage for preferences and what not.
Out of 300+ iOS users, I've had 4 users report complete data loss. The app simply reset to the original state as if Localstorage and the Websql data was blown out completely. All of these users are on iOS and running 8.4.*
I've tried to reproduce the problem by manually deleting all localstorage, which resets the app as expected, but the SQLite data remains. I simply cannot figure out anyway to reproduce this, let alone figure out how it could be happening.
Note: I haven't had any reports from Android.
Any ideas?
As I've recently discovered, iOS wipes localstorage when the device is low on space.

Incorrect index.html load path on iOS application when published at AppStore

Recently I've migrate my Cordova 2.9.x application to Cordova 3.6.0.
On Android and Windows Phone, the application is working fine, and it was already published at Google Play Store and Windows Phone Store.
On iOS platform, the application is running fine when in development mode (running it on iOS simulators or devices) and I've also made an ad-hoc test with Testflight and everything works as expected.
The problem is, when published at App Store (after Apple's review), when user enters the application, it's trying to load the index.html located at /www/production/index.html, and the correct path is /www/index.html, and the user remains stuck at this error screen.
The old application version (using Cordova 2.9.x) used the /www/production/index.html path, but the new cordova project was started from scratch, and doesn't have any reference to this path.
I don't know what is happening. Has someone passed through a similar situation?
Take a look in the iOS config.xml because Cordova let's you customize it
myproject/platforms/ios/myproject/config.xml

Phonegap IOS App with local storage

I need to develop an app for iOS with some basic functionality and since I'm not experienced with Objective C but with Web development, I need to know if it's possible to do it using Phonegap.
This app will be like a book with chapters that needs to be updated on a daily basis.
There'll be a CMS in a server where the content will be updated. Text and pictures.
The app will be running on iPhone and iPad that sometimes may not be connected to the network. When connected they need to check for updates and save in a local database to be available when off-line.
Is this possible using Phonegap?
Is there any local database in iOS like SQLite? Or do I need to store everything in files?
Can we save the text in a database and the pictures somewhere in a folder? Or everything needs to be saved in the local database?
What are the best plugins, features, methods that I'll need to look into?
You can use both LocalStorage and WebSQL in a PhoneGap app. LocalStorage is just... localStorage. Check the MDN docs for it. Ditto for WebSQL.

Using JavaScript in my web app to delete files on the user's smart phone

I'm a software developer from Germany and I have a special problem concerning smart phones, websites and security!
My web application - which is optimized for smart phones - allowes it to upload photo files (made by the smart phone camera) up to our webserver.
(I use the regular HTML File Control.)
It works fine!
But now we think about possibilities to delete the uploaded photos on the smart phone - via the web app!
Is there any chance to realize that?
Our users work with Firefox 17.0 for Android.
Maybe Mozilla offers proprietary JavaScript code to get access to the local smart phone devices ... ?
Or is there any possibility to change the local security settings of Firefox Mobile?
If both solutions can't be realized, could I develop a smart phone app (which is locally installed) that deletes the photos on the phone? I'm sure I could!
But then I need a possibility to start the app using my website code.
So I have the same security problem - I think so ... again I need a way to "leave" my website to get access to local devices via JavaScript or something else (to start the installed app on the phone).
Is there anybody who has an idea?
Thanks in advance.
Thomas

Categories