openURL method
Implementation
Future<void> openURL({
required String url,
String? wechatRedirectURI,
}) async {
final refreshToken = _refreshToken;
if (refreshToken == null) {
throw Exception("openURL requires authenticated user");
}
final targetURL = await internalGenerateURL(
redirectURI: url,
wechatRedirectURI: wechatRedirectURI,
);
try {
await _uiImplementation.openAuthorizationURL(
url: targetURL.toString(),
redirectURI: "nocallback://nocallback",
shareCookiesWithDeviceBrowser: false,
);
} catch (e) {
if (e is CancelException) {
// Ignore CancelException.
return;
}
rethrow;
}
}