Getting Started

1. Installation

  1. Download WebEngage Xamarin.iOS Library.
  2. To consume this downloaded .DLL in your Xamarin.iOS app, you must add a reference to your Xamarin.iOS project by right-clicking on the References node of your project and selecting Add Reference.

2. Initialization

  1. Add the following properties to the Info.plist file of your project.
KeyTypeValueDescription
WEGLicenseCodeStringYour WebEngage license codeMandatory

If you have multiple apps, you can use the same license code for all of them.
UIBackgroundModesArrayfetch, locationOptional

Required if you want to track location updates in background.
WEGEnableLocationAuthorizationRequestStringALWAYS / IN_USE / NOOptional

Enables WebEngage SDK to request user to authorize for location on behalf of the app. If this is absent or the value is anything other than
ALWAYS or IN_USE, WebEngage SDK would not make any authorization request on behalf of the app. It will track location updates only if the app itself has sought relevant permissions from the user.
NSLocationAlwaysUsageDescriptionStringApp specific descriptionMandatory if:
The app makes authorization request to always use location, or
Value of WEGEnableLocationAuthorizationRequest is ALWAYS.
NSLocationWhenInUseUsageDescriptionStringApp specific descriptionMandatory if:
The app makes authorization request to use location when the app is in use, or
Value of WEGEnableLocationAuthorizationRequest is IN_USE.
WEGLogLevelStringDEFAULT / VERBOSEOptional

Available from SDK version 3.2. In VERBOSE mode, you get detailed SDK logs. VERBOSE mode logs are a superset of DEFAULT mode logs.
WEGEnvironmentStringDEFAULT / inOptional

If you're specifically using our India data center to store/access your data, please ensure that you specify in as the value for WEGEnvironment
WEGAlternateAppSupportBooleanYES / NOOptional

WebEngage supports running multiple apps within the same License Code.
Ensure that you are using Auth Keys instead of APNS Certificates for Push Notifications.
To enable Multi App Support, in app's Info.plist file, enter WEGAlternateAppSupport key as Boolean type & set it to YES.

Please note that this should not be used for Staging & Production builds of the same app.
  1. Initialize WebEngage SDK with your license code from FinishedLaunching callback of your AppDelegate class as shown below.
...
using WebEngageXamariniOS;

namespace YourNamespace
{
    [Register("AppDelegate")]
    public class AppDelegate : UIApplicationDelegate
    {
    	...
    	public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            ...
            WebEngage.SharedInstance().Application(application, launchOptions);
            return true;
        }
        ...
    }
}

Make sure you replace YOUR_WEBENGAGE_LICENSE_CODE with your WebEngage license code.

1438

Locating your WebEngage license code

As shown above, naviagte to the Account Setup section to find your license code. Your License Code might start with tilde (~).

3. Additional steps (Optional)

For other integration options such as location tracking, refer the Advanced section.

Next steps

Congratulations! You have now successfully integrated WebEngage with your Hybrid app and are now sending user session data to WebEngage.

Note that it may take a few minutes for your data to show up on the WebEngage dashboard. We suggest you meanwhile proceed to read the next sections to learn how to:

  1. Track user properties as attributes
  2. Track user actions as events
  3. Integrate push messaging
  4. Integrate in-app messaging