public TaskCompletionSource <string> Clear()
 {
     completionSource = new TaskCompletionSource <string>();
     ACPPlaces.Clear();
     completionSource.SetResult("Cleared client side Places data.");
     return(completionSource);
 }
 public TaskCompletionSource <string> SetAuthorizationStatus()
 {
     taskCompletionSource = new TaskCompletionSource <string>();
     ACPPlaces.SetAuthorizationStatus(CLAuthorizationStatus.Authorized);
     taskCompletionSource.SetResult("Successfully Set Authorization status to Authorized.");
     return(taskCompletionSource);
 }
 public TaskCompletionSource <string> Clear()
 {
     taskCompletionSource = new TaskCompletionSource <string>();
     ACPPlaces.Clear();
     taskCompletionSource.SetResult("Successfully cleared the Placed data.");
     return(taskCompletionSource);
 }
 public TaskCompletionSource <string> SetAuthorizationStatus()
 {
     completionSource = new TaskCompletionSource <string>();
     ACPPlaces.SetAuthorizationStatus(PlacesAuthorizationStatus.Always);
     completionSource.SetResult("Authorization status set to always.");
     return(completionSource);
 }
Beispiel #5
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.SetWrapperType(ACPMobileWrapperType.Xamarin);
            ACPCore.LogLevel = ACPMobileLogLevel.Verbose;
            ACPIdentity.RegisterExtension();
            ACPSignal.RegisterExtension();
            ACPLifecycle.RegisterExtension();
            ACPPlaces.RegisterExtension();

            // start core
            ACPCore.Start(() =>
            {
                ACPCore.ConfigureWithAppID("94f571f308d5/00fc543a60e1/launch-c861fab912f7-development");
                latch.Signal();
            });
            latch.Wait();
            latch.Dispose();

            return(true);
        }
        public TaskCompletionSource <string> GetNearbyPointOfInterests()
        {
            Location location = new Location("ACPPlacesTestApp.Xamarin");

            //San Jose down town coordinates.
            location.Latitude  = 37.3309;
            location.Longitude = -121.8939;
            completionSource   = new TaskCompletionSource <string>();
            ACPPlaces.GetNearbyPointsOfInterest(location, 10, new AdobeCallBack(completionSource));
            return(completionSource);
        }
        public void TestGetNearbyPointOfInterests()
        {
            Location location = new Location("ACPPlacesTestApp.Xamarin");

            location.Latitude  = 37.3309;
            location.Longitude = 121.8939;
            ACPPlaces.GetNearbyPointsOfInterest(location, 0, new AdobeCallback());
            AbstractList pois = (AbstractList)taskCompletionSource.Task.ConfigureAwait(false).GetAwaiter().GetResult();

            Assert.That(pois.Size, Is.EqualTo(0));
        }
        public TaskCompletionSource <string> GetLastKnownLocation()
        {
            TaskCompletionSource <string> taskCompletionSource = new TaskCompletionSource <string>();
            Action <CLLocation>           action = (location) => {
                string coordinates = "Latitude: " + location.Coordinate.Latitude + " Logitutde: " + location.Coordinate.Longitude;
                taskCompletionSource.SetResult(coordinates);
            };

            ACPPlaces.GetLastKnownLocation(action);
            return(taskCompletionSource);
        }
 public void TestGetLastKnownLocation()
 {
     latch = new CountdownEvent(1);
     ACPPlaces.GetLastKnownLocation((location) =>
     {
         Assert.IsNotNull(location);
         latch.Signal();
         latch.Dispose();
     });
     latch.Wait();
 }
        public void TestGetCurrentPointOfInterests()
        {
            latch = new CountdownEvent(1);

            ACPPlaces.GetCurrentPointsOfInterest((pois) => {
                Assert.That(pois.Count, Is.EqualTo(0));
                latch.Signal();
                latch.Dispose();
            });
            latch.Wait(1000);
        }
 public void TestGetNearbyPointOfInterests()
 {
     latch = new CountdownEvent(1);
     ACPPlaces.GetNearbyPointsOfInterest(new CLLocation(37.3309, 121.8939), 0, (pois) =>
     {
         Assert.That(pois.Count, Is.EqualTo(0));
         latch.Signal();
         latch.Dispose();
     });
     latch.Wait(1000);
 }
        public void TestGetLastKnownLocation()
        {
            Location location = new Location("ACPPlacesTestApp.Xamarin");

            //Random coordinates
            location.Latitude  = 137.3309;
            location.Longitude = 11.8939;
            ACPPlaces.GetLastKnownLocation(new AdobeCallback());
            Location lastLocation = (Location)taskCompletionSource.Task.ConfigureAwait(false).GetAwaiter().GetResult();

            Assert.That(lastLocation, Is.Null);
        }
        public TaskCompletionSource <string> ProcessGeofence()
        {
            TaskCompletionSource <string> taskCompletionSource = new TaskCompletionSource <string>();
            CLLocationCoordinate2D        coordinate           = new CLLocationCoordinate2D();

            coordinate.Latitude  = 37.3309;
            coordinate.Longitude = -121.8939;

            ACPPlaces.ProcessRegionEvent(new CLCircularRegion(coordinate, 2000, "ACPPlacesTestApp.xamarin"), ACPRegionEventType.Entry); //Coordinates points to San Jose Downtown.
            taskCompletionSource.SetResult("Successfully process Geofence.");
            return(taskCompletionSource);
        }
        public TaskCompletionSource <string> GetNearbyPointOfInterests()
        {
            TaskCompletionSource <string>    taskCompletionSource = new TaskCompletionSource <string>();
            Action <NSArray <ACPPlacesPoi> > action = (pois) => {
                string poiNames = "";
                foreach (ACPPlacesPoi poi in pois)
                {
                    poiNames += (poi.Name + ",");
                }

                taskCompletionSource.SetResult(poiNames.EndsWith(",") ? poiNames.Substring(0, poiNames.Length - 1) : "None");
            };

            ACPPlaces.GetNearbyPointsOfInterest(new CLLocation(37.3309, -121.8939), 10, action); //Coordinates of San Jose Downtown.
            return(taskCompletionSource);
        }
        public TaskCompletionSource <string> ProcessGeofence()
        {
            completionSource = new TaskCompletionSource <string>();
            GeofenceBuilder builder = new GeofenceBuilder();

            builder.SetCircularRegion(37.3309, -121.8939, 2000);
            builder.SetExpirationDuration(60 * 60 * 100); //one hour
            builder.SetRequestId("SanJose Downtown");
            builder.SetLoiteringDelay(10000);
            builder.SetTransitionTypes(Geofence.GeofenceTransitionEnter);
            builder.SetExpirationDuration(50000);
            builder.SetNotificationResponsiveness(100);
            ACPPlaces.ProcessGeofence(builder.Build(), 1); //1 is Geofence Enter Transition.
            completionSource.SetResult("Geofence Processing Completed");
            return(completionSource);
        }
        public TaskCompletionSource <string> GetCurrentPointsOfInterests()
        {
            TaskCompletionSource <string>    taskCompletionSource = new TaskCompletionSource <string>();
            Action <NSArray <ACPPlacesPoi> > action = (pois) => {
                string poiNames = "";
                foreach (ACPPlacesPoi poi in pois)
                {
                    poiNames += (poi.Name + ",");
                }

                taskCompletionSource.SetResult(poiNames.EndsWith(",") ? poiNames.Substring(0, poiNames.Length - 1) : "None");
            };

            ACPPlaces.GetCurrentPointsOfInterest(action);
            return(taskCompletionSource);
        }
