public void FromNativeToBridge() { var XKeys = new NSString[] { (NSString)"key" }; var XObj = new NSObject[] { (NSString)"value" }; NITTrackingInfo NTrack = NITTrackingInfo.TrackingInfoFromRecipeId("recid", NSDictionary <NSString, NSObject> .FromObjectsAndKeys(XObj, XKeys)); NITFeedback NFeed = new NITFeedback(); NFeed.Question = "Question?"; NFeed.NotificationMessage = "ciao"; NFeed.RecipeId = "rec-id"; NFeed.TrackingInfo = NTrack; XCFeedbackNotification XFeed = AdapterFeedback.GetCommonType(NFeed); Assert.True(XFeed.Question.Equals(NFeed.Question)); Assert.NotNull(XFeed.TrackingInfo.extras); object value = XFeed.TrackingInfo.extras["key"]; Assert.NotNull(value); Assert.True(value is string); Assert.True(XFeed.TrackingInfo.extras["key"].Equals("value")); }
public void SendTrack(XCTrackingInfo trackingInfo, string value) { NITTrackingInfo track = new NITTrackingInfo(); track.RecipeId = trackingInfo.RecipeId; foreach (var item in track.ExtrasDictionary()) { trackingInfo.extras.Add((NSString)item.Key, item.Value); } NITManager.DefaultManager.SendTrackingWithTrackingInfo(track, value); }
public override void GotFeedback(NITFeedback Feedback, NITTrackingInfo TrackingInfo) { XCFeedbackNotification XFeedback = AdapterFeedback.GetCommonType(Feedback); if (NearPCL.GetContentManager() != null) { NearPCL.GetContentManager().GotXFeedbackNotification(XFeedback); } else { Console.WriteLine("You receive a content but you haven't registered a content manager"); } }
public override void GotCustomJSON(NITCustomJSON CustomJSON, NITTrackingInfo TrackingInfo) { XCCustomJSONNotification XCustomJSON = AdapterCustom.GetCommonType(CustomJSON); if (NearPCL.GetContentManager() != null) { NearPCL.GetContentManager().GotXCustomJSONNotification(XCustomJSON); } else { Console.WriteLine("You receive a content but you haven't registered a content manager"); } }
public override void GotCoupon(NITCoupon Coupon, NITTrackingInfo TrackingInfo) { XCCouponNotification XCoupon = AdapterCoupon.GetCommonType(Coupon); if (NearPCL.GetContentManager() != null) { NearPCL.GetContentManager().GotXCouponNotification(XCoupon); } else { Console.WriteLine("You receive a content but you haven't registered a content manager"); } }
public static NITFeedback GetNative(XCFeedbackNotification xfeed) { NITFeedback native = new NITFeedback(); native.TrackingInfo = NITTrackingInfo.TrackingInfoFromRecipeId(xfeed.TrackingInfo.RecipeId, AdapterUtils.From(xfeed.TrackingInfo.extras)); native.NotificationMessage = xfeed.NotificationMessage; native.Question = xfeed.Question; native.ID = xfeed.Id; return(native); }
public override void GotSimpleNotification(NITSimpleNotification Notification, NITTrackingInfo TrackingInfo) { XCSimpleNotification XSimple = AdapterSimple.GetCommonType(Notification); if (NearPCL.GetContentManager() != null) { NearPCL.GetContentManager().GotXSimpleNotification(XSimple); } else { Console.WriteLine("You receive a content but you haven't registered a content manager"); } }
public static void ParseContent(NSObject Content, NITTrackingInfo TrackingInfo) { //HandleNearContent.HandleContent(content, _contentsListener); this is mine handlecontent --> implement in the internal class EVENTCONTENT : IContentsListener NITManager.DefaultManager.ParseContent(Content, TrackingInfo, _contentsListener); }
public override void EventWithContent(NITManager manager, NSObject content, NITTrackingInfo trackingInfo) { ad.HandleNearContent(content); }