Top
Launch a project on Button click
  • 11 Jul 2023
  • 1 Minute To Read
  • Dark
    Light
  • PDF

Launch a project on Button click

  • Dark
    Light
  • PDF

Article Summary

If you want to launch a project on the click of a button in your app, call embedProject with the Project ID when the button is clicked.

Android

Button yourButton = dialog.findViewById(R.id.your_button_id);
yourButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        Leap.embedProject("PROJECT_ID");     
    }
});

iOS

import LeapSDK

@IBAction func onButtonClick(_ sender:UIButton) {
    Leap.shared.embedProject("<PROJECT_ID>")
}

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.