Showing
5 changed files
with
17 additions
and
8 deletions
| @@ -30,7 +30,7 @@ class PushService with WidgetsBindingObserver { | @@ -30,7 +30,7 @@ class PushService with WidgetsBindingObserver { | ||
| 30 | int _retryAttempt = 0; | 30 | int _retryAttempt = 0; |
| 31 | 31 | ||
| 32 | Future<void> registerPushToken() async { | 32 | Future<void> registerPushToken() async { |
| 33 | - if (isOhos()) { | 33 | + if (!isOhos()) { |
| 34 | return; | 34 | return; |
| 35 | } | 35 | } |
| 36 | 36 |
| @@ -257,12 +257,21 @@ class WebSocketService with WidgetsBindingObserver { | @@ -257,12 +257,21 @@ class WebSocketService with WidgetsBindingObserver { | ||
| 257 | void didChangeAppLifecycleState(AppLifecycleState state) { | 257 | void didChangeAppLifecycleState(AppLifecycleState state) { |
| 258 | switch (state) { | 258 | switch (state) { |
| 259 | case AppLifecycleState.resumed: | 259 | case AppLifecycleState.resumed: |
| 260 | + // Do not wait for a background reconnect backoff after returning to | ||
| 261 | + // the foreground. A disconnected socket should be restored at once. | ||
| 262 | + if (_socket == null && !_isConnecting) { | ||
| 263 | + _cancelReconnect(); | ||
| 264 | + } | ||
| 260 | _connectIfNeeded(); | 265 | _connectIfNeeded(); |
| 261 | return; | 266 | return; |
| 262 | case AppLifecycleState.inactive: | 267 | case AppLifecycleState.inactive: |
| 263 | return; | 268 | return; |
| 264 | case AppLifecycleState.hidden: | 269 | case AppLifecycleState.hidden: |
| 265 | case AppLifecycleState.paused: | 270 | case AppLifecycleState.paused: |
| 271 | + // Keep the authenticated socket alive in the background. The OS may | ||
| 272 | + // still suspend networking or reclaim the process, in which case the | ||
| 273 | + // existing disconnect handler will reconnect when execution resumes. | ||
| 274 | + return; | ||
| 266 | case AppLifecycleState.detached: | 275 | case AppLifecycleState.detached: |
| 267 | _cancelReconnect(); | 276 | _cancelReconnect(); |
| 268 | _closeSocket(); | 277 | _closeSocket(); |
| 1 | { | 1 | { |
| 2 | "app": { | 2 | "app": { |
| 3 | "bundleName": "com.doublefeel.hmapp", | 3 | "bundleName": "com.doublefeel.hmapp", |
| 4 | - "vendor": "example", | ||
| 5 | - "versionCode": 1000000, | 4 | + "vendor": "DiDi", |
| 5 | + "versionCode": 100, | ||
| 6 | "versionName": "2.7.0", | 6 | "versionName": "2.7.0", |
| 7 | "icon": "$media:app_icon", | 7 | "icon": "$media:app_icon", |
| 8 | "label": "$string:app_name" | 8 | "label": "$string:app_name" |
| @@ -2,13 +2,13 @@ | @@ -2,13 +2,13 @@ | ||
| 2 | QA | 2 | QA |
| 3 | ======================== | 3 | ======================== |
| 4 | 4 | ||
| 5 | -# 构建 QA 包(给测试人员使用) | ||
| 6 | -hvigorw --mode module -p module=entry@qa -p product=qa -p buildMode=release assembleHap | 5 | +# 构建 QA APP 包(给测试人员使用) |
| 6 | +hvigorw --mode project -p product=qa -p buildMode=release assembleApp --analyze=normal --parallel --incremental --daemon | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | ======================== | 9 | ======================== |
| 10 | Release | 10 | Release |
| 11 | ======================== | 11 | ======================== |
| 12 | 12 | ||
| 13 | -# 构建 Release 包 | ||
| 14 | -hvigorw --mode module -p module=entry@release -p product=release -p buildMode=release assembleHap | ||
| 13 | +# 构建用于上架的 Release APP 包 | ||
| 14 | +hvigorw --mode project -p product=release -p buildMode=release assembleApp --analyze=normal --parallel --incremental --daemon |
| @@ -2,7 +2,7 @@ name: doublefeel_flutter | @@ -2,7 +2,7 @@ name: doublefeel_flutter | ||
| 2 | description: "A new Flutter project." | 2 | description: "A new Flutter project." |
| 3 | publish_to: 'none' | 3 | publish_to: 'none' |
| 4 | 4 | ||
| 5 | -version: 2.7.0+1000000 | 5 | +version: 2.7.0+100 |
| 6 | 6 | ||
| 7 | environment: | 7 | environment: |
| 8 | sdk: ^3.6.2 | 8 | sdk: ^3.6.2 |
-
Please register or login to post a comment