Skip to main content

Mobile Integration

Run the Hair Color Try-On plugin in your mobile app with a WebView. It works on iOS, Android, React Native and Flutter.

  1. Load the plugin URL in a WebView:

    https://plugin.pulpoar.com/hto/<project-key>
  2. Inject the SDK after the page loads, and subscribe to the events you need.

  3. Receive events: each event handler posts a JSON message to your native code through the platform's JavaScript bridge.

The WebView setup and bridge code are the same as for Makeup Virtual Try-On. Follow the platform steps in WebView integration and use the Hair Color URL above. Hair Color Try-On has no SDK actions, so you only need the events part.

Things to handle in your app​

  • Camera permission: grant camera permission in your native code before the WebView loads the plugin. Otherwise the live camera and take-photo options can't start.
  • Go to Product: listen to onGoToProduct and open the product page in your app.
  • Add to Cart: listen to onAddToCart and add the shades to your app's cart.
  • Full screen: show the plugin full screen on phones, and lock the scroll of the screen behind it.