Code Monkey home page Code Monkey logo

Comments (31)

alokrajiv avatar alokrajiv commented on August 10, 2024 1

Ok, lets wait for @HbIXA to confirm. If he doesnt soon, I'll reopen the issue.

from cordova-plugin-nativestorage.

GillesC avatar GillesC commented on August 10, 2024 1

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.

from cordova-plugin-nativestorage.

jayj avatar jayj commented on August 10, 2024 1

@alokrajiv thanks for the quick fix! It works now 👍

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

are you referring to the fact that you are not able to run in the browser during development.

from cordova-plugin-nativestorage.

HbIXA avatar HbIXA commented on August 10, 2024

Yes

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

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.

from cordova-plugin-nativestorage.

HbIXA avatar HbIXA commented on August 10, 2024

I think it makes sense to implement at least a cookie, it is for the browser .

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

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.

from cordova-plugin-nativestorage.

GillesC avatar GillesC commented on August 10, 2024

@alokrajiv I'll implement a localstorage approach if the application is running in the browser.

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

@GillesC Sounds good.

from cordova-plugin-nativestorage.

GillesC avatar GillesC commented on August 10, 2024

It'll be a simpel approach: test if in browser, if yes save via localstorage.

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

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.

from cordova-plugin-nativestorage.

GillesC avatar GillesC commented on August 10, 2024

cordova provides a cordova.platformId parameter whichs results in 'browser' when running in a browser.

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

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.

from cordova-plugin-nativestorage.

GillesC avatar GillesC commented on August 10, 2024

Thank you, I was just checking the platformID, now I will check for cordova and phonegap also ;)

from cordova-plugin-nativestorage.

GillesC avatar GillesC commented on August 10, 2024

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 29b4bb6.

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

@GillesC are you able to reproduce the results on browser?

from cordova-plugin-nativestorage.

GillesC avatar GillesC commented on August 10, 2024

Yup I've tested it through the browser platform.

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

Working perfectly. I am closing the issue.

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

commit 29b4bb6.

from cordova-plugin-nativestorage.

GillesC avatar GillesC commented on August 10, 2024

Yeah, I thought waiting for @HbIXA to respond. And if his issue had been resolved, than to close this issue.

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

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.

from cordova-plugin-nativestorage.

HbIXA avatar HbIXA commented on August 10, 2024
  1. rm plugin
  2. add plugin

result : plugin ls
cordova-plugin-nativestorage 1.0.9 "NativeStorage"

version not updated

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

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.

from cordova-plugin-nativestorage.

GillesC avatar GillesC commented on August 10, 2024

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

from cordova-plugin-nativestorage.

HbIXA avatar HbIXA commented on August 10, 2024

good job

from cordova-plugin-nativestorage.

jayj avatar jayj commented on August 10, 2024

Thanks for this. I have an issue where the inBrowser function returns true for me on Android because window.phonegap is undefined.

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

@jayj I understood. But, let me recreate the issue. and I will respond back.

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

@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.

from cordova-plugin-nativestorage.

alokrajiv avatar alokrajiv commented on August 10, 2024

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 3714c9b.
@jayj Please confirm.

from cordova-plugin-nativestorage.

GillesC avatar GillesC commented on August 10, 2024

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

from cordova-plugin-nativestorage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.