Closed HbIXA closed 8 years ago
are you referring to the fact that you are not able to run in the browser during development.
Yes
In the browser there is no preference or 'native storage' available. This is the same reason why many plugins don't work in a browser and work only in the device or emulator. A possible soln would be to have a fallback to localstorage. As of now we don't have a javascript proxy to fall back.
I think it makes sense to implement at least a cookie, it is for the browser .
See this ngCordova doc link which specifies testing apps with plugins in general on a browser is not a good idea. It is a common issue with cordova and not specifically this plugin. Same goes with plugins such as media, gyro, camera etc.
@alokrajiv I'll implement a localstorage approach if the application is running in the browser.
@GillesC Sounds good.
It'll be a simpel approach: test if in browser, if yes save via localstorage.
I suggest you could check for availability of cordova or phonegap. if not fallback to localstorage. because checking if running in browser will be difficult.
cordova provides a cordova.platformId parameter whichs results in 'browser' when running in a browser.
ok then. But, I thought that was for the 'browser' platform only. Anyways, try it. You can see this open issue link. Because usually in the browser cordova is undefined.
Thank you, I was just checking the platformID, now I will check for cordova and phonegap also ;)
Testing in browser is now possible. Would you check if your problem has been resolved?
Please remove the old version first:
cordova plugin remove cordova-plugin-nativestorage
And use the development version of the plugin:
cordova plugin add https://github.com/GillesC/cordova-plugin-nativestorage.git
Added browser for testing purposes in commit 29b4bb6348732b6b7ca260894f15eaf592e5d0a4.
@GillesC are you able to reproduce the results on browser?
Yup I've tested it through the browser platform.
Working perfectly. I am closing the issue.
commit 29b4bb6348732b6b7ca260894f15eaf592e5d0a4.
Yeah, I thought waiting for @HbIXA to respond. And if his issue had been resolved, than to close this issue.
Ok, lets wait for @HbIXA to confirm. If he doesnt soon, I'll reopen the issue.
Temporarily reopening the issue for 48hrs. @HbIXA pls confirm that your issue is resolved. If not in 48hrs we'll close the issue because we have tested and aren't facing the issue anymore.
result : plugin ls
cordova-plugin-nativestorage 1.0.9 "NativeStorage"
version not updated
cordova plugin remove cordova-plugin-nativestorage && cordova plugin add https://github.com/GillesC/cordova-plugin-nativestorage.git && cordova plugin ls
I suspect you didn't install the development version. Bcoz the v1.0.10 isn't on release yet.
Like I said in a previous comment, you must install the development version. This because I'm waiting for your response to republish the plugin on npm.
The previous post: Testing in browser is now possible. Would you check if your problem has been resolved?
Please remove the old version first:
cordova plugin remove cordova-plugin-nativestorage
And use the development version of the plugin:
cordova plugin add https://github.com/GillesC/cordova-plugin-nativestorage.git
good job
I think by 'good job' you meant, that the plugin works ;) I'll close this issue now.
Added browser for testing purposes in commit 29b4bb6.
Thanks for this. I have an issue where the inBrowser
function returns true for me on Android because window.phonegap
is undefined.
@jayj I understood. But, let me recreate the issue. and I will respond back.
@jayj Thank you for pointing the error , the commit actually broke the functionality. I am re-opening the issue while I update the inBrowser function.
I have updated it. Please reinstall the development version and check.
cordova plugin remove cordova-plugin-nativestorage && cordova plugin add https://github.com/GillesC/cordova-plugin-nativestorage.git
And retry your use case. I beleive I have corrected the problem with commit 3714c9b319b650d70211af8e5fb7d26c314b9685.
@jayj Please confirm.
@alokrajiv thanks for the quick fix! It works now 👍
Glad thinks worked out! I'm re-closing the issue Problem corrected with commit 3714c9b
Updating the plugin on npm as well and version control on Github
log