public static XCContentNotification GetCommonType(NITContent ContentNotification) { XCContentNotification XContent = new XCContentNotification(); XContent.NotificationMessage = ContentNotification.NotificationMessage; XContent.Title = ContentNotification.Title; XContent.Content = ContentNotification.Content; if (ContentNotification.Image != null) { XContent.ImageLink = new XCImageSet { FullSize = ContentNotification.Image.Url.AbsoluteString, SmallSize = ContentNotification.Image.SmallSizeURL.AbsoluteString }; } if (ContentNotification.Link != null) { XContent.Cta = new XCContentLink { Label = ContentNotification.Link.Label, Url = ContentNotification.Link.Url.AbsoluteString }; } XContent.Id = ContentNotification.ID; return(XContent); }
public static void HandleContent(NSObject content, IContentsListener listener) { if (content.GetType() == typeof(NITContent)) { NITContent cont = (NITContent)content; listener.GotContentNotification(cont); } else if (content.GetType() == typeof(NITSimpleNotification)) { NITSimpleNotification cont = (NITSimpleNotification)content; listener.GotSimpleNotification(cont); } else if (content.GetType() == typeof(NITCoupon)) { NITCoupon cont = (NITCoupon)content; listener.GotCouponNotification(cont); } else if (content.GetType() == typeof(NITCustomJSON)) { NITCustomJSON cont = (NITCustomJSON)content; listener.GotCustomJSONNotification(cont); } else if (content.GetType() == typeof(NITFeedback)) { NITFeedback cont = (NITFeedback)content; listener.GotFeedbackNotification(cont); } }
public override void GotContent(NITContent Content, NITTrackingInfo TrackingInfo) { XCContentNotification XContent = AdapterContent.GetCommonType(Content); if (NearPCL.GetContentManager() != null) { NearPCL.GetContentManager().GotXContentNotification(XContent); } else { Console.WriteLine("You receive a content but you haven't registered a content manager"); } }