diff --git a/src/ios/FirebasePlugin.m b/src/ios/FirebasePlugin.m index 5a34047dc..37d15d8c8 100644 --- a/src/ios/FirebasePlugin.m +++ b/src/ios/FirebasePlugin.m @@ -263,12 +263,14 @@ - (void)logEvent:(CDVInvokedUrlCommand *)command { } - (void)setScreenName:(CDVInvokedUrlCommand *)command { - NSString* name = [command.arguments objectAtIndex:0]; - - [FIRAnalytics setScreenName:name screenClass:NULL]; + [self.commandDelegate runInBackground:^{ + NSString* name = [command.arguments objectAtIndex:0]; + + [FIRAnalytics setScreenName:name screenClass:NULL]; - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + }]; } - (void)setUserId:(CDVInvokedUrlCommand *)command {