// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow(UIScreen.MainScreen.Bounds); runner = new TouchRunner(window); // register every tests included in the main application/assembly runner.Add(System.Reflection.Assembly.GetExecutingAssembly()); window.RootViewController = new UINavigationController(runner.GetViewController()); // make the window visible window.MakeKeyAndVisible(); // setup for all tests CountdownEvent latch = new CountdownEvent(1); ACPCore.LogLevel = ACPMobileLogLevel.Verbose; ACPAnalytics.RegisterExtension(); ACPIdentity.RegisterExtension(); ACPLifecycle.RegisterExtension(); // start core ACPCore.Start(() => { ACPCore.ConfigureWithAppID("94f571f308d5/00fc543a60e1/launch-c861fab912f7-development"); latch.Signal(); }); latch.Wait(); latch.Dispose(); return(true); }
public TaskCompletionSource <string> GetVisitorIdentifier() { stringOutput = new TaskCompletionSource <string>(); ACPAnalytics.GetVisitorIdentifier(new StringCallback()); stringOutput.SetResult(""); return(stringOutput); }
public TaskCompletionSource <string> SendQueuedHits() { stringOutput = new TaskCompletionSource <string>(); ACPAnalytics.SendQueuedHits(); stringOutput.SetResult("completed"); return(stringOutput); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); LoadApplication(new App()); // set the wrapper type ACPCore.SetWrapperType(WrapperType.Xamarin); // set log level ACPCore.LogLevel = LoggingMode.Verbose; // register SDK extensions ACPCore.Application = this.Application; ACPIdentity.RegisterExtension(); ACPLifecycle.RegisterExtension(); ACPAnalytics.RegisterExtension(); // start core ACPCore.Start(new CoreStartCompletionCallback()); // register dependency service to link interface from ACPCoreTestApp base project DependencyService.Register <IACPAnalyticsExtensionService, ACPAnalyticsExtensionService>(); }
public void ClearQueue_Clears_QueuedHits() { // setup int expectedSize = 3; latch = new CountdownEvent(1); var config = new Dictionary <string, Java.Lang.Object>(); config.Add("analytics.batchLimit", 5); ACPCore.UpdateConfiguration(config); ACPCore.TrackAction("action", null); ACPCore.TrackAction("action", null); ACPCore.TrackAction("action", null); // test ACPAnalytics.GetQueueSize(new QueueSizeCallback()); latch.Wait(); latch.Dispose(); // verify Assert.That(retrievedQueueSize, Is.EqualTo(expectedSize)); // test expectedSize = 0; ACPAnalytics.ClearQueue(); latch = new CountdownEvent(1); ACPAnalytics.GetQueueSize(new QueueSizeCallback()); latch.Wait(); latch.Dispose(); // verify Assert.That(retrievedQueueSize, Is.EqualTo(expectedSize)); }
public TaskCompletionSource <string> GetQueueSize() { stringOutput = new TaskCompletionSource <string>(); ACPAnalytics.GetQueueSize(new StringCallback()); stringOutput.SetResult(""); return(stringOutput); }
partial void GetTrackingIdentifier(UIButton sender) { var callback = new Action <NSString>(handleCallback); ACPAnalytics.GetTrackingIdentifier(callback); Console.WriteLine("GetTrackingIdentifier: Completed"); }
void Start() { if (Application.platform == RuntimePlatform.Android) { ACPCore.SetApplication(); } ACPCore.SetLogLevel(ACPCore.ACPMobileLogLevel.VERBOSE); ACPCore.SetWrapperType(); ACPIdentity.RegisterExtension(); ACPAnalytics.RegisterExtension(); ACPCore.Start(HandleStartAdobeCallback); var callbackResultsGameObject = GameObject.Find("CallbackResults"); callbackResultsText = callbackResultsGameObject.GetComponent <Text>(); btnExtensionVersion.onClick.AddListener(AnalyticsExtensionVersion); btnSendQueuedHits.onClick.AddListener(SendQueuedHits); btnClearQueue.onClick.AddListener(ClearQueue); btnGetQueueSize.onClick.AddListener(GetQueueSize); btnGetTrackingIdentifier.onClick.AddListener(GetTrackingIdentifier); btnGetVisitorIdentifier.onClick.AddListener(GetVisitorIdentifier); btnSetVisitorIdentifier.onClick.AddListener(SetVisitorIdentifier); btnBatchAnalyticsHits.onClick.AddListener(BatchAnalyticsHits); }
//used for testing void BatchAnalyticsHits() { //setup latch = new CountdownEvent(1); //set batch limit to 5 Dictionary <string, object> config = new Dictionary <string, object>(); config.Add("analytics.batchLimit", "5"); ACPCore.UpdateConfiguration(config); Thread.Sleep(1000); Dictionary <string, string> contextData = new Dictionary <string, string>(); contextData.Add("contextdata", "data"); ACPCore.TrackAction("action", contextData); ACPCore.TrackAction("action", contextData); ACPCore.TrackAction("action", contextData); //get queue size for batches hits ACPAnalytics.GetQueueSize(HandleAdobeBatchedGetQueueSizeCallback); latch.Wait(); //cleanup latch.Dispose(); latch = null; }
public TaskCompletionSource <string> ClearQueue() { stringOutput = new TaskCompletionSource <string>(); ACPAnalytics.ClearQueue(); stringOutput.SetResult(""); return(stringOutput); }
//ACPAnalytics partial void GetQueueSize(UIButton sender) { var callback = new Action <nuint>(handleCallback); ACPAnalytics.GetQueueSize(callback); Console.WriteLine("GetQueueSize: Completed"); }
public TaskCompletionSource <string> SetVisitorIdentifier() { stringOutput = new TaskCompletionSource <string>(); ACPAnalytics.SetVisitorIdentifier("testVisitorIdentifier"); stringOutput.SetResult("completed"); return(stringOutput); }
public void Setup() { retrievedQueueSize = 0; retrievedVisitorIdentifier = ""; latch = null; ACPAnalytics.ClearQueue(); ACPCore.SetPrivacyStatus(MobilePrivacyStatus.OptIn); }
void AnalyticsExtensionVersion() { Debug.Log("Calling Analytics extensionVersion"); string analyticsExtensionVersion = ACPAnalytics.ExtensionVersion(); Debug.Log("Analytics extension version : " + analyticsExtensionVersion); results = "Analytics extension version : " + analyticsExtensionVersion; }
public TaskCompletionSource <string> GetQueueSize() { stringOutput = new TaskCompletionSource <string>(); var callback = new Action <nuint>(handleCallback); ACPAnalytics.GetQueueSize(callback); stringOutput.SetResult(""); return(stringOutput); }
public TaskCompletionSource <string> GetVisitorIdentifier() { stringOutput = new TaskCompletionSource <string>(); var callback = new Action <NSString>(handleCallback); ACPAnalytics.GetVisitorIdentifier(callback); stringOutput.SetResult(""); return(stringOutput); }
public void GetCustomVisitorIdentifier_Gets_PreviouslySetCustomVisitorIdentifier() { // setup latch = new CountdownEvent(1); var expectedIdentifier = "someVisitorIdentifier"; ACPAnalytics.SetVisitorIdentifier(expectedIdentifier); // test ACPAnalytics.GetVisitorIdentifier(new VisitorIdentifierCallback()); latch.Wait(); latch.Dispose(); // verify Assert.That(retrievedVisitorIdentifier, Is.EqualTo(expectedIdentifier)); }
public void GetCustomVisitorIdentifier_Gets_PreviouslySetCustomVisitorIdentifier() { // setup var latch = new CountdownEvent(1); string retrievedIdentifier = ""; string expectedIdentifier = "someVisitorIdentifier"; ACPAnalytics.SetVisitorIdentifier(expectedIdentifier); // test ACPAnalytics.GetVisitorIdentifier(callback => { retrievedIdentifier = callback.ToString(); latch.Signal(); }); latch.Wait(); latch.Dispose(); // verify Assert.That(retrievedIdentifier, Is.EqualTo(expectedIdentifier)); }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { // Override point for customization after application launch. // If not required for your application you can safely delete this method // set the wrapper type ACPCore.SetWrapperType(ACPMobileWrapperType.Xamarin); // set log level ACPCore.LogLevel = ACPMobileLogLevel.Verbose; // register SDK extensions ACPLifecycle.RegisterExtension(); ACPIdentity.RegisterExtension(); ACPAnalytics.RegisterExtension(); // start core ACPCore.Start(startCallback); return(true); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); LoadApplication(new App()); // set the wrapper type ACPCore.SetWrapperType(ACPMobileWrapperType.Xamarin); // set log level ACPCore.LogLevel = ACPMobileLogLevel.Verbose; // register SDK extensions ACPLifecycle.RegisterExtension(); ACPIdentity.RegisterExtension(); ACPAnalytics.RegisterExtension(); // start core ACPCore.Start(startCallback); // register dependency service to link interface from ACPCoreTestApp base project DependencyService.Register <IACPAnalyticsExtensionService, ACPAnalyticsExtensionService>(); return(base.FinishedLaunching(app, options)); }
public void ClearQueue_Clears_QueuedHits() { // setup var latch = new CountdownEvent(1); nuint queueSize = 0; var config = new NSMutableDictionary <NSString, NSObject> { ["analytics.batchLimit"] = new NSNumber(5) }; ACPCore.UpdateConfiguration(config); ACPCore.TrackAction("action", null); ACPCore.TrackAction("action", null); ACPCore.TrackAction("action", null); // test ACPAnalytics.GetQueueSize(callback => { queueSize = callback; latch.Signal(); }); latch.Wait(); latch.Dispose(); // verify Assert.That(queueSize, Is.EqualTo(3)); // test ACPAnalytics.ClearQueue(); latch = new CountdownEvent(1); ACPAnalytics.GetQueueSize(callback => { queueSize = callback; latch.Signal(); }); latch.Wait(); latch.Dispose(); // verify Assert.That(queueSize, Is.EqualTo(0)); }
protected override void OnCreate(Bundle bundle) { // tests can be inside the main assembly AddTest(Assembly.GetExecutingAssembly()); // or in any reference assemblies // AddTest (typeof (Your.Library.TestClass).Assembly); // Once you called base.OnCreate(), you cannot add more assemblies. base.OnCreate(bundle); // set log level ACPCore.LogLevel = LoggingMode.Verbose; // register SDK extensions ACPCore.Application = this.Application; ACPIdentity.RegisterExtension(); ACPLifecycle.RegisterExtension(); ACPAnalytics.RegisterExtension(); // start core ACPCore.Start(new CoreStartCompletionCallback()); latch.Wait(); latch.Dispose(); }
// ACPAnalytics methods public TaskCompletionSource <string> GetExtensionVersionAnalytics() { stringOutput = new TaskCompletionSource <string>(); stringOutput.SetResult(ACPAnalytics.ExtensionVersion()); return(stringOutput); }
public void GetACPAnalyticsExtensionVersion_Returns_CorrectVersion() { // verify Assert.That(ACPAnalytics.ExtensionVersion(), Is.EqualTo("2.5.0")); }
void GetVisitorIdentifier() { Debug.Log("Calling getVisitorIdentifier"); ACPAnalytics.GetVisitorIdentifier(HandleAdobeGetVisitorIdentifierCallback); }
public void Setup() { ACPAnalytics.ClearQueue(); ACPCore.SetPrivacyStatus(ACPMobilePrivacyStatus.OptIn); }
partial void SetVisitorIdentifier(UIButton sender) { ACPAnalytics.SetVisitorIdentifier("testVisitorIdentifier"); Console.WriteLine("SetVisitorIdentifier: Completed"); }
partial void ClearQueue(UIButton sender) { ACPAnalytics.ClearQueue(); Console.WriteLine("ClearQueue: Completed"); }
partial void GetExtensionVersionAnalytics(UIButton sender) { string version = ACPAnalytics.ExtensionVersion(); Console.WriteLine("GetExtensionVersionAnalytics: " + version); }
partial void SendQueuedHits(UIButton sender) { ACPAnalytics.SendQueuedHits(); Console.WriteLine("SendQueuedHits: Completed"); }