示例#1
0
        partial void GetExperienceCloudId(UIButton sender)
        {
            var callback = new Action <NSString>(handleCallback);

            ACPIdentity.GetExperienceCloudId(callback);
            Console.WriteLine("GetExperienceCloudId Completed");
        }
示例#2
0
        //
        // 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);
        }
示例#3
0
        public void TestAppendVisitorInfoForUrl_Returns_AppendedUrl()
        {
            // setup
            Thread.Sleep(1000);
            CountdownEvent latch     = new CountdownEvent(2);
            string         urlString = null;
            string         ecid      = null;
            string         orgid     = new NSString("972C898555E9F7BC7F000101%40AdobeOrg");
            NSUrl          url       = new NSUrl("https://test.com");

            // test
            ACPIdentity.GetExperienceCloudId(ecidCallback =>
            {
                ecid = ecidCallback.ToString();
                latch.Signal();
                ACPIdentity.AppendToUrl(url, callback => {
                    urlString = callback.ToString();
                    latch.Signal();
                });
            });
            latch.Wait();
            latch.Dispose();
            // verify
            Assert.That(urlString, Is.StringContaining(url.ToString()));
            Assert.That(urlString, Is.StringContaining(ecid));
            Assert.That(urlString, Is.StringContaining(orgid));
        }
示例#4
0
        partial void GetIdentifiers(UIButton sender)
        {
            var callback = new Action <ACPMobileVisitorId[]>(handleCallback);

            ACPIdentity.GetIdentifiers(callback);
            Console.WriteLine("GetIdentifiers Completed");
        }
示例#5
0
        partial void GetUrlVariables(UIButton sender)
        {
            var callback = new Action <NSString>(handleCallback);

            ACPIdentity.GetUrlVariables(callback);
            Console.WriteLine("GetUrlVariables Completed");
        }
示例#6
0
 public TaskCompletionSource <string> SyncIdentifier()
 {
     stringOutput = new TaskCompletionSource <string>();
     ACPIdentity.SyncIdentifier("name", "john", ACPMobileVisitorAuthenticationState.Authenticated);
     stringOutput.SetResult("completed");
     return(stringOutput);
 }
        public void TestGetIdentifiers_Returns_SyncedIdentifiers()
        {
            // setup
            latch = new CountdownEvent(1);
            ACPIdentity.SyncIdentifier("id1", "value1", VisitorID.AuthenticationState.Authenticated);
            var ids = new Dictionary <string, string>();

            ids.Add("id2", "value2");
            ids.Add("id3", "value3");
            ACPIdentity.SyncIdentifiers(ids);
            var ids2 = new Dictionary <string, string>();

            ids2.Add("id4", "value4");
            ids2.Add("id5", "value5");
            ACPIdentity.SyncIdentifiers(ids2, VisitorID.AuthenticationState.LoggedOut);
            // test
            ACPIdentity.GetIdentifiers(new GetIdentifiersCallback());
            latch.Wait();
            latch.Dispose();
            // verify
            Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value1, Type: id1, Origin: d_cid_ic, Authentication: AUTHENTICATED]"));
            Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value2, Type: id2, Origin: d_cid_ic, Authentication: UNKNOWN]"));
            Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value3, Type: id3, Origin: d_cid_ic, Authentication: UNKNOWN]"));
            Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value4, Type: id4, Origin: d_cid_ic, Authentication: LOGGED_OUT]"));
            Assert.That(retrievedVisitorIdentifiers, Is.StringContaining("[Id: value5, Type: id5, Origin: d_cid_ic, Authentication: LOGGED_OUT]"));
        }
示例#8
0
        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();
            ACPSignal.RegisterExtension();

            // start core
            ACPCore.Start(new CoreStartCompletionCallback());

            // register dependency service to link interface from ACPCoreTestApp base project
            DependencyService.Register <IACPCoreExtensionService, ACPCoreExtensionService>();
        }
示例#9
0
        //
        // 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 launch config
            ACPCore.ConfigureWithAppID("launch-ENf8ed5382efc84d5b81a9be8dcc231be1-development");

            // set log level
            ACPCore.LogLevel = ACPMobileLogLevel.Verbose;

            // register SDK extensions
            ACPIdentity.RegisterExtension();
            ACPLifecycle.RegisterExtension();
            ACPSignal.RegisterExtension();

            // start core
            ACPCore.Start(null);

            // register dependency service to link interface from ACPCoreTestApp base project
            DependencyService.Register <IACPCoreExtensionService, ACPCoreExtensionService>();
            return(base.FinishedLaunching(app, options));
        }
示例#10
0
    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);
    }
示例#11
0
        partial void AppendVisitorInfoForUrl(UIButton sender)
        {
            var callback = new Action <NSUrl>(handleCallback);
            var url      = new NSUrl("https://example.com");

            ACPIdentity.AppendToUrl(url, callback);
            Console.WriteLine("AppendVisitorInfoForUrl Completed");
        }