Beispiel #17
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());

            //Registering Adobe Extensions
            ACPCore.SetWrapperType(ACPMobileWrapperType.Xamarin);
            ACPSignal.RegisterExtension();
            ACPPlaces.RegisterExtension();

            ACPCore.ConfigureWithAppID("{your-launch-id}");
            ACPCore.Start(null);

            DependencyService.Register <IACPPlacesExtensionService, ACPPlacesExtensionService>();

            return(base.FinishedLaunching(app, options));
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());

            //Register Adobe AEP Sdk's
            ACPCore.SetWrapperType(WrapperType.Xamarin);

            ACPCore.Application = this.Application;
            ACPPlaces.RegisterExtension();
            ACPSignal.RegisterExtension();

            ACPCore.Start(null);
            ACPCore.ConfigureWithAppID("{your-launch-id}");

            DependencyService.Register <IACPPlacesExtensionService, ACPPlacesExtensionService>();
        }
Beispiel #19
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);

            // setup for all tests
            ACPCore.Application = this.Application;
            ACPCore.SetWrapperType(WrapperType.Xamarin);
            ACPCore.LogLevel = LoggingMode.Verbose;
            ACPIdentity.RegisterExtension();
            ACPSignal.RegisterExtension();
            ACPLifecycle.RegisterExtension();
            ACPPlaces.RegisterExtension();

            // start core
            ACPCore.Start(new CoreStartCompletionCallback());
            latch.Wait();
            latch.Dispose();
        }
 public TaskCompletionSource <string> GetACPPlacesExtensionVersion()
 {
     completionSource = new TaskCompletionSource <string>();
     completionSource.SetResult("Extension Version:: " + ACPPlaces.ExtensionVersion());
     return(completionSource);
 }
 public TaskCompletionSource <string> GetCurrentPointsOfInterests()
 {
     completionSource = new TaskCompletionSource <string>();
     ACPPlaces.GetCurrentPointsOfInterest(new AdobeCallBack(completionSource));
     return(completionSource);
 }
        public void TestGetACPPlacesExtensionVersion()
        {
            string version = ACPPlaces.ExtensionVersion();

            Assert.That(version, Is.EqualTo("1.4.2"));
        }
 public TaskCompletionSource <string> GetLastKnownLocation()
 {
     completionSource = new TaskCompletionSource <string>();
     ACPPlaces.GetLastKnownLocation(new AdobeCallBack(completionSource));
     return(completionSource);
 }