configure method
Future<void>
configure({
- required List<
String> productIds, - required List<
String> lifetimeIds, - int nonRenewableExpirationDays = 7,
- bool autoSortProducts = true,
- bool showLog = true,
override
配置产品
Implementation
@override
Future<void> configure({
required List<String> productIds,
required List<String> lifetimeIds,
int nonRenewableExpirationDays = 7,
bool autoSortProducts = true,
bool showLog = true,
}) async {
_showLog = showLog;
safeLog('📤 [MethodChannel] 调用 configure');
safeLog('📤 [MethodChannel] productIds: $productIds');
safeLog('📤 [MethodChannel] lifetimeIds: $lifetimeIds');
safeLog(
'📤 [MethodChannel] nonRenewableExpirationDays: $nonRenewableExpirationDays',
);
safeLog('📤 [MethodChannel] autoSortProducts: $autoSortProducts');
safeLog('📤 [MethodChannel] showLog: $showLog');
try {
await methodChannel.invokeMethod('configure', {
'productIds': productIds,
'lifetimeIds': lifetimeIds,
'nonRenewableExpirationDays': nonRenewableExpirationDays,
'autoSortProducts': autoSortProducts,
'showLog': showLog,
});
safeLog('✅ [MethodChannel] configure 成功');
} catch (e, stackTrace) {
safeLog(
'❌ [MethodChannel] configure 失败: $e',
error: e,
stackTrace: stackTrace,
);
rethrow;
}
}