GithubHelp home page GithubHelp logo

Install UX about capacitor-updater HOT 17 CLOSED

alexcroox avatar alexcroox commented on May 10, 2024 2
Install UX

from capacitor-updater.

Comments (17)

Torone avatar Torone commented on May 10, 2024 2

Thanks for your answers. I managed to create my own logic using my API. It is working fine.

from capacitor-updater.

riderx avatar riderx commented on May 10, 2024 1

Hey @alexcroox i have update the doc to make example

  import { CapacitorUpdater } from 'capacitor-updater'
  import { SplashScreen } from '@capacitor/splash-screen'
  import { App } from '@capacitor/app'

  // Do the update when user leave app
  App.addListener('appStateChange', async(state) => {
      if (!state.isActive) {
        SplashScreen.show()
        const version = await CapacitorUpdater.download({
        url: 'https://github.com/Forgr-ee/Mimesis/releases/download/0.0.1/dist.zip',
        })
        await CapacitorUpdater.set(version)
        SplashScreen.hide() // in case the set fail, otherwise the new app will have to hide it
      }
  })

So when you hide the app it start the download and set the new version.

In my own app I have chosen to check for new version and download at the start.
Then set new version as active when state.isActive === false to don't disturb the user.

from capacitor-updater.

riderx avatar riderx commented on May 10, 2024 1

@alexcroox i was wandering if you have any clue about how the current plugin are doing the revert, I don't find a way to revert from installed version to original version

from capacitor-updater.

riderx avatar riderx commented on May 10, 2024 1

@alexcroox i found the way to get back the original version yesterday night, Thanks !
I will have a look for the auto revert system soon.

from capacitor-updater.

riderx avatar riderx commented on May 10, 2024 1

Yes, @Torone, it works like @MarkChrisLevy said.

But many users asked like you, better solution.

So i'm working in simple solution with auto-pull version.
You will have 2 options:

  • Our API will be paid feature, to upload and store the version for you.
  • Implement your own API, it will need to respond { "version": "1.0.0", "url": "https://your_zip_file_in _your_server"}

I plan to make the same pricing of old Expo.dev 29 euro by month.

And of course you can continue to pull version manually like before

from capacitor-updater.

riderx avatar riderx commented on May 10, 2024

Hey thanks for the feedback, my idea is to make the plugin as dumb as possible and let dev do they one logic .
So probably with the event. I’m still struggling on the update now but when I will have a functional tool I will start on events

from capacitor-updater.

alexcroox avatar alexcroox commented on May 10, 2024

I’m not sure of that specific implementation but wouldn’t it just be a case of copying the current install over to a “previous-version” folder, downloading the new version into a new folder, then telling Capacitor to launch from that new folder. Then when you re-launch call a “setInstallSuccessful” function or similar within x seconds of launch. If it’s not called by JS then you know it must be a broken build and can repeat the above but use the previous version folder as the new startup target to revert back.

from capacitor-updater.

Torone avatar Torone commented on May 10, 2024

Hi @riderx thanks for this plugin.
I have some questions...

You wrote: "In my own app I have chosen to check for new version and download at the start.
Then set new version as active when state.isActive === false to don't disturb the user."

How can you check for new versions? I'm missing a few parts probably...

What I would like to do is to get the updates when the user open the App only if there is something to update. But I'm struggling to understand how...

Can you please add a few more code example that can cover different scenarios? Thanks again!

from capacitor-updater.

MarkChrisLevy avatar MarkChrisLevy commented on May 10, 2024

@Torone You have to implement server side on your own, the plugin just "unpacks" and "load" new version. But imho that it is exactly how it should work, cause you will not depend on any specific backend vendor.

from capacitor-updater.

riderx avatar riderx commented on May 10, 2024

@Torone i have add the auto-update system and auto revert if it fail.

it's free for now !
You can setup your own server URL too

Check the doc : https://doc.capgo.app/Auto-update-2cf9edda70484d7fa57111ab9c435d08

from capacitor-updater.

riderx avatar riderx commented on May 10, 2024

@alexcroox with the auto-update system do you still need the event ?
I was thinking maybe a method to "pause" the auto update could be enought

from capacitor-updater.

lincolnthree avatar lincolnthree commented on May 10, 2024

@riderx I think events are still important so the app can make decisions at runtime. Or display progress.

from capacitor-updater.

riderx avatar riderx commented on May 10, 2024

@lincolnthree in auto update you manage nothing, and in manual you already have promise, who give your result when things are done.
I need a bit more of the context to see where it can be useful.
Also, we can't show to Apple user stuff about auto update, otherwise your app can be kick out :/

from capacitor-updater.

riderx avatar riderx commented on May 10, 2024

i have added some features hope this make it feature complete for your usecase:
https://github.com/Cap-go/capacitor-updater#listen-to-download-events
To check download events, works for manual and auto update
In auto update, i have added :
https://github.com/Cap-go/capacitor-updater#delayupdate
https://github.com/Cap-go/capacitor-updater#canceldelay
To delay update or cancel the delay.
I have also refactored the code a bit and remove Just module in favour of Alamofire, who is more maintained

from capacitor-updater.

riderx avatar riderx commented on May 10, 2024

@alexcroox do the latest change full fit your needs?

from capacitor-updater.

alexcroox avatar alexcroox commented on May 10, 2024

yes I think a/b/c could probably be covered by the new events and methods thanks

from capacitor-updater.

riderx avatar riderx commented on May 10, 2024

❤️

from capacitor-updater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.