ProgressMode

The desired behavior of a progress notification block.

Progress notification blocks can be registered on sessions if your app wishes to be informed how many bytes have been uploaded or downloaded, for example to show progress indicator UIs.

  • The block will be called forever, or until it is unregistered by calling ProgressNotificationToken.invalidate().

    Notifications will always report the latest number of transferred bytes, and the most up-to-date number of total transferrable bytes.

  • The block will, upon registration, store the total number of bytes to be transferred. When invoked, it will always report the most up-to-date number of transferrable bytes out of that original number of transferrable bytes.

    When the number of transferred bytes reaches or exceeds the number of transferrable bytes, the block will be unregistered.