reown-com / appkit

The full stack toolkit to build onchain app UX
https://reown.com/appkit
Apache License 2.0
4.94k stars 1.41k forks source link

[bug] Why don't events trigger in mobile browsers? #3270

Open gwz-365461760 opened 2 days ago

gwz-365461760 commented 2 days ago

Link to minimal reproducible example

Intranet test

Summary

Why don't events trigger in mobile browsers? For example, how to trigger events when returning to the web page after successfully connecting to metamask?

`const appKit = createAppKit({ adapters: [wagmiAdapter], projectId, metadata: {...}, features: { email: false, socials: false, emailShowWallets: false, }, networks, themeMode: 'light' });

    modal.value = appKit;

    appKit.subscribeEvents((event) => {
      let CONNECT_SUCCESS = event.data.event
      if (CONNECT_SUCCESS === "CONNECT_SUCCESS") {
        console.log("CONNECT_SUCCESS")
      }

      if ((CONNECT_SUCCESS === "MODAL_CLOSE" || CONNECT_SUCCESS === "CONNECT_ERROR") && isConnectWallet.value) {
        console.log("MODAL_CLOSE")
      }

    })`

List of related npm package versions

` "@reown/appkit": "^1.3.2", "@reown/appkit-adapter-wagmi": "^1.3.2", "@tanstack/vue-query": "^5.59.20", "@wagmi/vue": "^0.0.63", "bootstrap": "^5.3.3", "buffer": "^6.0.3", "core-js": "^3.8.3", "crypto": "^1.0.1", "ethers": "5.7.2", "lodash-es": "^4.17.21", "viem": "^2.21.45", "vue": "^3.2.13", "vue-i18n": "^10.0.0", "vue-router": "^4.4.5", "vuex": "^4.1.0"

`