当我点击控制中心的controlwidget时,本应该打开capture扩展的,但是偶尔会打开主工程,即使我同意了相机权限。 这样,当我打开主工程时,主工程会在启动10s左右被杀死。 我只是在capture扩展中加了保活,难道主工程也要增加保活吗?值得注意的是我们的App不是相机类型的。 The app extension terminates shortly after launch if it doesn’t have an active camera view that uses AVCaptureEventInteraction to handle events from the hardware buttons, or if access to the camera hasn’t been requested.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
在插件里面,我把数据写到临时目录下面
let directoryURL = self.session.sessionContentURL
let fileURL = directoryURL.appendingPathComponent("saved_image.jpg")
do {
try data.write(to: fileURL)
} catch {
}
当打开主app的时候我改怎么拿到这个saved_image.jpg图片呢?
当我热启动App时,我可以在- (void)sceneWillEnterForeground:(UIScene *)scene里面调用
for await update in LockedCameraCaptureManager.shared.sessionContentUpdates {
switch update {
case .initial(let urls):
// Process captured content from existing session content directories.
break
case .added(let url):
// Process captured content from a new session content directory.
break
case .removed(let url):
// Process captured content from a removed session content directory.
break
default:
// An unknown sessionContentUpdate was received.
break
}
}
拿到url。
但是当我的主app没有启动时,我使用上述方法拿不到值。
所以我应该怎么拿这个值呢?
请问苹果有没有demo啊???
太难了!
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
When I was using ControlWidgetButton, I encountered a problem and got a crash. However, when I use ControlWidgetToggle, I don't have this problem. Did I configure something less? I am using xcode16beta and [iOS18.3beta.]
Topic:
Developer Tools & Services
SubTopic:
Xcode