public void SendTrack(XCTrackingInfo trackingInfo, string value)
        {
            TrackingInfo track = new TrackingInfo();

            track.RecipeId = trackingInfo.RecipeId;
            track.Metadata = trackingInfo.extras;

            NearItManager.Instance.SendTracking(track, value);
        }
Exemple #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);
        }
Exemple #3
0
        public void FromBridgeToNative()
        {
            XCTrackingInfo xtrack = new XCTrackingInfo();

            xtrack.RecipeId = "recid";
            xtrack.extras   = new Dictionary <string, object>();
            xtrack.extras.Add("key", "value");

            XCFeedbackNotification XFeed = new XCFeedbackNotification();

            XFeed.Question            = "Question?";
            XFeed.NotificationMessage = "ciao";
            XFeed.RecipeId            = "rec-id";
            XFeed.TrackingInfo        = xtrack;

            Feedback NFeed = AdapterFeedback.GetNative(XFeed);

            Assert.True(NFeed.Question.Equals(XFeed.Question));
        }
Exemple #4
0
        public static XCHistoryItem GetCommonType(NITHistoryItem nativeItem)
        {
            XCHistoryItem item = new XCHistoryItem();

            item.read      = nativeItem.Read;
            item.timestamp = nativeItem.Timestamp;
            XCTrackingInfo trackingInfo = new XCTrackingInfo();

            trackingInfo.RecipeId = nativeItem.TrackingInfo.RecipeId;
            trackingInfo.extras   = AdapterUtils.FromNS(
                nativeItem.TrackingInfo.ExtrasDictionary() as NSDictionary <NSString, NSObject>
                );
            item.trackingInfo = trackingInfo;

            if (nativeItem.ReactionBundle is NITSimpleNotification simple)
            {
                item.reaction = AdapterSimple.GetCommonType(simple);
            }
            else if (nativeItem.ReactionBundle is NITContent content)
            {
                item.reaction = AdapterContent.GetCommonType(content);
            }
            else if (nativeItem.ReactionBundle is NITFeedback feedback)
            {
                item.reaction = AdapterFeedback.GetCommonType(feedback);
            }
            else if (nativeItem.ReactionBundle is NITCoupon coupon)
            {
                item.reaction = AdapterCoupon.GetCommonType(coupon);
            }
            else if (nativeItem.ReactionBundle is NITCustomJSON customJSON)
            {
                item.reaction = AdapterCustom.GetCommonType(customJSON);
            }

            return(item);
        }
Exemple #5
0
        public static XCHistoryItem GetCommonType(HistoryItem nativeItem)
        {
            XCHistoryItem  item         = new XCHistoryItem();
            XCTrackingInfo trackingInfo = new XCTrackingInfo();

            trackingInfo.RecipeId = nativeItem.TrackingInfo.RecipeId;
            trackingInfo.extras   = AdapterUtils.From(nativeItem.TrackingInfo.Metadata);

            item.read      = nativeItem.Read;
            item.timestamp = nativeItem.Timestamp;

            item.trackingInfo = trackingInfo;

            if (nativeItem.Reaction is SimpleNotification simple)
            {
                item.reaction = AdapterSimple.GetCommonType(simple);
            }
            else if (nativeItem.Reaction is Content content)
            {
                item.reaction = AdapterContent.GetCommonType(content);
            }
            else if (nativeItem.Reaction is Feedback feedback)
            {
                item.reaction = AdapterFeedback.GetCommonType(feedback);
            }
            else if (nativeItem.Reaction is Coupon coupon)
            {
                item.reaction = AdapterCoupon.GetCommonType(coupon);
            }
            else if (nativeItem.Reaction is CustomJSON customJSON)
            {
                item.reaction = AdapterCustom.GetCommonType(customJSON);
            }

            return(item);
        }
Exemple #6
0
 public static void SendTracking(XCTrackingInfo trackingInfo, string value)
 {
     DependencyService.Get <INearFunc>().SendTrack(trackingInfo, value);
 }