diff --git a/Docs/AutoUpdate.md b/Docs/AutoUpdate.md new file mode 100644 index 0000000..207b52f --- /dev/null +++ b/Docs/AutoUpdate.md @@ -0,0 +1,41 @@ +# Auto Update + +## AppCast.xml + +To enable auto update, you need to prepare an **AppCast.xml**([sample](https://github.com/HackPlan/menubar-webkit/blob/updater/updater/SampleAppcast.xml)) like this: + +```xml + + + + [App Name] + [AppCast.xml Link] + Most recent changes with links to updates. + en + + Version [x.yz] + [Link to Release Notes] + [Release Date] + + [Minimum System Version] + + + +``` + +## Code Signing + +For safety reasons, you have to code sign your app properly to enable auto update. + +## Check for Update + +We provide two APIs for checking update, both require an URL to AppCast.xml: + +```js +mw.checkUpdate("https://rawgit.com/HackPlan/menubar-webkit/updater/updater/SampleAppcast.xml") +mw.checkUpdateInBackground("https://rawgit.com/HackPlan/menubar-webkit/updater/updater/SampleAppcast.xml") +``` + +## Under the Hood + +Menubar WebKit uses [Sparkle](https://github.com/sparkle-project/Sparkle) as update engine, refer to the documentation for Sparkle for more detail. diff --git a/Podfile b/Podfile index 47a73db..93d5b4e 100644 --- a/Podfile +++ b/Podfile @@ -2,4 +2,4 @@ platform :osx, '10.9' pod 'MASShortcut', :git => 'git@github.com:xhacker/MASShortcut.git', :branch => 'menubar-webkit' pod 'RHPreferences', :head -pod 'Sparkle', :git => 'git@github.com:xhacker/Sparkle.git', :branch => 'podspec', :podspec => 'https://raw.githubusercontent.com/xhacker/Sparkle/podspec/Sparkle.podspec' +pod 'Sparkle', '~> 1.7.1' diff --git a/Podfile.lock b/Podfile.lock index 2c74871..a63ba6f 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -6,20 +6,16 @@ PODS: DEPENDENCIES: - MASShortcut (from `git@github.com:xhacker/MASShortcut.git`, branch `menubar-webkit`) - RHPreferences (HEAD) - - Sparkle (from `git@github.com:xhacker/Sparkle.git`, branch `podspec`) + - Sparkle (~> 1.7.1) EXTERNAL SOURCES: MASShortcut: :branch: menubar-webkit :git: git@github.com:xhacker/MASShortcut.git - Sparkle: - :branch: podspec - :git: git@github.com:xhacker/Sparkle.git - :podspec: https://raw.githubusercontent.com/xhacker/Sparkle/podspec/Sparkle.podspec SPEC CHECKSUMS: MASShortcut: a1e29fd34567fcd249d00648548924c8e7639474 RHPreferences: d0215102b7b8cd9f501655e5e7db2551ef4dc0e5 - Sparkle: efbd7f0f72767ce302b01deaf888b7afeb14febd + Sparkle: fde5ffeb7bf01db28925499ce2a75977763af58a COCOAPODS: 0.33.1 diff --git a/README.md b/README.md index 4eea42f..5c44040 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,16 @@ mw.pin() mw.unpin() ``` +### Auto Update + +```js +// Check for update +mw.checkUpdate("https://rawgit.com/HackPlan/menubar-webkit/updater/updater/SampleAppcast.xml") +mw.checkUpdateInBackground("https://rawgit.com/HackPlan/menubar-webkit/updater/updater/SampleAppcast.xml") +``` + +More detail: [AutoUpdate.md](Docs/AutoUpdate.md) + ## Integrating Web App ``public/index.html`` is the portal of your menubar app. ``public/preferences/[identifier].html`` are the preference pages (for example, ``public/preferences/general.html``). @@ -101,6 +111,7 @@ Used third-party libraries: * [MASShortcut](https://github.com/shpakovski/MASShortcut) by [@shpakovski](https://github.com/shpakovski) * [RHPreferences](https://github.com/heardrwt/RHPreferences) by [@heardrwt](https://github.com/heardrwt) +* [Sparkle](https://github.com/sparkle-project/Sparkle) by [contributors](https://github.com/sparkle-project/Sparkle/graphs/contributors) ## Contribution