DefaultRichPushHandler

open class DefaultRichPushHandler : RichPushHandler

RichPushHandler with default implementations

  • Undocumented

    Declaration

    Swift

    public init()
  • Handles RichPushAction.likePost

    The default implementation of this method is calling NewsFeedAPI.likePost(id:).

    Declaration

    Swift

    open func handleLikePost(userInfo: [String : Any], completionHandler: @escaping () -> Void)

    Parameters

    userInfo

    The whole push notification payload

  • Handles RichPushAction.commentPost

    The default implementation of this method is calling NewsFeedAPI.addNewComment(body:, postId:).

    Declaration

    Swift

    open func handleCommentPost(userInfo: [String : Any], text: String, completionHandler: @escaping () -> Void)

    Parameters

    userInfo

    The whole push notification payload

    text

    Text that the user inputted

  • Handles RichPushAction.openChallenge

    The default implementation of this method is calling ChallengesAPI.getChallenge(id:). After a successful API call, showChallengeResponder(challenge:) is called on the main queue. If the API call failed, it does nothing.

    Declaration

    Swift

    open func handleOpenChallenge(userInfo: [String : Any], completionHandler: @escaping () -> Void)

    Parameters

    userInfo

    The whole push notification payload

  • Handles RichPushAction.openOfferLink

    The default implementation of this method is calling OffersAPI.getOffer(id:). After a successful API call, OffersAPI.respondToOffer(id:) is called, then the Offer‘s URL is validated, if valid, UIApplication.shared.open(url, options:, completionHandler:) is called on the main queue. If the API call failed, it does nothing.

    Declaration

    Swift

    open func handleOpenOfferLink(userInfo: [String : Any], completionHandler: @escaping () -> Void)

    Parameters

    userInfo

    The whole push notification payload

  • Handles RichPushAction.openCoupon

    The default implementation of this method is calling OffersAPI.respondToOffer(id:). After a successful API call, showOfferResponseDetail(response:) is called on the main queue. If the API call failed, it does nothing.

    Declaration

    Swift

    open func handleOpenCoupon(userInfo: [String : Any], completionHandler: @escaping () -> Void)

    Parameters

    userInfo

    The whole push notification payload

  • Handles RichPushAction.openCertificate

    The default implementation of this method is calling OffersAPI.respondToOffer(id:). After a successful API call, the Offer‘s certificate code is copied on the clipboard, then showMessage("RichPush.CertificateCodeCopiedToClipboard".localized) is called on the main queue. If the API call failed, it does nothing.

    Declaration

    Swift

    open func handleOpenCertificate(userInfo: [String : Any], completionHandler: @escaping () -> Void)

    Parameters

    userInfo

    The whole push notification payload

  • Handles RichPushAction.clipOffer

    The default implementation of this method is calling OffersAPI.clipOffer(id:).

    Declaration

    Swift

    open func handleClipOffer(userInfo: [String : Any], completionHandler: @escaping () -> Void)

    Parameters

    userInfo

    The whole push notification payload

  • Handles RichPushAction.favoriteEvent

    The default implementation of this method is calling EventsAPI.favoriteEvent(id:).

    Declaration

    Swift

    open func handleFavoriteEvent(userInfo: [String : Any], completionHandler: @escaping () -> Void)

    Parameters

    userInfo

    The whole push notification payload

  • Handles RichPushAction.openContentPage

    The default implementation of this method is calling ContentAPI.getContentPage(id:). then the ContentPage‘s URL is validated, if valid, UIApplication.shared.open(url, options:, completionHandler:) is called on the main queue. If the API call failed, it does nothing.

    Declaration

    Swift

    open func handleOpenContentPage(userInfo: [String : Any], completionHandler: @escaping () -> Void)

    Parameters

    userInfo

    The whole push notification payload

  • Handles RichPushAction

    The default implementation of this method is calling respective method within self depending on actionIdentifier and notificationType

    Declaration

    Swift

    open func handleRichPushResponse(actionIdentifier: String,
                                     notificationType: NotificationType,
                                     text: String?,
                                     userInfo: [String: Any],
                                     completionHandler: @escaping () -> Void)

    Parameters

    actionIdentifier

    RichPushAction identifier

    notificationType
    text

    User’s input if response is UNTextInputNotificationResponse

    userInfo

    The whole push notification payload

    completionHandler

  • Shows Challenge Responder on your application

    Important

    This does not have a default implementation. You MUST override this method.

    Declaration

    Swift

    open func showChallengeResponder(_ challenge: Challenge)
  • Shows Offer Response Detail on your application

    Important

    This does not have a default implementation. You MUST override this method.

    Declaration

    Swift

    open func showOfferResponseDetail(_ response: Offer.ResponseInfo)
  • Shows a single message on your application

    Important

    This does not have a default implementation. You MUST override this method.

    Declaration

    Swift

    open func showMessage(_ message: String)