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

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

Closed
jamauro opened this issue Oct 8, 2020 · 3 comments

Comments

@jamauro
Copy link

jamauro commented Oct 8, 2020

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
Copy link

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
Copy link
Contributor

Closed due to lack of interaction

@HoptimizeME
Copy link

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);

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

4 participants