Skip to content

Publish Whatfix Content

Initialize Project ID

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

Android

JavaJavaJava

Leap.startProject("PROJECT_ID");

Swift

Swift

SwiftSwiftSwift

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

Objective-C

Objective-C

Objective-CObjective-CObjective-C

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

React Native

React Native

JavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScript

LeapReactNative.startProject("PROJECT_ID", false)

Ionic

Ionic

JavaScriptJavaScriptJavaScript

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

Cordova (Android)

Cordova (Android)

JavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScript

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

Cordova (iOS)

Cordova (iOS)

JavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScript

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

Xamarin Android

Xamarin Android

JavaScriptJavaScriptJavaScript

Leap.StartProject("PROJECT_ID");

Xamarin iOS

Xamarin iOS

JavaScriptJavaScriptJavaScript

Leap.Shared.StartProject("PROJECT_ID")

NoteYou 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

Android

JavaJavaJava

// Pass `true` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID
 
Leap.startProject("PROJECT_ID", true);

Swift

Swift

SwiftSwiftSwift

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

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

React Native

JavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScript

// Pass `true` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID
 
LeapReactNative.startProject("PROJECT_ID", true)

Ionic

Ionic

JavaScriptJavaScriptJavaScript

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

Cordova (Android)

Cordova (Android)

JavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScript

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

Cordova (iOS)

JavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScriptJavaScript

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

Xamarin Android

JavaScriptJavaScriptJavaScript

// Pass `true` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID
 
Leap.StartProject("PROJECT_ID", true);

Xamarin iOS

Xamarin iOS

JavaScriptJavaScriptJavaScript

// Pass `true` to reset previous data of "Flow termination" 
// or "Element termination" for the PROJECT_ID
 
Leap.Shared.StartProject("PROJECT_ID", true);