예제 #1
0
        public void SendEvent(XCEvent ev)
        {
            if (ev.GetPluginName() == XCFeedbackEvent.PluginName)
            {
                XCFeedbackEvent feedbackEvent = (XamarinBridge.PCL.Types.XCFeedbackEvent)ev;

                XCFeedbackNotification feedback       = feedbackEvent.FeedbackNotification;
                NITFeedback            nativeFeedback = new NITFeedback();

                nativeFeedback = AdapterFeedback.GetNative(feedback);

                NITFeedbackEvent nativeFeedbackEvent = new NITFeedbackEvent(nativeFeedback, feedbackEvent.rating, feedbackEvent.comment);
                NITManager.DefaultManager.SendEventWithEvent(nativeFeedbackEvent, (error) =>
                {
                    if (error != null)
                    {
                        Console.WriteLine("SendEventWithEvent error ios" + error);
                    }
                    else
                    {
                        Console.WriteLine("SendEventWithEvent ios");
                    }
                });
            }
        }
예제 #2
0
        public void SendEvent(XCEvent ev)
        {
            if (ev.GetPluginName() == XCFeedbackEvent.PluginName)
            {
                XCFeedbackEvent feedbackEvent = (XamarinBridge.PCL.Types.XCFeedbackEvent)ev;

                XCFeedbackNotification feedback = feedbackEvent.FeedbackNotification;

                Feedback nativeFeedback = AdapterFeedback.GetNative(feedback);

                FeedbackEvent nativeFeedbackEvent = new FeedbackEvent(nativeFeedback, feedbackEvent.rating, feedbackEvent.comment);
                NearItManager.Instance.SendEvent(nativeFeedbackEvent);
            }
            else
            {
                Console.WriteLine("Error SendEvent android");
            }
        }
예제 #3
0
파일: Tests.cs 프로젝트: nearit/Xamarin-SDK
        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));
        }