我有一个音乐扑动应用程序,现在我正在实现在spotify ios sdk与spotify ios sdk集成的本地播放器代码。
我正在尝试运行,但iOS13.6手机上的spotify连接功能不起作用,我看到IOS 13+以后的版本需要SceneDelegate。
现在我纠结于如何在SceneDelegate中添加Flutter方法处理程序。
当我在SceneDelegate上添加Flutter方法处理程序时,我得到了下面的错误,它将被卡住在断点处,下一步不会执行。
我正在尝试通过遵循AVFoundation文档来制作一个简单的视频取景器。应用程序每次启动时都会终止。我如何解决这个特定的错误?
Thread 1: EXC_BREAKPOINT (code=1, subcode=0x102d3c320)发布于 2021-03-12 22:43:35
以下步骤帮助我在SceneDelegate中使用Flutter应用程序
符合UIWindowSceneDelegate的
SceneDelegate.swift的UIResponder@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
//....
}SceneManifest添加到Info.plist,其中我们将SceneDelegate声明为scene的默认配置
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>Storyboard Name</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>AppDelegate.swift支持iOS 13以外的其他版本
override func application( _ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
guard #available(iOS 13.0, *) else {
GeneratedPluginRegistrant.register(with: self)
guard let controller = window?.rootViewController as? FlutterViewController else { return true }
//Confugure 'controller' as needed
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
return true
}支持iOS 13+的
SceneDelegate.swift func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = scene as? UIWindowScene else { return }
window = UIWindow(windowScene: windowScene)
let flutterEngine = FlutterEngine(name: "SceneDelegateEngine")
flutterEngine.run()
GeneratedPluginRegistrant.register(with: flutterEngine)
let controller = FlutterViewController.init(engine: flutterEngine, nibName: nil, bundle: nil)
window?.rootViewController = controller
window?.makeKeyAndVisible()
}https://stackoverflow.com/questions/63631338
复制相似问题