segment-integrations / analytics-ios-integration-firebase

Segment's bundled integration for Firebase on iOS
MIT License
13 stars 92 forks source link

Crash when using Firebase DynamicLink #33

Closed Clawiste closed 2 years ago

Clawiste commented 5 years ago

I have an issue with using Firebase DynamicLink, Segment_Firebase doesn't ensure that Firebase is configured on main thread, which DynamicLink requires, so the app crashes instead.

it throws FIRDLJavaScriptExecutor must be used in main thread error

I managed to fix it by wrapping configuring of the firebase in dispatch block that would execute it on main thread in the initWithSettings method.

dispatch_async(dispatch_get_main_queue(), ^(void){
    [FIRApp configure];
    SEGLog(@"[FIRApp Configure]");
});

though I'm not sure if it is correct solution, I'm not an objc guy.

benevbright commented 4 years ago

Thanks God, I was not the only one.