更新 shenyan-app: APNs后台推送 + 通知点开进门 + cyberboss主动联系

- APNs: 修复AppDelegate推送回调转发(Bridging Header),设备token注册成功
- 通知: 点开系统通知直接进聊天屏, badge自动清零
- 主动联系: cyberboss守护进程, 3-60分钟随机判断, 按沈晏规则决定是否推送
- 气泡: 左右统一25%白色背景
- push-notification-ios包集成, Podfile更新

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 12:59:47 +08:00
parent 5c50698d64
commit d07d50dde5
6 changed files with 250 additions and 8 deletions

View File

@@ -29,8 +29,23 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
launchOptions: launchOptions
)
// register for push notifications bypasses broken Turbo Module impl
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { granted, _ in
if granted {
DispatchQueue.main.async { application.registerForRemoteNotifications() }
}
}
return true
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
RNCPushNotificationIOS.didRegisterForRemoteNotifications(withDeviceToken: deviceToken)
}
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
RNCPushNotificationIOS.didFailToRegisterForRemoteNotificationsWithError(error)
}
}
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {

View File

@@ -0,0 +1 @@
#import <RNCPushNotificationIOS/RNCPushNotificationIOS.h>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>