Skip to main content

Mobile Integration

Run the Skin Analysis plugin in your mobile app with a WebView. It works on iOS, Android, React Native and Flutter.

Complete example apps: Swift · Kotlin · React Native · Flutter

How it works​

  1. Load the plugin URL in a WebView:

    https://plugin.pulpoar.com/skinai/<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 Skin Analysis URL above.

For example, on Android:

webView.settings.javaScriptEnabled = true
webView.settings.domStorageEnabled = true
webView.loadUrl("https://plugin.pulpoar.com/skinai/<project-key>")

Things to handle in your app​

  • Camera permission: add the camera permission to your app (NSCameraUsageDescription on iOS, android.permission.CAMERA on Android) and grant camera access to the WebView. Listen to onCameraPermissionDeny to handle a denied permission.
  • Go to Product: in a WebView, the plugin can't open product pages for you. Listen to onProductVisit and open the product page in your app.
  • Add to Cart: listen to onAddToCart and add the products to your app's cart.
  • Full screen: show the plugin full screen on phones, and lock the scroll of the screen behind it.
pulpoar.onProductVisit((payload) => {
postToNative({ event: 'onProductVisit', payload });
});