Storage fallback

0 favourites
  • 5 posts
From the Asset Store
Basic Plugins for Firebase Authentication, Realtime-Database, Firestore, Cloud Storage
  • Hi there,

    I'm currently working on an addon that uses, among other things, loading and saving functions from an external SDK.

    The problem is that loading and saving doesn't work in the preview (correct behavior), but only in the corresponding environment. All good!

    BUT: I would therefore like to use a fallback storage in this case. Unfortunately, the usual suspects are all null.

    Even including an external library (hello localForage) doesn't help, because the drivers that are actually supported don't work either and supports() returns false for them.

    What other fallback options do I have?

    Thanks :)

  • Other storage APIs like IndexedDB should work fine in preview - in fact that's what Construct's own storage does. It doesn't do anything to prevent other code using them. So they should be working fine. Perhaps you made some other mistake.

    You could also use IStorage to access the runtime's own storage system, backed by localforage.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley Yes, I thought so too, but nope:

    The tip with IStorage sounds good. I'll try it out. Many thanks!

    Could you tell me how to access it in domSide.js? That would be great :)

    iRuntime is avaiable. Could i use it for it?

  • Ashley Uhhh. I found out that my addon causes the localStorage to be null. How is that possible? Any ideas?

    I'm using Developer Mode -> Add dev addon. Could this cause it?

  • That shouldn't happen. Perhaps your addon is including a library that overwrites it? Or some accidental code that assigns over it?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)