Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

ygit/clevertap-xamarin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CleverTap Xamarin SDK

codebeat badge

The CleverTap Xamarin SDK for Mobile Customer Engagement and Analytics solutions

CleverTap brings together real-time user insights, an advanced segmentation engine, and easy-to-use marketing tools in one mobile marketing platform — giving your team the power to create amazing experiences that deepen customer relationships. Our intelligent mobile marketing platform provides the insights you need to keep users engaged and drive long-term retention and growth.

For more information check out our website and documentation.

Getting Started

Steps for Android

  1. Install the SDK

Use the CleverTap.Bindings.Android DLL file and add it to the References.

  1. Add Your CleverTap Credentials in AndroidManifest.xml
<meta-data
    android:name="CLEVERTAP_ACCOUNT_ID"
    android:value="Your CleverTap Account ID"/>
<meta-data
    android:name="CLEVERTAP_TOKEN"
    android:value="Your CleverTap Account Token"/>
<!-- IMPORTANT: To force use Google AD ID to uniquely identify  users, use the following meta tag. GDPR mandates that if you are using this tag, there is prominent disclousure to your end customer in their application. Read more about GDPR here - https://clevertap.com/blog/in-preparation-of-gdpr-compliance/ -->
<meta-data
    android:name="CLEVERTAP_USE_GOOGLE_AD_ID"
    android:value="1"/> 
  1. Enable Tracking by Adding Permissions

In your AndroidManifest.xml file, add the following snippet within the tags.

<application
    android:label="@string/app_name"
    android:icon="@drawable/ic_launcher"
    android:name="com.clevertap.android.sdk.Application">

Next add the snippet below in the same file, so the CleverTap Xamarin SDK can access the internet.

<!-- Required to allow the app to send events and user profile information -->
<uses-permission android:name="android.permission.INTERNET"/>
<!-- Recommended so that CleverTap knows when to attempt a network call -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  1. Initialize the CleverTap SDK
CleverTapAPI cleverTapAPI = CleverTapAPI.GetDefaultInstance(Android.App.Application.Context);
  1. Add Information to a User Profile
IDictionary<string, Java.Lang.Object> profileData = new Dictionary<string, Java.Lang.Object>();

profileData.Add("Name", "Jack Montana");    // String
profileData.Add("Identity", 61026032);      // String or number
profileData.Add("Email", "jack@gmail.com"); // Email address of the user
profileData.Add("Phone", "+14155551234");   // Phone (with the country code, starting with +)
profileData.Add("Gender", "M");             // Can be either M or F
profileData.Add("DOB", new Date());         // Date of Birth. Set the Date object to the appropriate value first - requires java.util


cleverTapAPI.PushProfile(profileData);
  1. Track Custom Events
cleverTapAPI.PushEvent("Product View Via Xamarin");

Follow the Xamarin Demo Project for examples

Steps for iOS

  1. Install the SDK

    Use the DLL and add it to the Reference

  2. Integrating the CleverTap SDK

    • Follow the integration instruction starting with Step 2 here.
    • Add CleverTap to your AppDelegate.cs in your FinishedLaunching method.
using CleverTapSDK;

public 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

    CleverTap.AutoIntegrate();
    return true;
}
  1. Track Custom Events
CleverTap.SharedInstance()?.RecordEvent("Product Viewed Via Xamarin");
  1. Add Information to a User Profile
var profileData = new NSDictionary(
    new NSString("Name"), new NSString("Jack Montana"),
    new NSString("Identity"), new NSString("61026032"),
    new NSString("Email"), new NSString("Jack Montana"),
    new NSString("Phone"), new NSString("14155551234"),
    new NSString("Gender"), new NSString("F"),
    new NSString("DOB"), new NSDate()
);
CleverTap.SharedInstance()?.ProfilePush(profileData);

Please checkout the Starter Project directory for the sample app.

Changelog

Check out the CleverTap Xamarin SDK Change Log here.

Questions?

If you have questions or concerns, raise an issue in this repository or you can reach out to the CleverTap support team at support@clevertap.com.

License

Check out the CleverTap Xamarin SDK License here.

About

CleverTap SDK for Xamarin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Assembly 43.6%
  • C# 38.2%
  • Java 15.2%
  • Objective-C 2.8%
  • C 0.2%