How to Build an Ionic 4 App with Offline Mode

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2024

ความคิดเห็น • 85

  • @SumeetChawla
    @SumeetChawla 5 ปีที่แล้ว +3

    I saw your other tutorial too. You seemed to be really worried about the sun light. It actually gives a very vacation-y tropical feel to the tutorial haha :)

  • @HorizonWave1807
    @HorizonWave1807 4 ปีที่แล้ว +1

    Sir, Can you please create tutorials on RXJS? You are indeed a wonderful teacher.

  • @ashaychavan5651
    @ashaychavan5651 2 ปีที่แล้ว

    Hello Simon,
    I'm working on ionic offline mode app.
    1. Can you please suggest me how to set and get formdata in ionic storage.
    2. After capturing image through camera how should I get that image in multipart format.

  • @selectivemusictracks3372
    @selectivemusictracks3372 3 ปีที่แล้ว

    Thanks mate. I have been digging from quiet a long i have finally found it . thanks and regards.

  • @daniellaerachannel
    @daniellaerachannel 6 ปีที่แล้ว

    Hi Simon! your tutorials are simply great! thanks a lot! Please can you build a tutorial on how to create a cross platform app with ionic/angular, a online store with a nodejs server? thanks a lot

    • @galaxies_dev
      @galaxies_dev  6 ปีที่แล้ว

      Thanks mate :) What exactly would you like to see in interaction with a NodeJS server?

  • @mikeciav
    @mikeciav 6 ปีที่แล้ว +1

    Thank you this is great. Also would love some videos on rjxs as well.

    • @galaxies_dev
      @galaxies_dev  6 ปีที่แล้ว +1

      Hey Mike, what would you like to see about RxJS? It's definitely on my list, just looking for a good use case :)

  • @turomatulic
    @turomatulic 3 ปีที่แล้ว

    sorry, buy network plugin from ionic returns always "unknown" type network, any help??

  • @selectivemusictracks3372
    @selectivemusictracks3372 3 ปีที่แล้ว +1

    you are the guy . God bless you

  • @monodev7398
    @monodev7398 3 ปีที่แล้ว

    Thank you Simon! Great solution, I need some recomendation for any Web ORM like TypeORM. Do you know anything like this?

    • @galaxies_dev
      @galaxies_dev  3 ปีที่แล้ว

      I've heard many good things about Prisma: www.prisma.io/

  • @kjellieboy2
    @kjellieboy2 4 ปีที่แล้ว

    Hi Simon,
    We implemented this in an app which will be used in a warehouse without wifi for stock movements.
    It works great!
    We want to implement the offline mode in another app but this is a bit of a struggle.
    The use case is that the users can create projects and add hour registrations on it.
    Creating a project and adding hour registrations are separate API calls.
    The ids are auto generated by the API.
    Create project: POST /api/projects -> returns auto generated id
    Create hour registration: POST /api/projects/{projectid}/hourregistrations
    If we work offline the API call for creating a project is added to the offline cache, and we don't have any id to start our hour registration.
    Is this a problem you have encountered? What are your thoughts on this?
    If I find a solution, I'll reply to this post.

    • @galaxies_dev
      @galaxies_dev  4 ปีที่แล้ว

      That's really challenging indeed..I'm actually not sure what the best solution might look like.. Somehow creating a connection between the first and second call, so the second API call is only triggered when the first is finished (and waiting for the result). But right now I don't know how the code would look like, it certainly is a challenge. Please let us know when you find a solution!

  • @steala
    @steala 6 ปีที่แล้ว

    Please do a video on rxjs bits please. Great video. Thanks!

  • @sr0409rr
    @sr0409rr 4 ปีที่แล้ว

    Hi Simon, Is that a simulator that you are using to demo your app? Can you please explain how you are testing your app in the video?

    • @galaxies_dev
      @galaxies_dev  4 ปีที่แล้ว

      I either use the iOS simulator or show my real device using the Reflector app!

  • @RossRawlins
    @RossRawlins 6 ปีที่แล้ว

    This is a a great basic set up but for large data I moved over to firestore and it makes life much easier.

    • @galaxies_dev
      @galaxies_dev  6 ปีที่แล้ว

      Glad it was helpful Ross!

  • @PabloGonzalez-ek1vg
    @PabloGonzalez-ek1vg 6 ปีที่แล้ว +2

    Excelent! Great and simple solution. Thanks!

  • @agunity-developer3516
    @agunity-developer3516 4 ปีที่แล้ว

    Whats about race conditions? For example, if you do you "push" and before it is hitting 'finalize', a new element gets added. I wonder if there is also a race condition for storage management. Reading something, altering, and then writing it async. If that happens more often than once at the time it might do something unexpected.

    • @galaxies_dev
      @galaxies_dev  4 ปีที่แล้ว

      If you work correctly with the promises from the storage you usually shouldn't experience any race conditions!

  • @arvinlorenz
    @arvinlorenz 5 ปีที่แล้ว

    Very nice! Is there any update for this using Capacitor?

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว

      I'll do more on Capacitor in the future!

  • @pankajpandey3164
    @pankajpandey3164 4 ปีที่แล้ว

    Can we do with ionic 5 as well or Ionic 5 has more features for storage. Please give your suggestion.

    • @galaxies_dev
      @galaxies_dev  4 ปีที่แล้ว

      Yes this should work fine with v5 as well. There are no changes to the storage.

  • @carithocrack1
    @carithocrack1 5 ปีที่แล้ว +1

    You are wonderful, saved my life !!!
    amazing video ♥

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว

      Thanks Carolina, you are welcome :)

  • @ramitadembani8604
    @ramitadembani8604 5 ปีที่แล้ว

    Simon, I'm curious to know what commands should I use if my app type is "ionic-angular" and not angular

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว

      Hmm I'm not sure, this should be exactly the same?!

  • @muhammadayoub4228
    @muhammadayoub4228 5 ปีที่แล้ว +2

    The import import { IonicStorageModule } from '@ionic/storage/ngx'; is incorrect.
    it should be imported as:
    import { IonicStorageModule } from '@ionic/storage';

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว

      When did I mess this up? You are of course right!

  • @Javed.humayun
    @Javed.humayun 4 ปีที่แล้ว

    Hi great tutorial. But i have a use case for play video offline how to achieve this?

    • @galaxies_dev
      @galaxies_dev  4 ปีที่แล้ว

      Well you could download files upfront and then play them from the local file!

  • @klejz0rPC
    @klejz0rPC 5 ปีที่แล้ว

    Hi @Simon Grimm. I've got this issue in console log : NetworkService]:
    StaticInjectorError(Platform: core)[MyApp -> NetworkService]:

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว

      I think you have not added th provider to your app module then.

  • @HorizonWave1807
    @HorizonWave1807 4 ปีที่แล้ว

    if we cache data in localStorage, will OS not clear data automatically without letting us know when the storage is full?

    • @galaxies_dev
      @galaxies_dev  4 ปีที่แล้ว

      Yeah there is a storage limitation, so if you want to be safe, install the SQLite plugin which will then internally be used by Ionic Storage!

  • @cebecoii2018
    @cebecoii2018 5 ปีที่แล้ว

    hi @Simon Grimm, Thank you for your great tutorial videos.. Can i ask a favor, Ive been trying to make an ionic project and i want to publish as desktop app for windows...Will you make some tutorial please.. I cant find any tutorial for this kind ... I greatly appreciate if you consider.. Thank You and Good Day..

  • @codingroom2876
    @codingroom2876 5 ปีที่แล้ว

    how to make a app like youtube offiline download feature using ionic? please please help me.....

  • @amitshaiwale
    @amitshaiwale 3 ปีที่แล้ว

    This is a 2 year old tutorial, is this still valid to use in 2021 considering there has been many updates made to capacitor, ionic and angular !

    • @sertrwanda
      @sertrwanda 3 ปีที่แล้ว

      same question

  • @utpaulsarkar9694
    @utpaulsarkar9694 6 ปีที่แล้ว

    its great please create tutorial for rxjs asap.

    • @galaxies_dev
      @galaxies_dev  6 ปีที่แล้ว

      Yeah I guess I'll have to give some more information about it after all the operators used in this one and the comments below the video x)

  • @francopioletti7043
    @francopioletti7043 5 ปีที่แล้ว

    Please do make a video about the rxjs operators

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว

      Yeah, it's on the list. Noticed the heavy usage only later after creating some tutorials.. I hear you!

  • @j-Dor
    @j-Dor 5 ปีที่แล้ว

    can i know after offline where those datas are storing in my device

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว

      The are inside the SQLite database of your app (if you added the according Cordova plugin), otherwise they will be inside the localstorage of the browser of the app.

  • @manabroy3036
    @manabroy3036 5 ปีที่แล้ว +1

    wow!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! nice thanks

  • @ebrahimmithaiwala9639
    @ebrahimmithaiwala9639 4 ปีที่แล้ว

    Hello can you please make a video on how to make an ionic 1 app run on offline mode.

    • @galaxies_dev
      @galaxies_dev  4 ปีที่แล้ว

      Sorry but I don't work with Ionic 1 anymore.

  • @graham859
    @graham859 5 ปีที่แล้ว

    Do you know where I can find an Ionic4 Vue version of this?

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว

      No sorry, I don't have any Vue material!

  • @pratikvaity6833
    @pratikvaity6833 5 ปีที่แล้ว

    Can we Apply this concept on videos?

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว +1

      I'm not sure what you mean, but as it's just a general concept I'm sure you could apply it!

    • @simbaclaws_youtube
      @simbaclaws_youtube 4 ปีที่แล้ว +1

      I think this person wants to know whether sqlite supports storing data blobs.
      I think it might be better to do file storage on the device in this case.

  • @wagimalick5046
    @wagimalick5046 5 ปีที่แล้ว +1

    great stuff

  • @simocennetten5239
    @simocennetten5239 6 ปีที่แล้ว

    thank you so much

  • @kagwad_in
    @kagwad_in 6 ปีที่แล้ว

    Sir please start with some basic projects like MakeMyTrip kind of apps .

    • @galaxies_dev
      @galaxies_dev  6 ปีที่แล้ว

      I don't know about makemytrip, what is it like? And yes I'm currently planning to do more project style videos in the near future, so any idea for an app would be great!

  • @muhammadayoub4228
    @muhammadayoub4228 5 ปีที่แล้ว

    How to call getCurrentNetworkStatus in a component to get Network status
    I tried getCurrentNetworkStatus() this but it does not work.

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว

      Make sure you are calling it only when the platform is ready!

    • @muhammadayoub4228
      @muhammadayoub4228 5 ปีที่แล้ว

      @@galaxies_dev i don't know how to call this event. Please explain i can call this on click of button fro other component.

  • @sauravverma1138
    @sauravverma1138 5 ปีที่แล้ว

    Don't go directly to some point, you need to go stepwise, it might be easier for those who have not even tried ionic before, so you need to make them a just quick aware with the process and then move to the exact codebase. Thank you

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว

      Sorry Saurav, will try to keep things easy and straight next time!

  • @simbaclaws_youtube
    @simbaclaws_youtube 4 ปีที่แล้ว

    Why not always show the local data if it exists and make an additional request to the server when you are online to update the local data? A offline first approach is faster for your app. Since network is slower then disk read. This way information is shown earlier and gets updated accordingly when need be. This would also help in cases where network speed is slow. Having a white screen while you wait with something like a spinner is bad when you can already display previous data. Displaying both a spinner and previous data would be even better.
    If you really want to be fancy and fast, you can poll the server api for recent changes and only fetch back the latest differences by storing for example a date of retrieval. You can use triggers in mysql databases to store a new date in your database when information in a table changes. This will make the json response smaller and would optimize bandwidth. You would simply fetch the changes between dates.
    Then there is the idea of shipping a local "seed" database with your app so that when a user first opens your app and is offline while doing so, would still get to see a somewhat recent representation of data. Sort of like a snapshot.
    Also, service workers can help do caching of requests and offline storage too. I would like to see some coverage on that somewhere, so far I haven't found much information ionic wise on how to do this with service workers.
    Some positive feedback from me.
    I love your tutorials by the way.
    I hope you'll consider some of my ideas.

    • @galaxies_dev
      @galaxies_dev  4 ปีที่แล้ว

      Thanks for your input Hylke! In fact this is a decision every app/company needs to make: Display data faster, or always display the most up to date version?
      Sometimes the second is a business requirement. In other cases, I agree that it would be better to display the data fast. But it really depends from app to app!

    • @simbaclaws_youtube
      @simbaclaws_youtube 4 ปีที่แล้ว

      @@galaxies_dev you can still display the most up to date version after displaying the local version first. The difference is that you have something to look at while fetching updates instead of a white screen. But then again you could be displaying information that has been deleted and those will then be removed when the information is updated. That's the only downside I see.

  • @thatchipmunksings
    @thatchipmunksings 5 ปีที่แล้ว

    vielen Dank!

  • @stammerwithsid
    @stammerwithsid 4 ปีที่แล้ว

    Where we called CheckforEvents??????

  • @filemonek123
    @filemonek123 5 ปีที่แล้ว

    why the beta network plugin ?

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว

      Because we are using the Ionic 4 beta and need to use Ionic Native 5 which is only available as beta.

  • @sarath9077
    @sarath9077 5 ปีที่แล้ว +1

    Hi Simon., Thank you for the wonderful video.
    I would like to add that for 'rxjs' version more than 5, the type should be given after "this.http.get"
    this.http.get(`${this.apiBaseUrl}/${url}&apiKey=${this.apiKey}`)....
    This is one error I personally faced and fixed.

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว +1

      Thanks a lot for adding the solution here Sarath :)

  • @santhoshsandy3085
    @santhoshsandy3085 5 ปีที่แล้ว +1

    Create RXJS operators tutorial :)

    • @galaxies_dev
      @galaxies_dev  5 ปีที่แล้ว +2

      Wow didn't know so many people would ask for it, but yes I'll do :)

  • @aaronaaronaaron5922
    @aaronaaronaaron5922 5 ปีที่แล้ว +1

    Wow, man! you really help me! Thanks!!!!

  • @saajanbajaj641
    @saajanbajaj641 4 ปีที่แล้ว

    what happens when you are connected to WIFI but WIFI has no data?

    • @galaxies_dev
      @galaxies_dev  4 ปีที่แล้ว

      Yeah that's indeed a problem. Best thing is to make a test HTTP call to some page like google or something on your server like a "ping" to check if you really got an internet connection!

  • @ameerattaa2250
    @ameerattaa2250 6 ปีที่แล้ว

    its great to make short videos bro

  • @koukiadem
    @koukiadem 6 ปีที่แล้ว

    Please.. for the love of god.. use dark theme....
    Thanks

    • @galaxies_dev
      @galaxies_dev  6 ปีที่แล้ว +3

      Hey Adem, why? I've actually heard from many that reading on a light background is a lot easier! But of course people like it different, I also had a dark them for a long time..perhaps I'll make a poll about it x)

    • @iamloonix
      @iamloonix 5 ปีที่แล้ว

      Dark theme please! :)