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.
-
Load the plugin URL in a WebView:
https://plugin.pulpoar.com/hto/<project-key> -
Inject the SDK after the page loads, and subscribe to the events you need.
-
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
onGoToProductand open the product page in your app. - Add to Cart: listen to
onAddToCartand 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.