示例#1
0
    void dispatchEventWithResponseCallback()
    {
        print("Calling dispatchEventWithResponseCallback");
        var dict = new Dictionary <string, object>();

        dict.Add("eventDataKey", "eventDataValue");
        ACPCore.DispatchEventWithResponseCallback(new ACPExtensionEvent("eventname", "eventType", "eventSource", dict), HandleAdobeEventCallback, HandleAdobeExtensionErrorCallback);
    }
        public TaskCompletionSource <string> DispatchEventWithResponseCallback()
        {
            stringOutput = new TaskCompletionSource <string>();
            var data = new Dictionary <string, Java.Lang.Object>();

            data.Add("testEvent", true);
            Event sdkEvent = new Event.Builder("eventName", "eventType", "eventSource").SetEventData(data).Build();

            stringOutput.SetResult(ACPCore.DispatchEventWithResponseCallback(sdkEvent, new StringCallback(), new ErrorCallback()).ToString());
            return(stringOutput);
        }
        public void DispatchValidSDKEventWithCallback_Returns_True()
        {
            // setup
            var data = new Dictionary <string, Java.Lang.Object>();

            data.Add("testEvent", true);
            Event sdkEvent = new Event.Builder("eventName", "eventType", "eventSource").SetEventData(data).Build();
            // test
            var status = ACPCore.DispatchEventWithResponseCallback(sdkEvent, new StringCallback(), new ErrorCallback());

            // verify
            Assert.That(status, Is.EqualTo(true));
        }
示例#4
0
        public TaskCompletionSource <string> DispatchEventWithResponseCallback()
        {
            stringOutput = new TaskCompletionSource <string>();
            NSError error;
            var     data = new NSMutableDictionary <NSString, NSObject>
            {
                ["dispatchResponseEventKey"] = new NSString("dispatchResponseEventValue")
            };
            ACPExtensionEvent          sdkEvent = ACPExtensionEvent.ExtensionEventWithName("eventName", "eventType", "eventSource", data, out _);
            Action <ACPExtensionEvent> callback = new Action <ACPExtensionEvent>(handleCallback);

            stringOutput.SetResult(ACPCore.DispatchEventWithResponseCallback(sdkEvent, callback, out error).ToString());
            if (error != null)
            {
                stringOutput.SetResult(error.LocalizedDescription);
            }
            return(stringOutput);
        }
示例#5
0
        partial void DispatchEventWithResponseCallback(UIButton sender)
        {
            NSError error;
            var     data = new NSMutableDictionary <NSString, NSObject>
            {
                ["dispatchResponseEventKey"] = new NSString("dispatchResponseEventValue")
            };
            ACPExtensionEvent          sdkEvent = ACPExtensionEvent.ExtensionEventWithName("eventName", "eventType", "eventSource", data, out _);
            Action <ACPExtensionEvent> callback = new Action <ACPExtensionEvent>(handleCallback);
            bool result = ACPCore.DispatchEventWithResponseCallback(sdkEvent, callback, out error);

            if (error != null)
            {
                Console.WriteLine("DispatchEventWithResponseCallback: Error: " + error.LocalizedDescription);
            }
            else
            {
                Console.WriteLine("DispatchEvent: " + result);
            }
        }
示例#6
0
        public void DispatchValidSDKEventWithCallback_Returns_True()
        {
            // setup
            NSError        error;
            CountdownEvent latch = new CountdownEvent(1);
            var            data  = new NSMutableDictionary <NSString, NSObject>
            {
                ["dispatchResponseEventKey"] = new NSString("dispatchResponseEventValue")
            };
            ACPExtensionEvent sdkEvent = ACPExtensionEvent.ExtensionEventWithName("eventName", "eventType", "eventSource", data, out _);
            // test
            var status = ACPCore.DispatchEventWithResponseCallback(sdkEvent, responseEvent => {
                Console.WriteLine("Response event name: " + responseEvent.EventName.ToString() + " type: " + responseEvent.EventType.ToString() + " source: " + responseEvent.EventSource.ToString() + " data: " + responseEvent.EventData.ToString());
                latch.Signal();
            }, out error);

            latch.Wait(500);
            latch.Dispose();
            // verify
            Assert.That(status, Is.EqualTo(true));
        }