Wednesday 30 January 2019

FIRMessaging should be called from main thread only

I am using intel multi-os-engine to build my iOS-app. When trying to setup Firebase Messaging I get the following error:

* Assertion failure in -FIRMessaging teardown, /Users/hpbaxxter/StudioProjects/app/ios/xcode/Pods/FirebaseMessaging/Firebase/Messaging/FIRMessaging.m:374 2019-01-24 15:13:15.988333+0100 SkipAndGo[4195:75192] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'FIRMessaging should be called from main thread only.'

*** First throw call stack: ( 0 CoreFoundation 0x00000000177921bb __exceptionPreprocess + 331 1 libobjc.A.dylib
0x0000000016d30735 objc_exception_throw + 48 2 CoreFoundation
0x0000000017791f42 +[NSException raise:format:arguments:] + 98 3
Foundation 0x0000000013de9940 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 166 4
SkipAndGo 0x000000000b5b512a -[FIRMessaging teardown] + 234 5 SkipAndGo
0x000000000b5b3da3 -[FIRMessaging dealloc] + 195 6 libobjc.A.dylib 0x0000000016d42dcc _ZN11objc_object17sidetable_releaseEb + 202 7
??? 0x0000000044f6ec79 0x0 + 1157033081 ) libc++abi.dylib: terminating with uncaught exception of type NSException

I already read Q&A's like this one here.

This is my Code when setting up FIRMessaging:

Globals.dispatch_async(Globals.dispatch_get_main_queue(), new Globals.Block_dispatch_async() {
            @Override
            public void call_dispatch_async() {
                FIRMessaging.alloc().setDelegate(CLOUDMESSAGES_DELEGTE);
                application.registerForRemoteNotifications();
            }
        }
);



from FIRMessaging should be called from main thread only

No comments:

Post a Comment