indexeddbshim / IndexedDBShim

A polyfill for IndexedDB using WebSql
Other
968 stars 191 forks source link

IndexedDB not working on IOS devices #220

Closed saroj990 closed 7 years ago

saroj990 commented 9 years ago

Hi All, I am using indexedDB(angular indexedDB) in my application .it is running fine everywhere except IOS devices .I am using indexedDBShim.js for IOS which should use the WebSql if indexedDB is not supported.But i am getting errors. Can anybody help me to get out of the problem?

DickvdBrink commented 9 years ago

Can you explain what errors you are having?

ndevtag commented 9 years ago

Have the same Problem on IOS, using shim with the jQuery Plugin. Getting an "AbortError", when try to use the put function on objectstore is created on the fly, when not exists:

var putPromise = db.objectStore(segmentname, true).put(JSON.stringify(jsonObject), key);

This calls the fail handler giving an "AbortError".

OS: IOS 9 TestCases indexeddb.shim.js runs successfull TestCases jquery.indexeddb.js some Someone any idea?

img_0594 1

img_0592 1

img_0593 1

saroj990 commented 9 years ago

I left using indexedDB for IOS devices its buggy in behavior . finally i used WebSQL for IOS and IndexedDB implementation for other devices.

ndevtag commented 9 years ago

The shim uses WebSQL for indexedDB implementation. Unfortunately i have not the choice to left it. I have to get working this shim in IOS.

JamesMessinger commented 9 years ago

Try running these tests instead. It'll help us pin-down exactly what errors you're seeing

saroj990 commented 9 years ago

I have tested this on IPad but still no luck. it breaks i means stop somewhere in between and doesn't go further.

saroj990 commented 9 years ago

Does this shim work for you , just curious to know

DickvdBrink commented 9 years ago

Hmz,, failing for me on iOS 7.1 on the IDBFactory.deleteDatabase Test

should return an IDBOpenDBRequest undefined is not an object (evaluating 'db.close') (deleteDatabase-spec.js)

I'm currently unable to debug this but it looks like there is something wrong..

ndevtag commented 9 years ago

The shim do not work for me, but i have to get it work.

JamesMessinger commented 9 years ago

I don't have iOS 7.1 to test on, but I've tested on iOS 8 and iOS 9, and all of the tests pass, including the deleteDatabase tests.

@saroj990 and @ntagdev - It would be helpful if you could post some sample code that reproduces the error. Also, please make sure you read the known issues on iOS and use one of the two workarounds listed there.

ndevtag commented 9 years ago

Ok, i've found the problem. The app did not use the shim in ios Safari, because window,indexedDb ist defined.

saroj990 commented 9 years ago

I don't know i may be wrong but i have tried this and got no luck.I wish i am wrong and it works for you.

brettz9 commented 8 years ago

@ntagdev or @saroj990 : have you manually called shimIndexedDB.__useShim(); in your code?

brettz9 commented 8 years ago

There appears to be a problem with iOS9 and IndexedDB for non-Safari browsers. Our new code (discussed in #252) forces iOS9 non-Safari browsers to use the shim despite them supposedly having IndexedDB support.

Until our next release, you can change your project's bower dependency line for "IndexedDBShim" to https://github.com/axemclion/IndexedDBShim#ios9 and run bower install in your project directory.

Closing for now but feel free to comment further or reopen if your issue is not resolved.

brettz9 commented 8 years ago

Apologies, it seems like there is nevertheless an issue with Safari too on iOS9?

corse-xx commented 8 years ago

is there a full fix for this at all or even at ETA? I have currently reverted all the way back to v0.1.2 from 2014-09-22 and its working in that...but there have obvs been a few improvements since then :p

brettz9 commented 8 years ago

Sorry, no ETA. PRs welcome.

corse-xx commented 8 years ago

doh, ok i will go back through the versions to see where it got broken (sorry id take a look at fixing it permanently but am mid project!) and post here if i see anything obvious.

corse-xx commented 8 years ago

ok i'm not sure what i missed but under phonegap serve i can have this working and not working easily...

  1. downloaded the 2.2.1 repo and copied indexeddbshim.min.js into my app - Work FINE in ios9
  2. downloaded the master repo and copied indexeddbshim.min.js into my app - broken immediately

The file size differences in the min files are immense (46kb to 230kb), did i miss something here?

brettz9 commented 8 years ago

If you are looking for the latest working version for ios9, it'd be fine to go back and see where it got broken, but if you are willing to debug and get all of the benefits of the many bug fixes, I would just start with the latest in master and see where we can fix it for ios9.

As far as master being broken for ios9, yes, that is known. I would just try digging around in the code and checking console and see what turns up.

As far as file size, the new code is being transformed by babel. Looking at the non-minified code, a large amount of that code is taken up by babel-polyfill which I have imported to allow us to use some other ES6 convenience features. If the import statement in setGlobalVars.js is removed, the grunt processes might avoid including that polyfill file, but you will need to provide polyfills for the likes of Object.assign to avoid the current code breaking.

brettz9 commented 7 years ago

In https://github.com/axemclion/IndexedDBShim/issues/252#issuecomment-228707973 , there were reports that things were working in iOS9 (though there have been further changes since then).

Welcome to try the 3.0.0-rc.3 version out for a spin. Closing as this should be fixed. Feel free to reopen if you find anything to the contrary.

brettz9 commented 6 years ago

For questions about IndexedDB itself, ask somewhere like StackOverflow (or for the plugin, contact the plugin owner). This is for reporting issues with IndexedDBShim, a library to let you use IndexedDB on some older browsers (though most recent changes have been oriented toward Node support rather than all older browsers).

axemclion commented 6 years ago

I request that we acknowledge the good work that @brettz9 is doing with maintaining the project.

DickvdBrink commented 6 years ago

Agreed, Good job @brettz9 and thanks for all the hard work!

JamesMessinger commented 6 years ago

Hear! Hear! Maintaining an open source project can seem like thankless work sometimes, but we appreciate all you do, @brettz9. Keep it up

brettz9 commented 6 years ago

Thanks a lot, fellas! Thanks for all your good work and reports as well as kind encouragement...

Btw, I expect all of the past contributors to the project ought to enjoy hearing from other folks here who are using the software about how they are putting it to use (and whether you're using 3.*)...

Or if it is for private purposes, just the fact that you're using it...