bdaTrackPurchase method
Future<bool>
bdaTrackPurchase(
- int payAmount, {
- String contentType = 'recharge',
- String contentName = '会员',
- String orderId = '',
- String payType = '支付宝',
override
Implementation
@override
Future<bool> bdaTrackPurchase(
int payAmount, {
String contentType = 'recharge',
String contentName = '会员',
String orderId = '',
String payType = '支付宝',
}) async {
final Map<String, dynamic> args = <String, dynamic>{
'payAmount': payAmount,
'contentType': contentType,
'contentName': contentName,
'orderId': orderId,
'payType': payType,
};
if (_isIOS) {
final result = await generalMethodChannel.invokeMethod<bool>(
'bda_trackPurchase',
args,
);
return result ?? false;
}
// Android 现有实现未返回 result,保持 fire-and-forget 避免 Future 卡住。
unawaited(generalMethodChannel.invokeMethod<void>('trackPurchase', args));
return true;
}