Exemplo n.º 1
0
        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"));
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
            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");
                }
            }
Exemplo n.º 4
0
            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");
                }
            }
Exemplo n.º 5
0
            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");
                }
            }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
            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");
                }
            }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
 public override void EventWithContent(NITManager manager, NSObject content, NITTrackingInfo trackingInfo)
 {
     ad.HandleNearContent(content);
 }