@proveanything/smartlinks-auth-ui 0.3.5 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -13445,10 +13445,45 @@ const SmartlinksAuthUI = ({ apiEndpoint, clientId, clientName, accountData, onAu
13445
13445
  console.log(`${LOG_PREFIX} 📤 Calling nativeBridge.signInWithGoogle with payload object:`, payloadObj);
13446
13446
  console.log(`${LOG_PREFIX} 📤 Payload JSON string:`, payload);
13447
13447
  log.log('Invoking native signInWithGoogle with payload:', payloadObj);
13448
- nativeBridge.signInWithGoogle(payload);
13449
- console.log(`${LOG_PREFIX} nativeBridge.signInWithGoogle called successfully`);
13450
- console.log(`${LOG_PREFIX} Waiting for native callback...`);
13451
- console.log(`${LOG_PREFIX} 💡 Android should use serverClientId for GoogleSignInOptions.Builder().requestIdToken(serverClientId)`);
13448
+ // 🔍 DEBUG: Re-validate bridge before invocation
13449
+ console.log(`${LOG_PREFIX} 🔍 Re-validating bridge before invocation...`);
13450
+ console.log(`${LOG_PREFIX} 🔍 window.Android:`, window.Android);
13451
+ console.log(`${LOG_PREFIX} 🔍 window.Android.signInWithGoogle:`, window.Android?.signInWithGoogle);
13452
+ console.log(`${LOG_PREFIX} 🔍 typeof signInWithGoogle:`, typeof window.Android?.signInWithGoogle);
13453
+ console.log(`${LOG_PREFIX} 🔍 nativeBridge === window.Android:`, nativeBridge === window.Android);
13454
+ console.log(`${LOG_PREFIX} 🔍 nativeBridge.signInWithGoogle:`, nativeBridge.signInWithGoogle);
13455
+ console.log(`${LOG_PREFIX} 🔍 typeof nativeBridge.signInWithGoogle:`, typeof nativeBridge.signInWithGoogle);
13456
+ // 🔍 DEBUG: Bridge method comparison
13457
+ console.log(`${LOG_PREFIX} 🔍 Bridge method comparison:`);
13458
+ const android = window.Android;
13459
+ if (android) {
13460
+ console.log(`${LOG_PREFIX} - signInWithGoogle: ${typeof android.signInWithGoogle} | descriptor:`, Object.getOwnPropertyDescriptor(android, 'signInWithGoogle'));
13461
+ console.log(`${LOG_PREFIX} - signOutGoogle: ${typeof android.signOutGoogle} | descriptor:`, Object.getOwnPropertyDescriptor(android, 'signOutGoogle'));
13462
+ console.log(`${LOG_PREFIX} - checkGoogleSignIn: ${typeof android.checkGoogleSignIn} | descriptor:`, Object.getOwnPropertyDescriptor(android, 'checkGoogleSignIn'));
13463
+ console.log(`${LOG_PREFIX} - All keys:`, Object.keys(android));
13464
+ try {
13465
+ console.log(`${LOG_PREFIX} - Prototype:`, Object.getPrototypeOf(android));
13466
+ }
13467
+ catch (e) {
13468
+ console.log(`${LOG_PREFIX} - Prototype: (error getting prototype)`, e);
13469
+ }
13470
+ }
13471
+ // 🔍 DEBUG: Wrap invocation in try/catch to capture exact exception
13472
+ try {
13473
+ console.log(`${LOG_PREFIX} 📤 About to invoke nativeBridge.signInWithGoogle...`);
13474
+ nativeBridge.signInWithGoogle(payload);
13475
+ console.log(`${LOG_PREFIX} ✅ nativeBridge.signInWithGoogle called successfully`);
13476
+ console.log(`${LOG_PREFIX} ⏳ Waiting for native callback...`);
13477
+ console.log(`${LOG_PREFIX} 💡 Android should use serverClientId for GoogleSignInOptions.Builder().requestIdToken(serverClientId)`);
13478
+ }
13479
+ catch (invokeError) {
13480
+ console.error(`${LOG_PREFIX} 💥 EXCEPTION invoking signInWithGoogle:`, invokeError);
13481
+ console.error(`${LOG_PREFIX} 💥 Error type:`, typeof invokeError);
13482
+ console.error(`${LOG_PREFIX} 💥 Error constructor:`, invokeError?.constructor?.name);
13483
+ console.error(`${LOG_PREFIX} 💥 Error message:`, invokeError?.message);
13484
+ console.error(`${LOG_PREFIX} 💥 Error stack:`, invokeError?.stack);
13485
+ throw invokeError; // Re-throw so it propagates normally
13486
+ }
13452
13487
  // Don't set loading to false - waiting for native callback
13453
13488
  return;
13454
13489
  }