connectSephoraNative static method

Future<void> connectSephoraNative()

Connect to Sephora natively (consent -> login -> scrape profile, basket, loves, purchases) This opens a WKWebView overlay for the user to log in to Sephora Once authenticated, it automatically extracts:

  • Profile data (name, email, VIB status, Beauty Insider points, preferences)
  • Basket/cart items
  • Loves/wishlist products
  • Purchase history

Implementation

static Future<void> connectSephoraNative() async {
  try {
    await platform.invokeMethod('connectSephoraNative');
    print('✅ [SEPHORA-SERVICE] Sephora connector opened');
  } on MissingPluginException catch (e) {
    // This usually means the native iOS plugin didn't get registered.
    print("❌ [SEPHORA-SERVICE] Missing native plugin implementation: $e");
    rethrow;
  } on PlatformException catch (e) {
    print("❌ [SEPHORA-SERVICE] Failed to connect Sephora: '${e.message}'");
    rethrow;
  } catch (e, st) {
    print("❌ [SEPHORA-SERVICE] Unexpected error starting Sephora connector: $e");
    print(st);
    rethrow;
  }
}