DDNotificationContactPhotoPromiseOffer

@interface DDNotificationContactPhotoPromiseOffer

An offer to fulfill a promise representing a commitment to providing a contact icon for a notification.

  • A unique identifier for the photo that will be provided by this promise.

    Declaration

    Objective-C

    @property (nonatomic, readonly, retain) NSString *photoIdentifier
  • A string to replace the notification’s title with, if it is required for your provider’s context. Set to “” to remove the provided notification’s title.

    Declaration

    Objective-C

    @property (nonatomic, retain) NSString *titleOverride
  • A string to replace the notification’s subtitle with, if it is required for your provider’s context. Set to “” to remove the provided notification’s subtitle.

    Declaration

    Objective-C

    @property (nonatomic, retain) NSString *subtitleOverride
  • A string to replace the notification’s body with, if it is required for your provider’s context. Set to “” to remove the provided notification’s body.

    Declaration

    Objective-C

    @property (nonatomic, retain) NSString *bodyOverride
  • Initialize a promise with the provided photo identifier.

    Declaration

    Objective-C

    - (instancetype)initWithPhotoIdentifier:(id)photoIdentifier;
  • Create a promise offer that will return the image at the provided URL, if needed.

    Declaration

    Objective-C

    + (instancetype)offerDownloadingPromiseWithPhotoIdentifier:(id)photoIdentifier
                                                       fromURL:(id)url;
  • Create a promise offer that will return the image at the provided URL, if needed, with custom settings.

    Declaration

    Objective-C

    + (instancetype)
        offerDownloadingPromiseWithPhotoIdentifier:(id)photoIdentifier
                                           fromURL:(id)url
                                      withSettings:
                                          (DDNotificationContactPhotoSettings *)
                                              settings;
  • Create a promise offer that will instantly return the provided image.

    Declaration

    Objective-C

    + (instancetype)offerInstantlyResolvingPromiseWithPhotoIdentifier:
                        (id)photoIdentifier
                                                                image:(id)image;
  • Create a promise offer that will instantly return the provided image with custom settings.

    Declaration

    Objective-C

    + (instancetype)
        offerInstantlyResolvingPromiseWithPhotoIdentifier:(id)photoIdentifier
                                                    image:(id)image
                                             withSettings:
                                                 (DDNotificationContactPhotoSettings
                                                      *)settings;
  • Add the block that will run if your image is needed (as it will not be in some cases, such as if your image is already cached by ShortLook). If your provider does any long-running or asynchronous operations, they should be done using this method. Any code run inside the provider block will be performed on a background thread.

    Declaration

    Objective-C

    - (void)fulfillWithBlock:(void (^)(DDNotificationContactPhotoPromise *))block;