When app goes to background speech recognition not working

1.2k Views Asked by At

I am using SFSpeechRecognition for speech to text, its working properly when application is on foreground but application required continues recording when app goes to background too.

I tired all required background setting in .plist file

- (void)applicationDidEnterBackground:(UIApplication *)application
{
   __block UIBackgroundTaskIdentifier task = 0;
   task=[application beginBackgroundTaskWithExpirationHandler:^{
   NSLog(@"Expiration handler called %f",[application backgroundTimeRemaining]);
   [application endBackgroundTask:task];
   task=UIBackgroundTaskInvalid;
   }];
}

Please suggest how can I do this?

0

There are 0 best solutions below