Is there a bug in this beta version that causes complications show placeholders only. This problem does not exist for watchOS 1.4
Post
Replies
Boosts
Views
Activity
If I leave Xcode 15 active, it will always crash macOS Sonoma after a few hours.
In my watch app the AppIntentRecommendation that is returned by func recommendations() needs to be updated after the app is launched.
Problem:
The information that I need to return a list of AppIntentRecommendation is not available when the app is first installed, so I return a "dummy" AppIntentRecommendation initially.
After the app is launched for the first time and user has signed in, I can update the AppIntentRecommendation in func recommendations() but watchOS does not update the list of widgets presented as complications.
func recommendations() -> [AppIntentRecommendation<ConfigurationAppIntent>] {
// Create an array with all the preconfigured widgets to show.
let defaults = UserDefaults.init(suiteName: "group.myApp")!
guard let names = defaults.dictionary(forKey: "names" as? [String:String] else {
return [AppIntentRecommendation(intent: .Demo, description: "Demo")]
}
var recs = [AppIntentRecommendation<ConfigurationAppIntent>]()
for (idx, name) in names() {
let rec = ConfigurationAppIntent()
rec.order = idx
rec.carName = name
rec.action = nil
recs.append(AppIntentRecommendation(intent: rec, description: "name") )
}
return recs
}
}
I have a home widget with buttons (new in iOS 17).
In order to prevent taking action if the user taps on the widget buttons accidentally, I want to ask the user for confirmation.
It appeared that requestConfirmation be exactly what I needed, but no confirmation view shows up when I invoke this method in the perform function.
I have tried the following:
try await requestConfirmation(result: .result(dialog: "Are you sure you want to do this?") {
Image(.mdlsWhite)
})
and this alternative:
let confirmed: Bool = try await $name.requestConfirmation(for: self.name,
dialog: IntentDialog(stringLiteral: msg))
Neither option work.
I am starting to think that the requestConfirmation is not to be used with Home Widgets.
Is there a better way to handle confirmations for buttons included in a Home Widget?
I have created widget that shows fine as a widget in the smart stack. But when the same widget is added as a complication (accessoryRectangular) the font sizes (caption) are slightly bigger and don't fit anymore.
Have you experience this?
I created a widget for watchOS. The widget shows correctly on the watch face and you can see it when you swipe up. But the gallery where the AppIntentRecommendation is shown in showing widget views that I created a couple of days ago and do not even exist anymore in my app.
Is this a bug in the beta version or am I missing something?
I am trying to convert an ephemeralKey which is a series of bytes to an Elliptic Curve public key and then use it to create a shared key using my private key.
I know how to do this in python (code below). But I cannot find a way to do this in Swift. My swift code is also copied below but it is not correct. Do you see the problem with my swift code?
My python code:
from cryptography.hazmat.primitives.asymmetric import ec
devicePublicKey = ec.EllipticCurvePublicKey.from_encoded_point(ec.SECP256R1(), ephemeralKey)
sharedKey = privateKey.exchange(ec.ECDH(), devicePublicKey)
My swift code:
let attributes: [String:Any] =
[
kSecAttrKeyClass as String: kSecAttrKeyClassPublic,
kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom,
kSecAttrKeySizeInBits as String: 256,
]
let devicePublicKey = SecKeyCreateWithData(ephemeralKey as CFData, attributes as CFDictionary, nil)!
let sharedKey = ecdhSecretCalculation(publicKey: devicePublicKey, privateKey: privateKey)
func ecdhSecretCalculation(publicKey: SecKey, privateKey: SecKey) -> Data? {
var error: Unmanaged<CFError>?
let keyPairAttr:[String : Any] = [
kSecAttrKeySizeInBits as String: 256,
SecKeyKeyExchangeParameter.requestedSize.rawValue as String: 32,
kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom,
kSecPrivateKeyAttrs as String: [kSecAttrIsPermanent as String: false],
kSecPublicKeyAttrs as String:[kSecAttrIsPermanent as String: false]
]
let algorithm:SecKeyAlgorithm = .ecdhKeyExchangeStandardX963SHA256
let shared = SecKeyCopyKeyExchangeResult(privateKey, algorithm, publicKey, keyPairAttr as CFDictionary, &error) as Data?
return shared
}
Starting about a month ago some of my app users began getting the http 500 error when the app attempts to do anything (read or write) to their iCloud Drive.
For AppleIDs that are affected, all apps that use iCloud Drive return the same error.
"Request failed with http status code 500"
Apple had the same problem last year around the same time (Dec 2021). It was never acknowledged
This is a similar issue that happened about a year ago: https://www.macrumors.com/2022/01/26/apple-fixed-icloud-syncing-bug/
Can someone please looking this. I have also filed a bug report with Apple: FB11852660
Since Apple never acknowledges these outages, users blame our app
local build show HomeWidget fine
when the same build is distributed using TestFlight, HomeWidgets aren’t shown at all.
this problem started from iOS 14 beta 3.