Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Conversation

@lostintangent
Copy link
Member

This extends/replaces the previous restartImmediately flag by allowing the caller to pass a restartMode to LocalPackage.apply, which adds the ability to restart the app on the next resume, as opposed to simply restarting immediately or not. The default value when a mode isn't specified is still "immediate", but this change gives devs more options, particularly if they want to employ a "silent update" mechanism, which doesn't immediately restart the app, but does on the next app resume.

Moving forward, we could also expose an API to script that allows restarting the app at a custom, app-specific time, that way you apply the update, specifying a restart mode of none, and then force the restart sooner at a point the app can determine is acceptable (e.g. the end-user navigated back to the home page).

This change only impacts the LocalPackage.apply method. We need to determine how to best expose the restartMode via sync, in a way that still respects the isMandatory option of an update and doesn't allow the app to have a weird update experience (e.g. not applying the update immediately is kind of strange when you asked the end-user for permission to install it). We'll address that in a future PR, along with exposing the new progressCallback feature that was added to the RemotePackage.download method.

CodePush.m Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way to const-tize the keys "rollbackTimeout" and "allowRestartOnResume"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I'm const-ify those two and the "hash" key while I'm at it.

@geof90
Copy link
Contributor

geof90 commented Nov 15, 2015

LGTM, it is a great feature to have.

CodePush.m Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessarily

@dtivel
Copy link
Member

dtivel commented Nov 16, 2015

Looks good.

lostintangent added a commit that referenced this pull request Nov 16, 2015
@lostintangent lostintangent merged commit ff891db into master Nov 16, 2015
@lostintangent lostintangent deleted the restartOnResume branch November 16, 2015 20:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

5 participants