How to get some background process time after OnApplicationPause

Hello,

Is there a way in Unity (I’m coding in C#), to get some process time to run a task in background when the app is put to background?
I’m looking for an equivalent of “beginBackgroundTaskWithExpirationHandler” function from iOS library, which if possible would work on both iOS and Android. Something to allow me to do the same as that:

- (void)applicationWillResignActive:(UIApplication *)application
{
	// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
	// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
	
	UIApplication *app = [UIApplication sharedApplication];
	
	bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
		[app endBackgroundTask:bgTask];
		bgTask = UIBackgroundTaskInvalid;
	}];
	
	myFunctionThatCouldBeLong();
}

Not sure if this thread is still relevant, but I had it in my bookmarks for reference.

http://forum.unity3d.com/threads/110512-continue-running-app-in-background-for-audio-generation-(iOS)

If you do decide to use this method, remember that when you build your project from Unity3D to XCode and you hit ‘Replace’ instead of ‘Append,’ all your changes to the AppController.mm file will be deleted. To work around this, you can either save a copy locally and recopy it whenever you need, or write a Post Process script to get around that issue.