aws / aws-sdk-mobile-analytics-js

Amazon Mobile Analytics JavaScript SDK
Apache License 2.0
82 stars 38 forks source link

Safari unable to use in private mode #10

Closed neviaumi closed 8 years ago

neviaumi commented 8 years ago

While safari running on private mode window.localStorage will be available (not null/undefined ) but setItem will throw exception . It will make data loss while user this library to tracking .

Currently my solution is create custom in-memory storage to replace default storage while below condition is fulfilled :

testStorageAvailable=()-> storage = window.localStorage if storage? try storage.setItem("Storage Available", "true") return true catch e return false else return false

cheruvian commented 8 years ago

This should be resolved in v0.9.1