NextDots.RetargetlyLib.Android 1.0.3.2

Android geolocation Library

There is a newer version of this package available.
See the version list below for details.
Install-Package NextDots.RetargetlyLib.Android -Version 1.0.3.2
dotnet add package NextDots.RetargetlyLib.Android --version 1.0.3.2
<PackageReference Include="NextDots.RetargetlyLib.Android" Version="1.0.3.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NextDots.RetargetlyLib.Android --version 1.0.3.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

NextDots.RetargetlyLib.Android Readme

For latest changes: https://github.com/retargetly/sdk-xamarin-android/blob/master/README.md

EXTREMELY IMPORTANT SETUP

Please follow the guide to properly setup the NextDots.RetargetlyLib.Android inside of your application:

Additionally, see the permission setup below for Android to ensure everything is configured correct.

Additional Android Permission Setup

This plugin uses the Current Activity Plugin to get access to the current Android Activity. Be sure to complete the full setup if a MainApplication.cs file was not automatically added to your application. Please fully read through the Current Activity Plugin Documentation. At an absolute minimum you must set the following in your Activity's OnCreate method:

CrossCurrentActivity.Current.Activity.Init(this, bundle);

It is highly recommended that you use a custom Application that are outlined in the Current Activity Plugin Documentation](https://github.com/jamesmontemagno/CurrentActivityPlugin/blob/master/README.md)

Android specific in your BaseActivity or MainActivity (for Xamarin.Android) add this code:

Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);  //Important

Required Permissions:

ACCESS_COARSE_LOCATION
ACCESS_FINE_LOCATION
ACCESS_MOCK_LOCATION
ACCESS_WIFI_STATE
INTERNET

installation requirements

  • Install Microsoft Visual Studio with the Xamarin SDK
  • Create new Xamarin Android Project
  • Update Xamarin.Android.Support.Design Package
  • Install Nuget library NextDots.RetargetlyLib.Android 1.0.3.2
  • In the MainActivity initialize Geolocation Plugin
    • Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);

How to use the SDK?

Obtaining a CustomGPS object:

GeolocalizationClient retargetlyClient = new GeolocalizationClient();
await retargetlyClient.Init(this.Application, HashCode, true, true);

The init method has the following arguments:

/// <summary>
/// Method for invoke the GeoLocation and WIFI info.
/// </summary>
/// <param name="application">Application instance</param>
/// <param name="Hash_Code">Hash code provide by the client.</param>
/// <param name="sendGeoData">Send Geolocation flag</param>
/// <param name="forceGPS">Ask for GPS permissions</param>
/// <param name="minimumSeconds">Minimum Seconds for geolocation.</param>
/// <param name="minimumDistance">Minimun Distance for geolocation.</param>
/// <param name="keepAskingLocation">Keep Asking Geolocation flag.</param>
/// <returns>Returns CustomGPS Class with info about Gelocation and wifi info</returns>
public async Task<CustomGPS> Init(Application application, string Hash_Code, bool sendGeoData, bool forceGPS, int minimumSeconds = 60, double minimumDistance = 1000 * 60 * 1, bool keepAskingLocation = false)

PARAMETERS TO SEND IN EACH GPS AND CUSTOM EVENT

GeolocalizationClient retargetlyClient = new GeolocalizationClient();
            var result = await retargetlyClient.Init(this.Application, HashCode, true, true);
            var json_result = JsonConvert.SerializeObject(result);
            Toast.MakeText(this, json_result, ToastLength.Long).Show();

CHANGE THE EVENT SEND

RetargetlyUtils retargetlyUtils = new RetargetlyUtils();
            string InstalledApps = retargetlyUtils.GetInstalledApps(this.Application);
            Log.Info("RetargetlyLib.Android", InstalledApps);
            Toast.MakeText(this, InstalledApps, ToastLength.Long).Show();

NEW BEHAVIOR SENDING GPS INFO

GeolocalizationClient retargetlyClient = new GeolocalizationClient();
            var result = retargetlyClient.InvokeApiService("https://api.retargetly.com/sdk/params?source_hash=x9mfLt0ATihM0n0bI4PPuV9bbDNa1E3D");
            var json_result = JsonConvert.SerializeObject(result);
            Toast.MakeText(this, json_result, ToastLength.Long).Show();

Programmed automatic GPS sending


GeolocalizationClient retargetlyClient = new GeolocalizationClient();
            int seconds = 10;
            int meters = 10;
            await retargetlyClient.Init(this.Application, HashCode, true, true, seconds, meters, true);

DeepLink Implementation

new DeepLinkActivity(this.LocalClassName);//Activate DeepLinking
new DeepLinkActivity();//Activate DeepLinking
new DeepLinkActivity(this.LocalClassName.Replace(this.GetType().Name, typeof(Activity1).Name));
/*************************      DeepLink In        ******************/
            var res = this.Intent.GetStringExtra("DeepLinkUrl");
            if (res != null)
            {
                DeepLinkClient deepLinkClient = new DeepLinkClient();
                var result = JsonConvert.SerializeObject(deepLinkClient.GetRequestInfo(this.Application, HashCode));
                Toast.MakeText(this, result, ToastLength.Long).Show();
                DinamicURLCaso1.Text = res;
            }

