Open
Description
versions: walletconnect_dart: ^0.0.11
I just want to get the wallet address, so I use killSession
after createSession
returns the result, but I still see a connection in the wallet app.
i have tried this MR #75 , but not work.
Reproduce step
- run sample code
- click
Get Addresses
button - choose
trust wallet
(you can choose other wallet, i believe have same behavior) - the
wallet app
will show authorize popup, clickconnect
wallet app
will back to sample app automatically and return some information including waller address- After received the waller address,
killSession
will be executed - back to
wallet app
manually - find
WalletConnect
page, check connecting list
Expected result:
not find sample app, since already killSession
Actual result:
sample app in connecting list
Video
document_6282579707053475856.mp4
Sample code
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
final WalletConnect connector = WalletConnect(
bridge: 'https://bridge.walletconnect.org',
clientMeta: const PeerMeta(
name: 'My App',
// if description is null, trust wallet (iOS 7.20 (691)) will not show the connection request
description: 'An app for converting pictures to NFT',
url: 'https://walletconnect.org',
icons: ['https://files.gitbook.com/v0/b/gitbook-legacy-files/o/spaces%2F-LJJeCjcLrr53DcT1Ml7%2Favatar.png?alt=media'],
),
);
void getAddresses() async {
try {
var session = await connector.createSession(
onDisplayUri: (uri) async {
await launchUrlString(
uri.toString(),
mode: LaunchMode.externalApplication,
);
},
);
print('address: ${session.accounts}');
// kill session
await connector.killSession();
} catch (e) {}
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: TextButton(
onPressed: getAddresses,
child: const Text('Get Addresses'),
),
),
);
}
}
flutter doctor
[✓] Flutter (Channel stable, 3.3.7, on macOS 13.0 22A380 darwin-arm, locale zh-Hant-HK)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.72.2)
[✓] Connected device (4 available)
[✓] HTTP Host Availability
Metadata
Metadata
Assignees
Labels
No labels