dominicstop / react-native-ios-context-menu

A react-native component to use context menu's (UIMenu) on iOS 13/14+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

presentMenu not working in some versions of iOS

zeta-gc opened this issue · comments

I'm having problems with the presentMenu function, in some versions of iOS when the function is called the application crashes, this happens with the production build but with the development build it doesn't happen. from iOS 17 and above this doesn't happen.

ERROR DETECTED ON iOS 16.7 AND iOS 16.6.1

Some logs:

Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x2838 objc_msgSend + 56
1 MyNight 0x8d8c outlined destroy of Any? + 4363029900 (:4363029900)
2 MyNight 0x61034 ContextMenuInteractionWrapper.presentMenuAtLocation(point:) + 30 (ContextMenuInteractionWrapper.swift:30)
3 MyNight 0x66b54 ContextMenuManager.presentMenu(atLocation:) + 138 (ContextMenuManager.swift:138)
4 MyNight 0x587c44 RNIContextMenuView.presentMenu() + 629 (RNIContextMenuView.swift:629)
5 MyNight 0x58f7c0 closure #1 in closure #4 in RNIContextMenuViewModule.definition() + 4368824256
6 MyNight 0x590a04 partial apply for closure #1 in closure #5 in RNIContextMenuViewModule.definition() + 4368828932
7 MyNight 0x42640 thunk for @escaping @callee_guaranteed () -> () + 4363265600 (:4363265600)
8 libdispatch.dylib 0x2320 _dispatch_call_block_and_release + 32
9 libdispatch.dylib 0x3eac _dispatch_client_callout + 20
10 libdispatch.dylib 0x126a4 _dispatch_main_queue_drain + 928
11 libdispatch.dylib 0x122f4 _dispatch_main_queue_callback_4CF + 44
12 CoreFoundation 0x98c28 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16
13 CoreFoundation 0x7a560 __CFRunLoopRun + 1992
14 CoreFoundation 0x7f3ec CFRunLoopRunSpecific + 612
15 GraphicsServices 0x135c GSEventRunModal + 164
16 UIKitCore 0x39cf58 -[UIApplication _run] + 888
17 UIKitCore 0x39cbbc UIApplicationMain + 340
18 MyNight 0x48f8 main + 7 (main.m:7)
19 ??? 0x1cca84dec (Mancante)

@zeta-gc Hi, unfortunately this is because it's using a private API under the hood

i'm currently busy with react-native-ios-adaptive-modal, but i'll look into it. In the meantime, can you give me more debug-related info? (like your build/device env, Xcode version used to build the app, simulator/device info, etc)

testflight_feedback.zip
com.gccode.mynight_issue_732d9308744b86ec6941f27fab9ee998_crash_session_635ffcd22d7a4985af20c0a07fb6e344_DNE_0_v2_stacktrace.txt

@dominicstop Hi, i dont have much info, i build the app with EAS [Expo Application Services].

more info about:

Dispositivo
Modello:iPhone 11
Orientamento:Verticale
RAM disponibile: 152.47 MB
Spazio libero su disco: 1.09 GB
Sistema operativo
Versione:16.6.1
Orientamento:Verticale
Con jailbreak:No
Arresto anomalo
Data:17 dic 2023, 23:28:36
Versione app:1.0.0 (8)

log provided by firebase crashlytics

@dominicstop Could you tell me which iOS version has this feature? So i can handle the crash

@zeta-gc hi, i've pushed a new commit containing a potential fix for this issue, and released new patch (version 0.8.2) of DGSwiftUtilities

this library uses DGSwiftUtilities for invoking the private API that allows for programmatically showing the context menu.

It'll take some time before the new version appears on cocoapods. can you test if this fixes the bug? (please re-open this issue, if the bug still persists).


iOS 17 - Release Build

Screenshot 2023-12-18 at 11 13 47 PM
Screen.Recording.2023-12-18.at.11.16.42.PM.mov

iOS 16 - Release Build

Screenshot 2023-12-18 at 11 17 45 PM
Screen.Recording.2023-12-18.at.11.18.16.PM.mov

@dominicstop tested right now, it works perferctly now. THANKS FOR YOUR WORK <3