I have try to running a standalone watch app on Xcode 13.1 and Xcode 13.2 beta
But with Xcode 13.1, I have error "The os version installed on apple watch does not support the watchkit app product"
With Xcode 13.2 beta, I have error "Could not locate the device support file"
How to can run may app on my apple watch (watchOS 8.1) with Xcode?
Post
Replies
Boosts
Views
Activity
I'm develop a watch app that collect health data, and I want make a button to user can open apple watch setting to edit permission to allow/not allow app collect some data.
How can we open apple watch setting in Watchkit?
I'm developing an independent watch app and I have a background task every 60 minutes. But don't have anything happen when I close app or run background mode in over 24 hours.
I have use below code:
ViewController.swift
override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
setScheduleBackgroundJob {
// Set success
}
}
func setScheduleBackgroundJob(completed: @escaping () -> Void) {
let dateStartBackgroundTask = Date(timeInterval: TASK_INTERVAL_TIME.timeInterval, since: Date())
WKExtension.shared().scheduleBackgroundRefresh(withPreferredDate: dateStartBackgroundTask, userInfo: nil) { error in
if let error = error {
// log if have error
print("Error: ", error.localizedDescription)
return
}
print("BACKGROUND TASK: ", Date());
completed()
}
}
@IBAction func closeApp() {
setScheduleBackgroundJob {
exit(0)
}
}
ExtensionDelegate.swift
func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) {
// Sent when the system needs to launch the application in the background to process tasks. Tasks arrive in a set, so loop through and process each one.
for task in backgroundTasks {
// Use a switch statement to check the task type
switch task {
case let backgroundTask as WKApplicationRefreshBackgroundTask:
// Be sure to complete the background task once you’re done.
createBackgroundSceduleTask()
LocalStorageManager.logCollectData(content: "Collect Health Data Background \(Date())")
DataManager.shared.collectData(bgTask: backgroundTask)
// backgroundTask.setTaskCompletedWithSnapshot(false)
case let snapshotTask as WKSnapshotRefreshBackgroundTask:
// Snapshot tasks have a unique completion call, make sure to set your expiration date
snapshotTask.setTaskCompleted(restoredDefaultState: true, estimatedSnapshotExpiration: Date.distantFuture, userInfo: nil)
case let connectivityTask as WKWatchConnectivityRefreshBackgroundTask:
// Be sure to complete the connectivity task once you’re done.
connectivityTask.setTaskCompletedWithSnapshot(false)
case let urlSessionTask as WKURLSessionRefreshBackgroundTask:
// Be sure to complete the URL session task once you’re done.
DataManager.shared.handleData(urlSessionTask)
// urlSessionTask.setTaskCompletedWithSnapshot(false)
case let relevantShortcutTask as WKRelevantShortcutRefreshBackgroundTask:
// Be sure to complete the relevant-shortcut task once you're done.
relevantShortcutTask.setTaskCompletedWithSnapshot(false)
case let intentDidRunTask as WKIntentDidRunRefreshBackgroundTask:
// Be sure to complete the intent-did-run task once you're done.
intentDidRunTask.setTaskCompletedWithSnapshot(false)
default:
// make sure to complete unhandled task types
task.setTaskCompletedWithSnapshot(false)
}
}
}
In Xcode Project,
I have set CFBundleDisplayName is Psirenity
But after publishing to Apple Store, App Name is Psirenity Beta 1.2
I have searched all in Xcode Project, but not any string has "Beta"
How can I solve it to match App Name on App Store with my DisplayName on InfoPlist?
I have delivery app for customer, driver and we collected location data from user.
With the app for driver, we collected location data for provide direction to deliver, tracking location on Admin to support and send nearest order request.
With the app for customer, we collect location data to show nearest restaurant in 1 km and send current location on Admin for support.
So, I still concern that the app for driver or customer should have request App Tracking Transparency permission?
Hi Apple Developers,
I'm facing an issue that call to https://appleid.apple.com/auth/token and it raised an error: invalid_client
There is my URL that i'm getting a code: "https://www.facebook.com/v20.0/dialog/oauth?client_id=526484129769843&redirect_uri=https://abc.example-api.ss-ss.com/api/v1/accounts/facebook/callback&response_type=code&scope=email
I'm using Key Id and Private Key in the file AuthKey_K5HK3H23KZ.p8 to generate to a Client Secret, Client ID is abc.example-api.ss-ss.com (It is the service id) and the code that i give at the above request. When i'm call to exchange access token, the error is showed
My project is writing by dotnet core.
I dont know why the client should be invalid.
Can anyone help me please?