microsoft / clarity-apps

Repo for distributing Clarity Apps packages
MIT License
43 stars 2 forks source link

Ionic Capacitor #46

Closed danielehrhardt closed 1 month ago

danielehrhardt commented 1 month ago

⚡️ WebView loaded

⚡️ ------ STARTUP JS ERROR ------

⚡️ ReferenceError: Can't find variable: ClarityPlugin ⚡️ URL: capacitor://localhost/main-LSHYXVST.js ⚡️ [error] - {} ⚡️ main-LSHYXVST.js:1:71819

⚡️ See above for help with debugging blank-screen issues

ibradwan commented 1 month ago

Hi @danielehrhardt,

Could you please provide more info like:

Thank you!

danielehrhardt commented 1 month ago

Hi @danielehrhardt,

Could you please provide more info like:

  • The steps you followed
  • The platform you're running the app on that gives you this error message
  • Your capacitor & Clarity version

Thank you!

Sure!

declare let ClarityPlugin: any; ClarityPlugin.initialize("-", success, failure, {isIonic: true});

SaadeldinBadr commented 1 month ago

Hello @danielehrhardt,

Currently, android is the only supported platform for ionic, so make sure to move the initialization block inside a similar if condition:

if(Capacitor.getPlatform() === "android") {
    // Call Clarity initialize.
   ClarityPlugin.initialize("-", success, failure, {isIonic: true});
}