更新 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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user