[watchOS] handleBackgroundTasks

https://developer.apple.com/documentation/watchkit/wkextensiondelegate/1650877-handlebackgroundtasks

https://developer.apple.com/documentation/watchkit/wksnapshotrefreshbackgroundtask?language=objc

watchOSのhandleBackgroundTasks で WKSnapshotRefreshBackgroundTask を拾って setTaskCompletedWithDefaultStateRestored しないと watchOSアプリが落ちることがわかった。

https://developer.apple.com/documentation/watchkit/wksnapshotrefreshbackgroundtask/1650844-settaskcompletedwithdefaultstate?language=objc

If you do not call setTaskCompletedWithDefaultStateRestored:estimatedSnapshotExpiration:userInfo: on the task, the system uses all available time, wasting battery power. The system then suspends the extension as soon as the allotted time has expired.

とあるので、落ちるとは書かれていないが、suspend されることで落ちてしまうのだろうか。

返信を残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

This site uses Akismet to reduce spam. Learn how your comment data is processed.