activitree / meteor-push

Meteor Push Notifications for Cordova and Web/PWA with Firebase (FCM).
MIT License
27 stars 19 forks source link

Main Thread Checker: UI API called on a background thread: -[UIApplication setApplicationIconBadgeNumber:] #30

Closed jamauro closed 3 years ago

jamauro commented 3 years ago

Seeing this error in the Xcode console Main Thread Checker: UI API called on a background thread: -[UIApplication setApplicationIconBadgeNumber:]

It looks like my Cordova app hangs for ~5 seconds with a blank white screen because of it and then I see the prompt to allow push notifications. Curious if others are seeing the same thing. Is this caused by an underlying dependency?

rodcisal commented 3 years ago

I'm actually having the same issue. Since it doesn't stop the notifications from working I haven't paid much attention to it. Any idea on what's going on?

Thanks

paulincai commented 3 years ago

Closed due to lack of interaction

HoptimizeME commented 2 years ago

The solution is to remove clearBadge:true from the Configure because the configure, in phonegap-plugin-push, is run in a background thread and newer iOS versions don't seem to appreciate it very much.

We must then run it manually from our code:

CordovaPush.push.setApplicationIconBadgeNumber(
    function () {console.log('setApplicationIconBadgeNumber2(0) successcallback');},
    function () {console.log('setApplicationIconBadgeNumber2(0) errorcallback');}, 0);