OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
623 stars 213 forks source link

[Bug]: iOS crash on startup #973

Open esentis opened 1 week ago

esentis commented 1 week ago

What happened?

Hello,

Our app encountered an issue during the iOS review process, where it appears to hang on the splash screen during startup. According to the provided crash log, the crash seems related to OneSignal’s clearBadgeCount method, which may be called internally.

Thank you for your assistance.

The reviewer's device :

Device type: iPhone 13 mini
OS version: iOS 18.1

Steps to reproduce?

Unfortunately, we haven’t been able to reproduce this issue on our own devices, so we’re unsure of the specific conditions that trigger it. Any guidance on resolving or debugging this would be greatly appreciated.

What did you expect to happen?

Not crash

OneSignal Flutter SDK version

Release 5.2.7

Which platform(s) are affected?

Relevant log output

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: FRONTBOARD 2343432205 
<RBSTerminateContext| domain:10 code:0x8BADF00D explanation:scene-update watchdog transgression: app<com.example.app(E9661090-ADC1-42AD-8716-0E3C50183935)>:2555 exhausted real (wall clock) time allowance of 10.00 seconds
ProcessVisibility: Background
ProcessState: Running
WatchdogEvent: scene-update
WatchdogVisibility: Background
WatchdogCPUStatistics: (
"Elapsed total CPU time (seconds): 17.300 (user 14.820, system 2.480), 27% CPU",
"Elapsed application CPU time (seconds): 0.019, 0% CPU"
) reportType:CrashLog maxTerminationResistance:Interactive>

Triggered by Thread:  0

Thread 0 name:   Dispatch queue: com.apple.usernotifications.UNUserNotificationServiceConnection
Thread 0 Crashed:
0   libsystem_kernel.dylib                 0x1e897a688 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x1e897dd98 mach_msg2_internal + 80
2   libsystem_kernel.dylib                 0x1e897dcb0 mach_msg_overwrite + 424
3   libsystem_kernel.dylib                 0x1e897dafc mach_msg + 24
4   libdispatch.dylib                      0x1a02d8f14 _dispatch_mach_send_and_wait_for_reply + 544
5   libdispatch.dylib                      0x1a02d92b4 dispatch_mach_send_with_result_and_wait_for_reply + 60
6   libxpc.dylib                           0x220b1e930 xpc_connection_send_message_with_reply_sync + 256
7   Foundation                             0x19720a3ac __NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__ + 16
8   Foundation                             0x197206b14 -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 2160
9   Foundation                             0x19726e14c -[NSXPCConnection _sendSelector:withProxy:arg1:arg2:] + 128
10  Foundation                             0x19726df08 _NSXPCDistantObjectSimpleMessageSend2 + 68
11  UserNotifications                      0x1c3567f9c __70-[UNUserNotificationServiceConnection badgeNumberForBundleIdentifier:]_block_invoke + 240
12  libdispatch.dylib                      0x1a02be0d0 _dispatch_client_callout + 20
13  libdispatch.dylib                      0x1a02cd750 _dispatch_lane_barrier_sync_invoke_and_complete + 56
14  UserNotifications                      0x1c3567c5c -[UNUserNotificationServiceConnection badgeNumberForBundleIdentifier:] + 292
15  UserNotifications                      0x1c3567b0c -[UNUserNotificationCenter badgeNumber] + 48
16  UIKitCore                              0x19b1558cc -[UIApplication applicationIconBadgeNumber] + 44
17  OneSignalNotifications                 0x1040ab708 +[OSNotificationsManager clearBadgeCount:fromClearAll:] + 224
18  OneSignalFramework                     0x103d051ac +[OneSignal init] + 544
19  Runner                                 0x1030c4038 0x102540000 + 12075064
20  Runner                                 0x1030c3e74 0x102540000 + 12074612
21  Flutter                                0x107730b50 0x10715c000 + 6114128
22  Flutter                                0x1071bb2e8 0x10715c000 + 389864
23  libdispatch.dylib                      0x1a02bc370 _dispatch_call_block_and_release + 32
24  libdispatch.dylib                      0x1a02be0d0 _dispatch_client_callout + 20
25  libdispatch.dylib                      0x1a02cc9e0 _dispatch_main_queue_drain + 980
26  libdispatch.dylib                      0x1a02cc5fc _dispatch_main_queue_callback_4CF + 44
27  CoreFoundation                         0x1985bc204 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
28  CoreFoundation                         0x1985b9440 __CFRunLoopRun + 1996
29  CoreFoundation                         0x1985b8830 CFRunLoopRunSpecific + 588
30  GraphicsServices                       0x1e45981c4 GSEventRunModal + 164
31  UIKitCore                              0x19b11eeb0 -[UIApplication _run] + 816
32  UIKitCore                              0x19b1cd5b4 UIApplicationMain + 340
33  UIKitCore                              0x19b507fa8 0x19ad4c000 + 8109992
34  Runner                                 0x102548958 0x102540000 + 35160
35  dyld                                   0x1bdfa6ec8 start + 2724

Code of Conduct

zafarivaev commented 3 days ago

Same here. Did you manage to fix it?

nebis-software commented 3 days ago

I had a similar one, see here: https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/912#issuecomment-2481244849 not sure it is the same

zafarivaev commented 3 days ago

Not sure the above fixes the problem, my guess is that we can disable badge clearing logic by adding OneSignal_disable_badge_clearing: true to Info.plist. I will try to send another submission and see if Apple approves it

https://documentation.onesignal.com/docs/badges

zafarivaev commented 3 days ago

Apple approved this submission, so looks like it's a valid fix.

esentis commented 3 days ago

@zafarivaev Interesting, I'll do this aswell and close the issue if it'll be resolved.