mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-07-31 08:17:22 +02:00
feat(extensions): complete signed-session grants from help dialog
Add a platform bridge to finish session grants on Android and iOS with JSON success validation, let users paste callback URLs from the clipboard, and auto-dismiss the verification help dialog after grant.
This commit is contained in:
@@ -547,9 +547,7 @@ class PlatformBridge {
|
||||
}
|
||||
|
||||
static Future<void> setAllowPrivateNetwork(bool allowed) async {
|
||||
await _channel.invokeMethod('setAllowPrivateNetwork', {
|
||||
'allowed': allowed,
|
||||
});
|
||||
await _channel.invokeMethod('setAllowPrivateNetwork', {'allowed': allowed});
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> checkDuplicate(
|
||||
@@ -1468,6 +1466,22 @@ class PlatformBridge {
|
||||
});
|
||||
}
|
||||
|
||||
static Future<bool> completeExtensionSessionGrant(
|
||||
String extensionId,
|
||||
String grant,
|
||||
) async {
|
||||
_log.d('completeExtensionSessionGrant: $extensionId');
|
||||
final result = await _channel.invokeMethod(
|
||||
'completeExtensionSessionGrant',
|
||||
{'extension_id': extensionId, 'grant': grant},
|
||||
);
|
||||
final success = result != false;
|
||||
_extensionSessionGrantEvents.add(
|
||||
ExtensionSessionGrantEvent(extensionId: extensionId, success: success),
|
||||
);
|
||||
return success;
|
||||
}
|
||||
|
||||
static Future<void> setExtensionTokens(
|
||||
String extensionId, {
|
||||
required String accessToken,
|
||||
|
||||
Reference in New Issue
Block a user