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:
XCSimpleNotificationinstance representing the simple notificationXCContentNotificationinstance representing the rich content if anyXCCustomJSONNotificationinstance representing the custom object if anyXCCouponNotificationinstance representig the coupon if anyXCFeedbackNotificationinstance representing the feedback request if any
Bridge content classes
-
XCSimpleNotificationfor the simple notification, with the following attributes:NotificationMessagereturns the notification message
-
XCContentNotificationfor the notification with content, with the following attributes:Titlereturns the notification titleContentreturns the text content, without processing the htmlImageLinkreturns the link of the image objectCtareturns aContentLinkwith a label and url fields
-
XCFeedbackNotificationwith the following getters:Questionreturns the feedback request stringRecipeIdreturns 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));
-
XCCouponNotificationwith the following getters:Descriptionreturns the descriptionValuereturns the value stringExpiresAtreturns the expiring dateRedeemableFromreturns the redeemable date, it's a start date of when you can reedem the couponIconSetreturns an Image object containing the source links for the iconSerialreturns the serial code of the couponClaimedAtreturns the date the coupon was claimedRedeemedAtreturns the date the coupon was redeemed
-
XCCustomJSONNotificationwith the following getters:Contentreturns 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
});