Top
Initialize Project ID
  • 19 May 2023
  • 1 Minute To Read
  • Dark
    Light
  • PDF

Initialize Project ID

  • Dark
    Light
  • PDF

Article Summary

After generating the Project ID, you have to initialize it in the required place in your code to show Whatfix Mobile content. You need to call the Leap.start() method with the argument as projectID as shown in the following code.

There are two ways to call the Leap.start() with the argument as projectID,

To start a project in between a deployment that is already live or to change the deployment as per the segment change

Android

Leap.startProject("PROJECT_ID");

Swift

Leap.shared.startProject(projectId: "PROJECT_ID")

Objective-C

[[Leap shared] startProject:@"PROJECT_ID" resetProject:NO];

React Native

LeapReactNative.startProject("PROJECT_ID", false)

Ionic

LeapPlugin.startProject({projectId:"<GENERATED_PROJECT_ID>"});

Cordova (Android)

cordova.plugins.LeapAndroid.startProject("PROJECT_ID");

Cordova (iOS)

cordova.plugins.LeapiOS.startProject("PROJECT_ID");

Xamarin Android

Leap.StartProject("PROJECT_ID");

Xamarin iOS

Leap.Shared.StartProject("PROJECT_ID")
Note
You can initialize the Project ID at every instance where an end user has to see the in-app experience.

To start a project by resetting the previous Flow termination or Element Termination conditions for the project

Android

// Pass `true` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID

Leap.startProject("PROJECT_ID", true);

Swift

// Pass `true` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID

Leap.shared.startProject("PROJECT_ID", resetProject: true)

Objective-C

// Pass `YES` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID

[[Leap shared] startProject:@"PROJECT_ID" resetProject:YES];

React Native

// Pass `true` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID

LeapReactNative.startProject("PROJECT_ID", true)

Ionic

LeapPlugin.startProject({projectId:"<GENERATED_PROJECT_ID>", resetProject:true});

Cordova (Android)

// Pass `true` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID

cordova.plugin.LeapAndroid.startProject("PROJECT_ID", true);

Cordova (iOS)

// Pass `true` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID

cordova.plugin.LeapiOS.startProject("PROJECT_ID", true);

Xamarin Android

// Pass `true` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID

Leap.StartProject("PROJECT_ID", true);

Xamarin iOS

// Pass `true` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID

Leap.Shared.StartProject("PROJECT_ID", true);

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.