After I use the mobile device to scan the QR code, it only closes the modal but does not execute the OnAfterConnect function
Expected behavior
after scan QR Code, the WalletConnect.Instance.ActiveSessionChanged function will be executed
note*: i unchecked ResumeSessionOnInit boolean
Screenshots

My Code
private void Start()
{
//Application.targetFrameRate = Screen.currentResolution.refreshRate;
// When WalletConnectModal is ready, enable buttons and subscribe to other events.
// WalletConnectModal.SignClient can be null if WalletConnectModal is not ready.
WalletConnectModal.Ready += (sender, args) =>
{
//// SessionResumed is true if Modal resumed session from storage
if (args.SessionResumed)
{
OnAfterConnect();
Debug.Log(1);
}
else
{
OnAfterDisconnect();
Debug.Log(2);
}
// Invoked after wallet connected
WalletConnect.Instance.ActiveSessionChanged += (_, @struct) =>
{
if (string.IsNullOrEmpty(@struct.Topic))
return;
Debug.Log($"[WalletConnectModalSample] Session connected. Topic: {@struct.Topic}");
OnAfterConnect();
Debug.Log(3);
};
// Invoked after wallet disconnected
WalletConnect.Instance.SessionDisconnected += (_, _) =>
{
Debug.Log($"[WalletConnectModalSample] Session deleted.");
OnAfterDisconnect();
Debug.Log(4);
};
};
}
private void OnAfterConnect()
{
var UWM = UIWalletManager.Instance;
var address = GetAddress();
UWM.web3Manager.userAddress = address;
UWM.screenManager.ShowScreen("HOME");
UWM.web3Manager.loginWith = LoginWith.WCModal;
Debug.Log(address);
}
private void OnAfterDisconnect()
{
WalletConnectModal.Disconnect();
}
Environment
- OS: Android
- Unity version 2022.3.5f1
- Package name and version: WalletConnectUnity Modal v1.0.6
After I use the mobile device to scan the QR code, it only closes the modal but does not execute the
OnAfterConnectfunctionExpected behavior
after scan QR Code, the
WalletConnect.Instance.ActiveSessionChangedfunction will be executednote*: i unchecked
ResumeSessionOnInitbooleanScreenshots

My Code
Environment