I want to take screenshots of any running app, while my app is in the background.
I know I can take screenshots in iOS using:
UIGraphicsBeginImageContext(webview.frame.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
But this is not really possible in a background task as UIGraphicsGetCurrentContext returns NULL and I want a screenshot of the running app and not my view. Is there any other way?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…