示例#12
0
        public TaskCompletionSource <string> GetUrlVariables()
        {
            stringOutput = new TaskCompletionSource <string>();
            var callback = new Action <NSString> (handleCallback);

            ACPIdentity.GetUrlVariables(callback);
            stringOutput.SetResult("");
            return(stringOutput);
        }
示例#13
0
    void syncIdentifiers()
    {
        Dictionary <string, string> ids = new Dictionary <string, string>();

        ids.Add("idsType1", "idValue1");
        ids.Add("idsType2", "idValue2");
        ids.Add("idsType3", "idValue3");
        ACPIdentity.SyncIdentifiers(ids);
    }
示例#14
0
        public TaskCompletionSource <string> GetExperienceCloudId()
        {
            stringOutput = new TaskCompletionSource <string>();
            var callback = new Action <NSString>(handleCallback);

            ACPIdentity.GetExperienceCloudId(callback);
            stringOutput.SetResult("");
            return(stringOutput);
        }
示例#15
0
        public TaskCompletionSource <string> GetIdentifiers()
        {
            stringOutput = new TaskCompletionSource <string>();
            var callback = new Action <ACPMobileVisitorId[]>(handleCallback);

            ACPIdentity.GetIdentifiers(callback);
            stringOutput.SetResult("");
            return(stringOutput);
        }
 public TaskCompletionSource <string> GetUrlVariables()
 {
     latch        = new CountdownEvent(1);
     stringOutput = new TaskCompletionSource <string>();
     ACPIdentity.GetUrlVariables(new StringCallback());
     latch.Wait(1000);
     stringOutput.SetResult(callbackString);
     return(stringOutput);
 }
 public TaskCompletionSource <string> AppendVisitorInfoForUrl()
 {
     latch        = new CountdownEvent(1);
     stringOutput = new TaskCompletionSource <string>();
     ACPIdentity.AppendVisitorInfoForURL("https://example.com", new StringCallback());
     latch.Wait(1000);
     stringOutput.SetResult(callbackString);
     return(stringOutput);
 }
示例#18
0
    void syncIdentifiersWithAuthState()
    {
        Dictionary <string, string> ids = new Dictionary <string, string>();

        ids.Add("idsType1", "idValue1");
        ids.Add("idsType2", "idValue2");
        ids.Add("idsType3", "idValue3");
        ACPIdentity.SyncIdentifiers(ids, ACPIdentity.ACPAuthenticationState.AUTHENTICATED);
    }
示例#19
0
        public TaskCompletionSource <string> AppendVisitorInfoForUrl()
        {
            stringOutput = new TaskCompletionSource <string>();
            var callback = new Action <NSUrl>(handleCallback);
            var url      = new NSUrl("https://example.com");

            ACPIdentity.AppendToUrl(url, callback);
            stringOutput.SetResult("");
            return(stringOutput);
        }
示例#20
0
    // Core Methods
    void coreExtensionVersion()
    {
        string coreVersion      = "coreVersion - " + ACPCore.ExtensionVersion() + " ";
        string identityVersion  = "identityVersion - " + ACPIdentity.ExtensionVersion() + " ";
        string lifecycleVersion = "lifecycleVersion - " + ACPLifecycle.ExtensionVersion() + " ";
        string signalVersion    = "signalVersion - " + ACPSignal.ExtensionVersion() + " ";

        _result = coreVersion + identityVersion + lifecycleVersion + signalVersion;
        print(_result);
        txtResult.text = _result;
    }
        public TaskCompletionSource <string> SyncIdentifiersWithAuthState()
        {
            stringOutput = new TaskCompletionSource <string>();
            var ids = new Dictionary <string, string>();

            ids.Add("lastname", "doe");
            ids.Add("age", "38");
            ids.Add("zipcode", "94403");
            ACPIdentity.SyncIdentifiers(ids, VisitorID.AuthenticationState.LoggedOut);
            stringOutput.SetResult("completed");
            return(stringOutput);
        }
        public TaskCompletionSource <string> SyncIdentifiers()
        {
            stringOutput = new TaskCompletionSource <string>();
            var ids = new Dictionary <string, string>();

            ids.Add("lastname", "doe");
            ids.Add("age", "38");
            ids.Add("zipcode", "94403");
            ACPIdentity.SyncIdentifiers(ids);
            stringOutput.SetResult("completed");
            return(stringOutput);
        }
示例#23
0
        partial void SyncIdentifiers(UIButton sender)
        {
            var ids = new NSMutableDictionary <NSString, NSObject>
            {
                ["lastName"] = new NSString("doe"),
                ["age"]      = new NSString("38"),
                ["zipcode"]  = new NSString("94403")
            };

            ACPIdentity.SyncIdentifiers(ids);
            Console.WriteLine("SyncIdentifiers Completed");
        }
示例#24
0
        partial void SyncIdentifiersWithAuthState(UIButton sender)
        {
            var ids = new NSMutableDictionary <NSString, NSObject>
            {
                ["lastName"] = new NSString("doe"),
                ["age"]      = new NSString("38"),
                ["zipcode"]  = new NSString("94403")
            };

            ACPIdentity.SyncIdentifiers(ids, ACPMobileVisitorAuthenticationState.LoggedOut);
            Console.WriteLine("SyncIdentifiersWithAuthState Completed");
        }
