feat(background): implement user consent mechanism for auto-start functionality
Add auto-start consent system that requires explicit user permission before enabling background sync services. Users can now choose between silent mode (no auto-start) or background mode (15-minute sync intervals). - Add consent service with AutoStartMode enum and storage utilities - Create withRemoveAutoStart Expo plugin to disable Android auto-start defaults - Integrate consent checks into JPush service, background task manager, and foreground service - Add auto-start consent UI in notification settings with descriptive dialog - Update privacy policy with section 8 explaining auto-start scenarios and user controls - Change default sync mode from BATTERY_SAVER to DISABLED - Export reinitBackgroundService function for re-initializing after consent changes - Merge OTA Android and iOS workflows into matrix build - Add release signing config in withSigning plugin for Android - Expand .dockerignore with native credential and build artifact exclusions
This commit is contained in:
@@ -112,8 +112,10 @@ class JPushService {
|
||||
// Register listeners only once (idempotent guard)
|
||||
this._registerListeners();
|
||||
|
||||
// 退后台保持极光长连接,确保推送实时到达
|
||||
this._setBackgroundKeepLongConn(true);
|
||||
// 检查用户是否同意自启动,仅在同意后才保持后台长连接
|
||||
const { isAutoStartAllowed } = await import('../consent/autoStartConsent');
|
||||
const keepLongConn = isAutoStartAllowed();
|
||||
this._setBackgroundKeepLongConn(keepLongConn);
|
||||
|
||||
// 初始化 SDK
|
||||
JPush!.init({
|
||||
|
||||
Reference in New Issue
Block a user