我正在使用后台任务在后台运行计时器来更新用户的位置.它被声明为:
UIBackgroundTaskIdentifier bgTask;
Run Code Online (Sandbox Code Playgroud)
在头文件中,并初始化为:
bgTask = UIBackgroundTaskInvalid;
Run Code Online (Sandbox Code Playgroud)
但是,我仍然在gdb中收到此消息:
无法endBackgroundTask:标识符23dc不存在后台任务,或者它可能已经结束.在UIApplicationEndBackgroundTaskError()中断以进行调试.
为什么?我该如何解决这个问题?
I have created html with following body:
<html>
<head>
<meta http-equiv="Refresh" content="3; URL='MyApp://?Success'">
</head>
<body>
success
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
When i try to open page where html uploaded. from my iphone (safari) my app successfully opened but
application:openURL:options:
Run Code Online (Sandbox Code Playgroud)
does not called. Have u any ideas?
my info plist look like this:
<array>
<string>MyApp</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>MyApp</string>
</array>
<key>CFBundleURLName</key>
<string>url here</string>
</dict>
</array>
Run Code Online (Sandbox Code Playgroud)
My appDelegate Methods:
func application(_ app: UIApplication, open url: URL, options [UIApplication.OpenURLOptionsKey : Any] = …Run Code Online (Sandbox Code Playgroud)