configure method

  1. @override
Future<void> configure({
  1. required List<String> productIds,
  2. required List<String> lifetimeIds,
  3. int nonRenewableExpirationDays = 7,
  4. bool autoSortProducts = true,
  5. 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;
  }
}