iOS app using Application.CaptureScreenshot "Failed to store screenshot" Why?

That’s an awfully unhelpful error message. It seems to be doing it the second time I try to make a screenshot- is it not allowed to save over the existing screenshot with the same filename? I don’t want old screenshots piling up in the data folder.

The problem is that on PC you can provide the full path, but on iOS you should pass just a file name.
so here is solution

string filename = "screenshot.png";
string path = Path.Combine(Application.persistentDataPath, filename);
if (File.Exists(path))
	File.Delete(path);
if (Application.platform == RuntimePlatform.IPhonePlayer)
	Application.CaptureScreenshot(filename);
else
	Application.CaptureScreenshot(path);