Open pablop94 opened 3 years ago
same issue here with
Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: Unbalanced call to dispatch_group_leave()
starting with iOS 14. could you solve this @pablop94 ?
Thread 0 name:
Thread 0 Crashed:
0 libdispatch.dylib 0x00000001aa9807d8 dispatch_group_leave.cold.1 + 36 (semaphore.c:0)
1 libdispatch.dylib 0x00000001aa94dc00 dispatch_group_leave + 140 (semaphore.c:0)
2 libdispatch.dylib 0x00000001aa94b24c _dispatch_call_block_and_release + 32 (init.c:1454)
3 libdispatch.dylib 0x00000001aa94cdb0 _dispatch_client_callout + 20 (object.m:559)
4 libdispatch.dylib 0x00000001aa95a7ac _dispatch_main_queue_callback_4CF + 836 (inline_internal.h:2548)
5 CoreFoundation 0x00000001aacd411c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 (CFRunLoop.c:1790)
6 CoreFoundation 0x00000001aacce120 __CFRunLoopRun + 2508 (CFRunLoop.c:3118)
7 CoreFoundation 0x00000001aaccd21c CFRunLoopRunSpecific + 600 (CFRunLoop.c:3242)
8 GraphicsServices 0x00000001c27d1784 GSEventRunModal + 164 (GSEvent.c:2259)
9 UIKitCore 0x00000001ad70bfe0 -[UIApplication _run] + 1072 (UIApplication.m:3253)
10 UIKitCore 0x00000001ad711854 UIApplicationMain + 168 (UIApplication.m:4707)
11 Test PSA en Acción 0x00000001005a49c0 main + 56 (main.m:32)
12 libdyld.dylib 0x00000001aa98d6b0 start + 4
the code fails here after user clicks onto the push notification in iOS notification center: https://github.com/havesource/cordova-plugin-push/blob/2ba3a882f78a3daf635202cba4a9e5d6d8ffeaf9/src/ios/AppDelegate%2Bnotification.m#L103
log:
Push Plugin key: content-available
Push Plugin key: alert
Push Plugin key: category
Push Plugin key: sound
Push Plugin register success: {length = 32, bytes = ... }
Push Plugin finish called
Push Plugin stopBackgroundTask called
Push Plugin handlerObj
Push Plugin: stopBackgroundTask (remaining t: ...)
it seems like this handler is called multiple times, which leads into this error on the second time.
@erisu could you have a look into this?
@cyptus Don't set the "content-available" field to fcm payload unless you absolutely need background notifications. It seems to be called handler multiple times.
When set the "content-available" field: https://github.com/havesource/cordova-plugin-push/blob/master/src/ios/AppDelegate%2Bnotification.m#L99 https://github.com/havesource/cordova-plugin-push/blob/master/src/ios/AppDelegate%2Bnotification.m#L103
Call PushNotification.finish() https://github.com/havesource/cordova-plugin-push/blob/master/src/ios/PushPlugin.m#L583 https://github.com/havesource/cordova-plugin-push/blob/master/src/ios/PushPlugin.m#L604
Same issue here, causing serious disturbance on our app since background notifications are mandatory. Sad to see such an important plugin abandoned (instead of being part of the core of Cordova).
I hacked a dirty workaround for the issue: it counts how many times the completion handler was called, avoiding calling it multiple times. I'm not opening a PR because this is not a solution, and it potentially have two drawbacks:
How to use it: I have no clue how to do it cleanly nowadays. My cordova plugin add
randomly fails at me, and my best resort was to entirely re-clone our repo, manually change the plugin's version at package.json
to github:igorsantos07/cordova-plugin-push#patch-1
, then cordova add platform ios
and run the application 🤷♂️
I also had some trouble with the compilation because, with the multiple reinstallation tries of the main plugin/fork, it included a new config key IOS_FIREBASE_MESSAGING_VERSION
pointing to 6.32.2, which broke compilation.... But further tries moved that to 8.1.1 (no clue why/how), which seems to work (we didn't have this key before and it worked great, go wonder).
Hi, how are you?
I'm experiencing a weird issue in iOS build. When the user receives a notification an taps on it, the app is opened and crashes. I'm not able to reproduce the issue in the simulator, notifications are working as expected.
Expected Behaviour
The app is opened
Actual Behaviour
The app crashes.
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
iPhone12,8
cordova info
PrintoutIonic:
Ionic CLI : 6.12.2 (/usr/local/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 5.6.4 @angular-devkit/build-angular : 0.901.15 @angular-devkit/schematics : 9.1.15 @angular/cli : 9.1.15 @ionic/angular-toolkit : 2.3.3
Cordova:
Cordova CLI : 10.0.0 Cordova Platforms : 5.0.4, android 9.1.0, browser, ios 6.1.1 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 10 other plugins)
Utility:
cordova-res (update available: 0.15.3) : 0.15.1 native-run : 1.3.0
System:
ios-deploy : 1.10.0 ios-sim : 8.0.2 NodeJS : v12.13.0 (/usr/local/bin/node) npm : 6.12.0 OS : macOS Catalina Xcode : Xcode 12.4 Build version 12D4e
Logs taken while reproducing problem
I see this crashlog in TestFlight, attached. crashlog.txt
Let me know if you have any doubts