You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, updates are not automatically downloaded.
208
220
221
+
By default starting from Sparkle 2.4, users are provided an option to opt in to automatically downloading and installing updates when they are asked if they want automatic update checks enabled.
222
+
The default value for this option is based on what the developer sets `SUAutomaticallyUpdate` in their Info.plist.
223
+
This is not done if `SUEnableAutomaticChecks` is set in the Info.plist however. Please check `automaticallyChecksForUpdates` property for more details.
224
+
209
225
Note that the developer can disallow automatic downloading of updates from being enabled (via `SUAllowsAutomaticUpdates` Info.plist key).
210
226
In this case, this property will return NO regardless of how this property is set.
211
227
212
-
Prefer to set SUAutomaticallyUpdate directly in your Info.plist for setting the initial value.
228
+
Prefer to set `SUAutomaticallyUpdate` directly in your Info.plist for setting the initial value.
213
229
214
230
Setting this property will persist in the host bundle's user defaults.
215
231
Hence developers shouldn't maintain an additional user default for this property.
The URL of the appcast used to download update information.
223
239
224
240
If the updater's delegate implements `-[SPUUpdaterDelegate feedURLStringForUpdater:]`, this will return that feed URL.
225
-
Otherwise if the feed URL has been set before, the feed URL returned will be retrieved from the host bundle's user defaults.
241
+
Otherwise if the feed URL has been set before using `-[SPUUpdater setFeedURL:]`, the feed URL returned will be retrieved from the host bundle's user defaults.
226
242
Otherwise the feed URL in the host bundle's Info.plist will be returned.
227
243
If no feed URL can be retrieved, returns nil.
228
244
229
245
For setting a primary feed URL, please set the `SUFeedURL` property in your Info.plist.
230
-
For setting an alternative feed URL, please prefer `-[SPUUpdaterDelegate feedURLStringForUpdater:]` over `-setFeedURL:`
246
+
For setting an alternative feed URL, please prefer `-[SPUUpdaterDelegate feedURLStringForUpdater:]` over `-setFeedURL:`.
247
+
Please see the documentation for `-setFeedURL:` for migrating away from that API.
231
248
232
249
This property must be called on the main thread; calls from background threads will return nil.
Set the URL of the appcast used to download update information. Using this method is discouraged.
254
+
Set the URL of the appcast used to download update information. This method is deprecated.
238
255
239
256
Setting this property will persist in the host bundle's user defaults.
240
-
To avoid this, you should consider implementing
257
+
To avoid this undesirable behavior, please consider implementing
241
258
`-[SPUUpdaterDelegate feedURLStringForUpdater:]` instead of using this method.
242
259
243
-
Passing nil will remove any feed URL that has been set in the host bundle's user defaults.
260
+
Calling `-clearFeedURLFromUserDefaults` will remove any feed URL that has been set in the host bundle's user defaults.
261
+
Passing nil to this method can also do this, but using `-clearFeedURLFromUserDefaults` is preferred.
262
+
To migrate away from using this API, you must clear and remove any feed URLs set in the user defaults through this API.
263
+
244
264
If you do not need to alternate between multiple feeds, set the SUFeedURL in your Info.plist instead of invoking this method.
245
265
246
266
For beta updates, you may consider migrating to `-[SPUUpdaterDelegate allowedChannelsForUpdater:]` in the future.
247
267
268
+
Updaters that update other developer's bundles should not call this method.
269
+
248
270
This method must be called on the main thread; calls from background threads will have no effect.
249
271
*/
250
-
- (void)setFeedURL:(nullable NSURL *)feedURL;
272
+
- (void)setFeedURL:(nullable NSURL *)feedURL __deprecated_msg("Please call -[SPUUpdater clearFeedURLFromUserDefaults] to migrate away from using this API and transition to either specifying the feed URL in your Info.plist, using channels in Sparkle 2, or using -[SPUUpdaterDelegate feedURLStringForUpdater:] to specify the dynamic feed URL at runtime");
273
+
274
+
/**
275
+
Clears any feed URL from the host bundle's user defaults that was set via `-setFeedURL:`
276
+
277
+
You should call this method if you have used `-setFeedURL:` in the past and want to stop using that API.
278
+
Otherwise for compatibility Sparkle will prefer to use the feed URL that was set in the user defaults over the one that was specified in the host bundle's Info.plist,
279
+
which is often undesirable (except for testing purposes).
280
+
281
+
If a feed URL is found stored in the host bundle's user defaults (from calling `-setFeedURL:`) before it gets cleared,
282
+
then that previously set URL is returned from this method.
283
+
284
+
This method should be called as soon as possible, after your application finished launching or right after the updater has been started
285
+
if you manually manage starting the updater.
286
+
287
+
Updaters that update other developer's bundles should not call this method.
288
+
289
+
This method must be called on the main thread.
290
+
291
+
@return A previously set feed URL in the host bundle's user defaults, if available, otherwise this returns `nil`
Appropriately schedules or cancels the update checking timer according to the settings for the time interval and automatic checks.
296
-
297
-
If you change the `updateCheckInterval` or `automaticallyChecksForUpdates` properties, the update cycle will be reset automatically after a short delay.
298
-
The update cycle is also started automatically after the updater is started. In all these cases, this method should not be called directly.
338
+
Appropriately re-schedules the update checking timer according to the current updater settings.
339
+
340
+
This method should only be called in response to a user changing updater settings. This method may trigger a new update check to occur in the background if an updater setting such as the updater's feed or allowed channels has changed.
341
+
342
+
If the `updateCheckInterval` or `automaticallyChecksForUpdates` properties are changed, this method is automatically invoked after a short delay using `-resetUpdateCycleAfterShortDelay`. In these cases, manually resetting the update cycle is not necessary.
299
343
300
-
This call does not change the date of the next check, but only the internal timer.
344
+
See also `-resetUpdateCycleAfterShortDelay` which gives the user a short delay before triggering a cycle reset.
301
345
*/
302
346
- (void)resetUpdateCycle;
303
347
348
+
/**
349
+
Appropriately re-schedules the update checking timer according to the current updater settings after a short cancellable delay.
350
+
351
+
This method calls `resetUpdateCycle` after a short delay to give the user a short amount of time to cancel changing an updater setting.
352
+
If this method is called again, any previous reset request that is still inflight will be cancelled.
353
+
354
+
For example, if the user changes the `automaticallyChecksForUpdates` setting to `YES`, but quickly undoes their change then
355
+
no cycle reset will be done.
356
+
357
+
If the `updateCheckInterval` or `automaticallyChecksForUpdates` properties are changed, this method is automatically invoked. In these cases, manually resetting the update cycle is not necessary.
358
+
*/
359
+
- (void)resetUpdateCycleAfterShortDelay;
304
360
305
361
/**
306
362
The system profile information that is sent when checking for updates.
0 commit comments