Handle In-app Content (Bridge)
Every tap on notification should be leading to the implementation of the "IContentManager" interface.
In the next chapter you will find a reference for any NearITBridge content.
Recipe and content objects
When eventWithContent
gets called or inside processRecipe
callback you will obtain the content and the tracking info as arguments.
In your native fragment, content can have several class types:
XCSimpleNotification
instance representing the simple notificationXCContentNotification
instance representing the rich content if anyXCCustomJSONNotification
instance representing the custom object if anyXCCouponNotification
instance representig the coupon if anyXCFeedbackNotification
instance representing the feedback request if any
Bridge content classes
-
XCSimpleNotification
for the simple notification, with the following attributes:NotificationMessage
returns the notification message
-
XCContentNotification
for the notification with content, with the following attributes:Title
returns the notification titleContent
returns the text content, without processing the htmlImageLink
returns the link of the image objectCta
returns aContentLink
with a label and url fields
-
XCFeedbackNotification
with the following getters:Question
returns the feedback request stringRecipeId
returns the recipe id To give a feedback call this method:
// rating must be an integer between 0 and 5, and you can set a comment string.
NearPCL.SendEvent(new XCFeedbackEvent(originalFeedback, "Awesome!", 4));
-
XCCouponNotification
with the following getters:Description
returns the descriptionValue
returns the value stringExpiresAt
returns the expiring dateRedeemableFrom
returns the redeemable date, it's a start date of when you can reedem the couponIconSet
returns an Image object containing the source links for the iconSerial
returns the serial code of the couponClaimedAt
returns the date the coupon was claimedRedeemedAt
returns the date the coupon was redeemed
-
XCCustomJSONNotification
with the following getters:Content
returns the json content
Fetch current user coupon
We handle the complete emission and redemption coupon cycle in our platform, and we deliver a coupon content only when a coupon is emitted (you will not be notified of recipes when a profile has already received the coupon, even if the coupon is still valid). You can ask the library to fetch the list of all the user current coupons with the method:
NearPCL.GetCoupons((couponlist) => {
// do something with the list
}, (error) => {
// handle the error
});