DefaultRichPushHandler
open class DefaultRichPushHandler : RichPushHandler
RichPushHandler with default implementations
-
Undocumented
Declaration
Swift
public init() -
Handles
RichPushAction.likePostThe default implementation of this method is calling
NewsFeedAPI.likePost(id:).Declaration
Swift
open func handleLikePost(userInfo: [String : Any], completionHandler: @escaping () -> Void)Parameters
userInfoThe whole push notification payload
-
Handles
RichPushAction.commentPostThe 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
userInfoThe whole push notification payload
textText that the user inputted
-
Handles
RichPushAction.openChallengeThe 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
userInfoThe whole push notification payload
-
Handles
RichPushAction.openOfferLinkThe default implementation of this method is calling
OffersAPI.getOffer(id:). After a successful API call,OffersAPI.respondToOffer(id:)is called, then theOffer‘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
userInfoThe whole push notification payload
-
Handles
RichPushAction.openCouponThe 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
userInfoThe whole push notification payload
-
Handles
RichPushAction.openCertificateThe default implementation of this method is calling
OffersAPI.respondToOffer(id:). After a successful API call, theOffer‘s certificate code is copied on the clipboard, thenshowMessage("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
userInfoThe whole push notification payload
-
Handles
RichPushAction.clipOfferThe default implementation of this method is calling
OffersAPI.clipOffer(id:).Declaration
Swift
open func handleClipOffer(userInfo: [String : Any], completionHandler: @escaping () -> Void)Parameters
userInfoThe whole push notification payload
-
Handles
RichPushAction.favoriteEventThe default implementation of this method is calling
EventsAPI.favoriteEvent(id:).Declaration
Swift
open func handleFavoriteEvent(userInfo: [String : Any], completionHandler: @escaping () -> Void)Parameters
userInfoThe whole push notification payload
-
Handles
RichPushAction.openContentPageThe default implementation of this method is calling
ContentAPI.getContentPage(id:). then theContentPage‘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
userInfoThe whole push notification payload
-
Handles
RichPushActionThe default implementation of this method is calling respective method within self depending on
actionIdentifierandnotificationTypeDeclaration
Swift
open func handleRichPushResponse(actionIdentifier: String, notificationType: NotificationType, text: String?, userInfo: [String: Any], completionHandler: @escaping () -> Void)Parameters
actionIdentifierRichPushActionidentifiernotificationTypetextUser’s input if response is
UNTextInputNotificationResponseuserInfoThe 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)
View on GitHub
DefaultRichPushHandler Class Reference