Open summraznboi opened 9 years ago
The currently supported method for implementing a custom Storage/Persistence client for the Amazon Mobile Analytics SDK for JavaScript is to override the AMA.Storage object.
Be sure to implement the get
, set
, delete
, each
, and setLogger
functions.
AMA.Storage = { get: AMA.Util.NOP, set: AMA.Util.NOP delete: AMA.Util.NOP each: AMA.Util.NOP setLogger: AMA.Util.NOP };
If you have a Storage Client you would like to contribute, feel free to send us a Pull Request and we will assess pulling it in.
Thanks, Ryan
Currently LocalStorage.js uses a very browser-based storage, but in environments such as Appcelerator, local storage is implemented entirely differently (using thin wrappers to native mobile persistence APIs such as iOS Core Data and Android Shared Preferences). Ideally there can be a way for the user to pass in their own local storage implementation (similar to AMA.Client.Logger in AMA.Client.Options).