Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppHang - [MPApplication updateBadgeNumber] #259

Open
AnilVarghese opened this issue Mar 4, 2024 · 2 comments
Open

AppHang - [MPApplication updateBadgeNumber] #259

AnilVarghese opened this issue Mar 4, 2024 · 2 comments

Comments

@AnilVarghese
Copy link

Hi we are observing an app hang related MPApplication updateBadgeNumber. Suspecting that it could be because updateBadgeNumber method uses the deprecated applicationIconBadgeNumber API to read the badge number. Apple suggests to use setBadgeCount(_:withCompletionHandler:) instead where you can only the set the badge. There is no option to read AFAIK.

What is not making sense is that applicationIconBadgeNumber is deprecated in iOS 17 and hang happening across all iOS versions (iOS 14 -16 ) since one month. Also we are not sure why mParticle is reading the badge number? can this be avoided?

App Hang: The app was terminated while unresponsive

0  libsystem_kernel.dylib +0x1174 _mach_msg2_trap
1  libsystem_kernel.dylib +0xf0c  _mach_msg2_internal
2  libsystem_kernel.dylib +0xe24  _mach_msg_overwrite
3  libsystem_kernel.dylib +0xc64  _mach_msg
4  libdispatch.dylib +0x1eefc     __dispatch_mach_send_and_wait_for_reply
5  libdispatch.dylib +0x1f29c     _dispatch_mach_send_with_result_and_wait_for_reply
6  libxpc.dylib +0x106d0          _xpc_connection_send_message_with_reply_sync
7  Foundation +0x37bcc            ___NSXPCCONNECTION_IS_WAITING_FOR_A_SYNCHRONOUS_REPLY__
8  Foundation +0x202e4            -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]
9  Foundation +0x399cc            -[NSXPCConnection _sendSelector:withProxy:arg1:arg2:]
10 Foundation +0x398f8            __NSXPCDistantObjectSimpleMessageSend2
11 UserNotifications +0x43f0      ___70-[UNUserNotificationServiceConnection badgeNumberForBundleIdentifier:]_block_invoke
12 libdispatch.dylib +0x42fc      __dispatch_client_callout
13 libdispatch.dylib +0x136b0     __dispatch_lane_barrier_sync_invoke_and_complete
14 UserNotifications +0x4d84      -[UNUserNotificationServiceConnection badgeNumberForBundleIdentifier:]
15 UserNotifications +0x4c34      -[UNUserNotificationCenter badgeNumber]
16 UIKitCore +0x38d2d0            -[UIApplication applicationIconBadgeNumber]
17 mParticle_Apple_SDK +0x6818    +[MPApplication updateBadgeNumber] (MPApplication.m:393:73)
18 mParticle_Apple_SDK +0x922e4   __22-[MPStateMachine init]_block_invoke (MPStateMachine.m:141:13)
19 libdispatch.dylib +0x26a4      __dispatch_call_block_and_release
20 libdispatch.dylib +0x42fc      __dispatch_client_callout
21 libdispatch.dylib +0x12994     __dispatch_main_queue_drain
22 libdispatch.dylib +0x125ac     __dispatch_main_queue_callback_4CF
23 CoreFoundation +0x36f98        ___CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
24 CoreFoundation +0x33ca4        ___CFRunLoopRun
25 CoreFoundation +0x333f4        _CFRunLoopRunSpecific
26 GraphicsServices +0x34f4       _GSEventRunModal
27 UIKitCore +0x22c89c            -[UIApplication _run]
28 UIKitCore +0x22bed8            _UIApplicationMain
29 Glover +0xc074                 main (main.swift:12:1)
30 dyld +0x5dc8                   start
@samdozor
Copy link
Member

Hi @AnilVarghese! Sorry for the delay. This was read historically such that mParticle could integrate server-to-server with various integrations, such as those that send push notifications. Given this is deprecated we can definitely remove it. We are spinning up a bug internally for this and will notify here when it's been removed. Thank you for the report!

@AnilVarghese
Copy link
Author

I guess this issue can be closed now, this PR #277 fixes the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants