microsoft / clarity-apps

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

Ionic Capacitor #46

Closed danielehrhardt closed 3 months ago

danielehrhardt commented 4 months 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 4 months ago

Hi @danielehrhardt,

Could you please provide more info like:

Thank you!

danielehrhardt commented 4 months 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 3 months 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});
}