feat(notification): integrate expo-notifications for permission handling and deep linking
Some checks failed
Frontend CI / ota-android (push) Successful in 1m27s
Frontend CI / build-and-push-web (push) Has been cancelled
Frontend CI / build-android-apk (push) Has been cancelled

- Add expo-notifications dependency and configure with JPush plugin
- Request notification permission on app launch for iOS/Android
- Handle notification taps to navigate to chat or notifications screen
- Add UI to check and request system notification permission in settings
- Refactor background sync: WebSocket disconnects in background, JPush handles push
- Add checkNotificationPermission() and requestNotificationPermission() to jpushService
This commit is contained in:
lafay
2026-04-28 00:20:07 +08:00
parent 296e649fbb
commit b7ce9e3b9a
8 changed files with 188 additions and 137 deletions

55
package-lock.json generated
View File

@@ -31,6 +31,7 @@
"expo-intent-launcher": "~55.0.9",
"expo-linear-gradient": "^55.0.8",
"expo-media-library": "~55.0.9",
"expo-notifications": "~55.0.0",
"expo-router": "^55.0.4",
"expo-sqlite": "~55.0.10",
"expo-status-bar": "~55.0.4",
@@ -1678,17 +1679,17 @@
}
},
"node_modules/@expo/image-utils": {
"version": "0.8.12",
"resolved": "https://registry.npmmirror.com/@expo/image-utils/-/image-utils-0.8.12.tgz",
"integrity": "sha512-3KguH7kyKqq7pNwLb9j6BBdD/bjmNwXZG/HPWT6GWIXbwrvAJt2JNyYTP5agWJ8jbbuys1yuCzmkX+TU6rmI7A==",
"version": "0.8.13",
"resolved": "https://registry.npmmirror.com/@expo/image-utils/-/image-utils-0.8.13.tgz",
"integrity": "sha512-1I//yBQeTY6p0u1ihqGNDAr35EbSG8uFEupFrIF0jd++h9EWH33521yZJU1yE+mwGlzCb61g3ehu78siMhXBlA==",
"license": "MIT",
"dependencies": {
"@expo/require-utils": "^55.0.4",
"@expo/spawn-async": "^1.7.2",
"chalk": "^4.0.0",
"getenv": "^2.0.0",
"jimp-compact": "0.16.1",
"parse-png": "^2.1.0",
"resolve-from": "^5.0.0",
"semver": "^7.6.0"
}
},
@@ -2053,9 +2054,9 @@
}
},
"node_modules/@expo/require-utils": {
"version": "55.0.3",
"resolved": "https://registry.npmmirror.com/@expo/require-utils/-/require-utils-55.0.3.tgz",
"integrity": "sha512-TS1m5tW45q4zoaTlt6DwmdYHxvFTIxoLrTHKOFrIirHIqIXnHCzpceg8wumiBi+ZXSaGY2gobTbfv+WVhJY6Fw==",
"version": "55.0.4",
"resolved": "https://registry.npmmirror.com/@expo/require-utils/-/require-utils-55.0.4.tgz",
"integrity": "sha512-JAANvXqV7MOysWeVWgaiDzikoyDjJWOV/ulOW60Zb3kXJfrx2oZOtGtDXDFKD1mXuahQgoM5QOjuZhF7gFRNjA==",
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.20.0",
@@ -4358,6 +4359,12 @@
"@babel/core": "^7.0.0"
}
},
"node_modules/badgin": {
"version": "1.2.3",
"resolved": "https://registry.npmmirror.com/badgin/-/badgin-1.2.3.tgz",
"integrity": "sha512-NQGA7LcfCpSzIbGRbkgjgdWkjy7HI+Th5VLxTJfW5EeaAf3fnS+xWQaQOCYiny+q6QSvxqoSO04vCx+4u++EJw==",
"license": "MIT"
},
"node_modules/balanced-match": {
"version": "4.0.4",
"resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-4.0.4.tgz",
@@ -5517,6 +5524,15 @@
}
}
},
"node_modules/expo-application": {
"version": "55.0.14",
"resolved": "https://registry.npmmirror.com/expo-application/-/expo-application-55.0.14.tgz",
"integrity": "sha512-NgqDIt3eCf4aVLp1L6AcEanCYoyJeuBsGrgGSzOIvxAsOvp5X3SYKW3ROgpKUnLQEKMWlzwETpjsUGszcqkk8g==",
"license": "MIT",
"peerDependencies": {
"expo": "*"
}
},
"node_modules/expo-asset": {
"version": "55.0.10",
"resolved": "https://registry.npmmirror.com/expo-asset/-/expo-asset-55.0.10.tgz",
@@ -5565,12 +5581,11 @@
}
},
"node_modules/expo-constants": {
"version": "55.0.9",
"resolved": "https://registry.npmmirror.com/expo-constants/-/expo-constants-55.0.9.tgz",
"integrity": "sha512-iBiXjZeuU5S/8docQeNzsVvtDy4w0zlmXBpFEi1ypwugceEpdQQab65TVRbusXAcwpNVxCPMpNlDssYp0Pli2g==",
"version": "55.0.15",
"resolved": "https://registry.npmmirror.com/expo-constants/-/expo-constants-55.0.15.tgz",
"integrity": "sha512-w394fcZLJjeKN+9ZnJzL/HiarE1nwZFDa+3S9frevh6Ur+MAAs9QDrcXhDrV8T3xqRzzYaqsP6Z8TFZ4efWN1A==",
"license": "MIT",
"dependencies": {
"@expo/config": "~55.0.10",
"@expo/env": "~2.1.1"
},
"peerDependencies": {
@@ -5831,6 +5846,24 @@
"react-native": "*"
}
},
"node_modules/expo-notifications": {
"version": "55.0.20",
"resolved": "https://registry.npmmirror.com/expo-notifications/-/expo-notifications-55.0.20.tgz",
"integrity": "sha512-ENwHZtr2ApR4VaqwwYluEi+ocip2rIkZfHQVi263fZXW3WWVuPa+VxWKtT0KLcvWYGld8lEqwAHWmFWPS6aG7A==",
"license": "MIT",
"dependencies": {
"@expo/image-utils": "^0.8.13",
"abort-controller": "^3.0.0",
"badgin": "^1.1.5",
"expo-application": "~55.0.14",
"expo-constants": "~55.0.15"
},
"peerDependencies": {
"expo": "*",
"react": "*",
"react-native": "*"
}
},
"node_modules/expo-router": {
"version": "55.0.7",
"resolved": "https://registry.npmmirror.com/expo-router/-/expo-router-55.0.7.tgz",