NextDots.RetargetlyLib.Android Readme

For latest changes: https://github.com/retargetly/sdk-xamarin-android/blob/master/README.md

EXTREMELY IMPORTANT SETUP

Please follow the guide to properly setup the NextDots.RetargetlyLib.Android inside of your application:

Additionally, see the permission setup below for Android to ensure everything is configured correct.

Additional Android Permission Setup

This plugin uses the Current Activity Plugin to get access to the current Android Activity. Be sure to complete the full setup if a MainApplication.cs file was not automatically added to your application. Please fully read through the Current Activity Plugin Documentation. At an absolute minimum you must set the following in your Activity's OnCreate method:

CrossCurrentActivity.Current.Activity.Init(this, bundle);

It is highly recommended that you use a custom Application that are outlined in the Current Activity Plugin Documentation](https://github.com/jamesmontemagno/CurrentActivityPlugin/blob/master/README.md)

Android specific in your BaseActivity or MainActivity (for Xamarin.Android) add this code:

Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);  //Important

Required Permissions:

ACCESS_COARSE_LOCATION
ACCESS_FINE_LOCATION
ACCESS_MOCK_LOCATION
ACCESS_WIFI_STATE
INTERNET

installation requirements

  • Install Microsoft Visual Studio with the Xamarin SDK
  • Create new Xamarin Android Project
  • Update Xamarin.Android.Support.Design Package
  • Install Nuget library NextDots.RetargetlyLib.Android 1.0.3.2
  • In the MainActivity initialize Geolocation Plugin
    • Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, savedInstanceState);

How to use the SDK?

Obtaining a CustomGPS object:

GeolocalizationClient retargetlyClient = new GeolocalizationClient();
await retargetlyClient.Init(this.Application, HashCode, true, true);

The init method has the following arguments:

/// <summary>
/// Method for invoke the GeoLocation and WIFI info.
/// </summary>
/// <param name="application">Application instance</param>
/// <param name="Hash_Code">Hash code provide by the client.</param>
/// <param name="sendGeoData">Send Geolocation flag</param>
/// <param name="forceGPS">Ask for GPS permissions</param>
/// <param name="minimumSeconds">Minimum Seconds for geolocation.</param>
/// <param name="minimumDistance">Minimun Distance for geolocation.</param>
/// <param name="keepAskingLocation">Keep Asking Geolocation flag.</param>
/// <returns>Returns CustomGPS Class with info about Gelocation and wifi info</returns>
public async Task<CustomGPS> Init(Application application, string Hash_Code, bool sendGeoData, bool forceGPS, int minimumSeconds = 60, double minimumDistance = 1000 * 60 * 1, bool keepAskingLocation = false)

PARAMETERS TO SEND IN EACH GPS AND CUSTOM EVENT

GeolocalizationClient retargetlyClient = new GeolocalizationClient();
            var result = await retargetlyClient.Init(this.Application, HashCode, true, true);
            var json_result = JsonConvert.SerializeObject(result);
            Toast.MakeText(this, json_result, ToastLength.Long).Show();

CHANGE THE EVENT SEND

RetargetlyUtils retargetlyUtils = new RetargetlyUtils();
            string InstalledApps = retargetlyUtils.GetInstalledApps(this.Application);
            Log.Info("RetargetlyLib.Android", InstalledApps);
            Toast.MakeText(this, InstalledApps, ToastLength.Long).Show();

NEW BEHAVIOR SENDING GPS INFO

GeolocalizationClient retargetlyClient = new GeolocalizationClient();
            var result = retargetlyClient.InvokeApiService("https://api.retargetly.com/sdk/params?source_hash=x9mfLt0ATihM0n0bI4PPuV9bbDNa1E3D");
            var json_result = JsonConvert.SerializeObject(result);
            Toast.MakeText(this, json_result, ToastLength.Long).Show();

Programmed automatic GPS sending


GeolocalizationClient retargetlyClient = new GeolocalizationClient();
            int seconds = 10;
            int meters = 10;
            await retargetlyClient.Init(this.Application, HashCode, true, true, seconds, meters, true);

DeepLink Implementation

new DeepLinkActivity(this.LocalClassName);//Activate DeepLinking
new DeepLinkActivity();//Activate DeepLinking
new DeepLinkActivity(this.LocalClassName.Replace(this.GetType().Name, typeof(Activity1).Name));
/*************************      DeepLink In        ******************/
            var res = this.Intent.GetStringExtra("DeepLinkUrl");
            if (res != null)
            {
                DeepLinkClient deepLinkClient = new DeepLinkClient();
                var result = JsonConvert.SerializeObject(deepLinkClient.GetRequestInfo(this.Application, HashCode));
                Toast.MakeText(this, result, ToastLength.Long).Show();
                DinamicURLCaso1.Text = res;
            }

Release Notes

First Release.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.4.5 234 8/9/2018
1.0.4.4 204 8/9/2018
1.0.4.3 251 8/5/2018
1.0.4.2 202 8/3/2018
1.0.4.1 232 8/2/2018
1.0.4 211 8/2/2018
1.0.3.2 209 7/31/2018
1.0.3.1 204 7/31/2018
1.0.3 216 7/28/2018
1.0.1 205 7/28/2018
1.0.0 215 7/28/2018
Show less