Signup for the Ionic Newsletter to get the latest news and updates!

  • Jorge Cacho

    Thanks for the post!!

    I’m trying to use Ripple in Visual Studio Code but not able to find the way .. Do you have any tutorial showing how to do this? Thanks!

  • k3x

    Thanks for the post.
    Is there a tutorial wich talks about SQLite plugin from ionic-native to use a pre populated database?

    • http://www.raymondcamdencom/ Raymond Camden

      Speaking for myself, not Ionic as a whole, I am planning on writing one, I just can’t say when. I’ve got another one for Ionic Native in the works right now, and my plan was to work on a SQLite demo after it’s done.

      • k3x

        Thanks.
        How to get notified when this article becomes available?
        I’m trying to use a pre populated database with 20K rows and so far no luck the DB exists but doesn’t contain any table even if it has 7 or 8 tables and one of them has almost 20K rows.
        I’ve searched everywhere(mostly on ionic forum and stackoverflow) and people keep saying to populate it at the beginning, and i i’m like “are this guys even serious?”.
        To use a pre populated database we have to use the File from ionic-native and copy the DB from www/ to another folder? If so wich folder?
        Sorry to bother with so many questions but i’ve been trying to get this working for days.

        • http://www.raymondcamdencom/ Raymond Camden

          Well, in this article here, Ionic copied (with my permission!) my blog article from raymondcamden.com. That’s where I’ll be publishing again, so you can check or subscribe there. I assume the Ionic folks may copy that article too (again, with my permission and blessing).

          To your comments about being directed to do the inserts on startup – that’s because WebSQL by itself doesn’t support using a file. Being able to use a pre-installed DB out of the box is something SQLite can make better.

          Anyway – I’m a week or two away from even starting this research, so that’s all I can offer myself now.

          • k3x

            Will be checking your blog for updates.
            Thanks

        • http://www.raymondcamdencom/ Raymond Camden

          So I did a bit of research into this. The folks who made the SQLite plugin made 2 versions. One ‘base’ model and one that supports extra features, like shipping a prepopulated db. To me, this seems a bit silly, but what do I know.

          That being said – Ionic Native wraps the *basic* one, which probably makes sense, but means your use case is *not* supported by Ionic Native. Of course, you can *still* use it in your Ionic 1/2 apps! It just means you don’t get the nice syntax sugar that IN gives you.

          So I still plan on blogging on this, but I won’t be able to show *this* particular feature.

          However…

          Do note that you can write logic to do some of this for you. For example, you can ship an XML file of data, parse it on initial load, and insert data. I’ve done that before for basic WebSQL demos. Whether or not this makes sense depends on your initial data set. You would need to do some testing to see how much of an impact it has on the ‘first run’ experience. And obviously you can just run it in the background while the user does other stuff. And again – whether or not this makes sense depends on your data and your app.

          • k3x

            Thanks for your response.
            My database has the shcedules for metro/train for the entire year.
            Isn’t for situations like this that we have databases? To store data beforehand. Not all apps can be made without previous data, it’s my case.

          • http://www.raymondcamdencom/ Raymond Camden

            “Isn’t for situations like this that we have databases?”
            Sure. So use the other plugin and skip Ionic Native. Or – look at the size of the data. It may be fine to do the Inserts on app startup on the first run.

          • k3x

            Yes i’m looking on the other plugin right now but still facing the issue of the location of the file.
            Thanks for your help.

  • CannyCookie

    `Thats really useful and it works 🙂 Can anyone suggest how to implement subscription.unsubscribe(); when the page is navigated away from and then restarted when the user returns to this page?

    • http://www.raymondcamdencom/ Raymond Camden

      That’s a great question. Let me update the demo with a new blog post. Can’t promise it today, but this week.

    • http://www.raymondcamdencom/ Raymond Camden

      As an FYI, you are 100% correct this is an issue. Working on the update today. Will blog it at raymondcamden.com, share the link here. Ionic may republish it too.