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

Running setApplicationIconBadgeNumber on mainThread #970

Merged
merged 1 commit into from
Aug 5, 2021

Conversation

emawby
Copy link
Contributor

@emawby emawby commented Aug 5, 2021

This is a UIApplication method so we need to run it on the main thread. It can be run on background threads through wrapper SDKs.

This fixes react-native issue 1262


This change is Reviewable

Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a formatting nit, code looks good.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @emawby, @Jeasmine, and @nan-li)


iOS_SDK/OneSignalSDK/Source/OneSignal.m, line 2225 at r1 (raw file):

    if (fromNotifOpened || wasBadgeSet) {
        [OneSignalHelper runOnMainThread:^{
                    [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];

nit, remove extra indenting spaces

This is a UIApplication method so we need to run it on the main thread. It can be run on background threads through wrapper SDKs.
@emawby emawby force-pushed the fix/always_set_badge_on_main_thread branch from 3b9f64b to e91a5a9 Compare August 5, 2021 22:09
@emawby emawby merged commit 94b7475 into main Aug 5, 2021
@emawby emawby deleted the fix/always_set_badge_on_main_thread branch August 5, 2021 22:12
@emawby emawby mentioned this pull request Aug 13, 2021
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

Successfully merging this pull request may close these issues.

OneSignal required main queue for some methods
2 participants