Top
Initialize Project ID
  • 13 Jun 2024
  • 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

JavaJava
Leap.startProject("PROJECT_ID");

Swift

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

Objective-C

Objective-CObjective-C
[[Leap shared] startProject:@"PROJECT_ID" resetProject:NO];

React Native

JavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScript
LeapReactNative.startProject("PROJECT_ID", false)

Ionic

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

Cordova (Android)

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

Cordova (iOS)

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

Xamarin Android

JavaScriptJavaScript
Leap.StartProject("PROJECT_ID");

Xamarin iOS

JavaScriptJavaScript
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

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

Leap.startProject("PROJECT_ID", true);

Swift

SwiftSwift
// 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

Objective-CObjective-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

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

LeapReactNative.startProject("PROJECT_ID", true)

Ionic

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

Cordova (Android)

JavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScript
// 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)

JavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScript
// 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

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

Leap.StartProject("PROJECT_ID", true);

Xamarin iOS

JavaScriptJavaScript
// 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.