修复:补单功能bug修复
This commit is contained in:
parent
0de33cd575
commit
3edf55cacd
@ -4009,7 +4009,7 @@
|
||||
|------------|---------|------|------|
|
||||
| `selection` | `signature` | string | 签名 |
|
||||
| `gauge` | `purchaseData` | string | Google支付凭据JSON |
|
||||
| `timing` | `id` | string | 支付ID/订单ID |
|
||||
| `timing` | `id` | string | 支付ID/订单ID(逻辑名 `id`;app_client 直连接口常写作 `federation`) |
|
||||
| `symposium` | `userId` | string | 用户ID |
|
||||
|
||||
**V2 完整请求体**(填入业务值后 AES 加密,填入代理请求 `b 参数` 字段)
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import '../../core/auth/auth_service.dart';
|
||||
import '../../core/payment/google_play_order_recovery.dart';
|
||||
import '../../core/theme/app_colors.dart';
|
||||
import '../history/history_screen.dart';
|
||||
import '../home/home_screen.dart';
|
||||
@ -26,23 +22,6 @@ class MainScreen extends StatefulWidget {
|
||||
|
||||
class _MainScreenState extends State<MainScreen> {
|
||||
int _index = 0;
|
||||
VoidCallback? _cancelLoginRecoveryHook;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_cancelLoginRecoveryHook = AuthService.whenLoginSucceeded(
|
||||
onReady: () {
|
||||
unawaited(runGooglePlayOrderRecovery());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_cancelLoginRecoveryHook?.call();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:client_proxy_framework/client_proxy_framework.dart';
|
||||
|
||||
import 'app.dart';
|
||||
import 'core/auth/auth_service.dart';
|
||||
import 'core/payment/google_play_order_recovery.dart';
|
||||
|
||||
Future<void> main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@ -23,7 +25,15 @@ Future<void> main() async {
|
||||
),
|
||||
);
|
||||
|
||||
// 与 app_client main 一致:尽早订阅 purchaseStream,否则未确认订单可能不进 queryPastPurchases,补单为空。
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
PaymentService.startPendingPurchaseListener();
|
||||
}
|
||||
|
||||
// 与 app_client 一致:先首帧再异步登录,由 [App] 内遮罩等待 [loginComplete]
|
||||
runApp(App(title: ClientBootstrap.skin.appName));
|
||||
unawaited(AuthService.init());
|
||||
AuthService.loginComplete.then((_) {
|
||||
unawaited(runGooglePlayOrderRecovery());
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user