示例#25
0
        public TaskCompletionSource <string> SyncIdentifiersWithAuthState()
        {
            stringOutput = new TaskCompletionSource <string>();
            var ids = new NSMutableDictionary <NSString, NSObject>
            {
                ["lastName"] = new NSString("doe"),
                ["age"]      = new NSString("38"),
                ["zipcode"]  = new NSString("94403")
            };

            ACPIdentity.SyncIdentifiers(ids, ACPMobileVisitorAuthenticationState.LoggedOut);
            stringOutput.SetResult("completed");
            return(stringOutput);
        }
示例#26
0
        public TaskCompletionSource <string> SyncIdentifiers()
        {
            stringOutput = new TaskCompletionSource <string>();
            var ids = new NSMutableDictionary <NSString, NSObject>
            {
                ["lastName"] = new NSString("doe"),
                ["age"]      = new NSString("38"),
                ["zipcode"]  = new NSString("94403")
            };

            ACPIdentity.SyncIdentifiers(ids);
            stringOutput.SetResult("completed");
            return(stringOutput);
        }
        public void TestGetUrlVariables_Returns_UrlVariables()
        {
            // setup
            latch = new CountdownEvent(2);
            string orgid = "972C898555E9F7BC7F000101%40AdobeOrg";

            // test
            ACPIdentity.GetExperienceCloudId(new EcidCallback());
            ACPIdentity.GetUrlVariables(new StringCallback());
            latch.Wait();
            latch.Dispose();
            // verify
            Assert.That(retrievedString, Is.StringContaining(retrievedEcid));
            Assert.That(retrievedString, Is.StringContaining(orgid));
        }
        public void TestAppendVisitorInfoForUrl_Returns_AppendedUrl()
        {
            // setup
            latch = new CountdownEvent(2);
            String url   = "https://test.com";
            String orgid = "972C898555E9F7BC7F000101%40AdobeOrg";

            // test
            ACPIdentity.GetExperienceCloudId(new EcidCallback());
            ACPIdentity.AppendVisitorInfoForURL(url, new StringCallback());
            latch.Wait(1000);
            latch.Dispose();
            // verify
            Assert.That(retrievedString, Is.StringContaining(url));
            Assert.That(retrievedString, Is.StringContaining(retrievedEcid));
            Assert.That(retrievedString, Is.StringContaining(orgid));
        }
示例#29
0
    // Start is called before the first frame update
    void Start()
    {
        if (Application.platform == RuntimePlatform.Android)
        {
            ACPCore.SetApplication();
        }

        ACPCore.SetLogLevel(ACPCore.ACPMobileLogLevel.VERBOSE);
        ACPCore.SetWrapperType();
        ACPIdentity.RegisterExtension();
        ACPLifecycle.RegisterExtension();
        ACPSignal.RegisterExtension();
        ACPCore.Start(HandleStartAdobeCallback);

        // Core
        btnCoreExtensionVersion.onClick.AddListener(coreExtensionVersion);
        btnSetApplication.onClick.AddListener(setApplication);
        btnGetApplication.onClick.AddListener(getApplication);
        btnSetLogLevel.onClick.AddListener(setLogLevel);
        btnGetLogLevel.onClick.AddListener(getLogLevel);
        btnDispatchEvent.onClick.AddListener(dispatchEvent);
        btnDispatchEventWithResponseCallback.onClick.AddListener(dispatchEventWithResponseCallback);
        btnDispatchResponseEvent.onClick.AddListener(dispatchResponseEvent);
        btnSetPrivacyStatus.onClick.AddListener(setPrivacyStatus);
        btnSetAdvertisingIdentifier.onClick.AddListener(setAdvertisingIdentifier);
        btnGetSdkIdentities.onClick.AddListener(getSdkIdentities);
        btnGetPrivacyStatus.onClick.AddListener(getPrivacyStatus);
        btnDownloadRules.onClick.AddListener(downloadRules);
        btnUpdateConfiguration.onClick.AddListener(updateConfiguration);
        btnTrackState.onClick.AddListener(trackState);
        btnTrackAction.onClick.AddListener(trackAction);

        // Identity
        btnIdentityExtensionVersion.onClick.AddListener(identityExtensionVersion);
        btnAppendToUrl.onClick.AddListener(appendToUrl);
        btnGetIdentifiers.onClick.AddListener(getIdentifiers);
        btnGetExperienceCloudId.onClick.AddListener(getExperienceCloudId);
        btnSyncIdentifier.onClick.AddListener(syncIdentifier);
        btnSyncIdentifiers.onClick.AddListener(syncIdentifiers);
        btnSyncIdentifiersWithAuthState.onClick.AddListener(syncIdentifiersWithAuthState);
        btnUrlVariables.onClick.AddListener(urlVariables);
    }
示例#30
0
        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);
        }