fetch Attachment
Trigger an attachment to be downloaded locally to the device and observe its progress as it does so.
When you encounter a document that contains an attachment the attachment will not automatically be downloaded along with the document. You trigger an attachment to be downloaded locally to a device by calling this method. It will report changes to the status of the fetch attempt as it tries to download it. Assuming it succeeds in downloading the attachment it will call the onFetchEvent
block with a completed event object, which will hold a reference to the attachment.
Return
an active DittoAttachmentFetcher, which can be used to cancel the fetching. Otherwise, the fetch will remain active until it either completes, the attachment is deleted, or the owning Ditto object goes out of scope.
Since
4.6.0
Parameters
the DittoAttachmentToken relevant to the attachment that you wish to download and observe.
a lambda expression that will be called when there is an update relating to the attachment fetch attempt.
Trigger an attachment to be downloaded locally to the device and observe its progress as it does so.
When you encounter a document that contains an attachment the attachment will not automatically be downloaded along with the document. You trigger an attachment to be downloaded locally to a device by calling this method. It will report changes to the status of the fetch attempt as it tries to download it. Assuming it succeeds in downloading the attachment it will call the fetchEventHandler
with a completed event object, which will hold a reference to the attachment.
Return
an active DittoAttachmentFetcher, which can be used to cancel the fetching. Otherwise, the fetch will remain active until it either completes, the attachment is deleted, or the owning Ditto object goes out of scope.
Since
4.6.0
Parameters
the DittoAttachmentToken relevant to the attachment that you wish to download and observe.
an object that implements DittoAttachmentFetchEventHandler, whose onFetchEvent
function gets called with a DittoAttachmentFetchEvent object when there is an update relating to the attachment fetch attempt.
Trigger an attachment to be downloaded locally to the device and observe its progress as it does so.
When you encounter a document that contains an attachment the attachment will not automatically be downloaded along with the document. You trigger an attachment to be downloaded locally to a device by calling this method. It will report changes to the status of the fetch attempt as it tries to download it. Assuming it succeeds in downloading the attachment it will call the onFetchEvent
block with a completed event object, which will hold a reference to the attachment.
Return
an active DittoAttachmentFetcher, which can be used to cancel the fetching. Otherwise, the fetch will remain active until it either completes, the attachment is deleted, or the owning Ditto object goes out of scope.
Since
4.6.0
Parameters
a Map representation of DittoAttachmentToken relevant to the attachment that you wish to download and observe.
a lambda expression that will be called when there is an update relating to the attachment fetch attempt.
Trigger an attachment to be downloaded locally to the device and observe its progress as it does so.
When you encounter a document that contains an attachment the attachment will not automatically be downloaded along with the document. You trigger an attachment to be downloaded locally to a device by calling this method. It will report changes to the status of the fetch attempt as it tries to download it. Assuming it succeeds in downloading the attachment it will call the onFetchEvent
block with a completed event object, which will hold a reference to the attachment.
Return
an active DittoAttachmentFetcher, which can be used to cancel the fetching. Otherwise, the fetch will remain active until it either completes, the attachment is deleted, or the owning Ditto object goes out of scope.
Since
4.6.0
Parameters
a Map representation of DittoAttachmentToken relevant to the attachment that you wish to download and observe.
an object that implements DittoAttachmentFetchEventHandler, whose onFetchEvent
function gets called with a DittoAttachmentFetchEvent object when there is an update relating to the attachment fetch attempt.