It seems the path to the file change after a re-launch:
The prefs say
…/Containers/Data/Application/25E88AEC-9B14-48E9-A7BF-3F93C05AFCB8/Documents/Sample.quizlist
When I get the path to the documents folder after relaunch, it is
…/Containers/Data/Application/DA18292E-D744-41FF-A98B-A2085E9F4318/Documents/Sample.quizlist
I assume this is a feature, not a bug. But why? And where is it documented?
Can anyone explain what is happening? Why is Xcode giving this error in the first place, and why is CODE_SIGNING_ALLOWED a fix for it?
I mean, if the original error is not a mistake, then it sounds like a hack, and there should be a better solution
Answering to myself: Works as designed
The trick here is that INFOPLIST_PREPROCESS = YES, and that the defines are in the preprocess header. To make it work like about, turn off INFOPLIST_PREPROCESS.
What I actually was is to keep it on, get rid of the .xcconfig files entirely, and use
<key>SharedGroupName</key>
<string>SHARED_GROUP_NAME_IOS</string>
which solved my primary problem
Thank you for your reply. Loopbacks and further experimentation, as well as reading code from .Net and Android got me the solution:
let symmetricKey = sharedSecret.withUnsafeBytes { rawBufferPointer in
var sha = SHA256()
sha.update(bufferPointer: rawBufferPointer)
let digest = sha.finalize()
return SymmetricKey(data: digest)
}
return symmetricKey
My biggest question here is: Is this x9.63 or hkdf, and I am simply using these functions wrong? Or is this derivation method missing from CryptoKit?
I have a similar issue. You can start to look further into your problem by attaching to the WebView via Safari on the Mac, and look exactly at what is happening. Add
if #available(iOS 16.4, *) {
webView.isInspectable = true
}
to your debug build to enable inspection
Thank you for your replies, I think I found the answer myself. The issue seems to be that I am formatting from the components. If I use string(from: to:), then the output is as I would expect it!
let formatter = DateComponentsFormatter()
formatter.unitsStyle = .full
formatter.allowedUnits = [.year, .month, .weekOfMonth, .day]
let result = formatter.string(from: startDate, to: endDate)
It seems the path to the file change after a re-launch:
The prefs say
…/Containers/Data/Application/25E88AEC-9B14-48E9-A7BF-3F93C05AFCB8/Documents/Sample.quizlist
When I get the path to the documents folder after relaunch, it is
…/Containers/Data/Application/DA18292E-D744-41FF-A98B-A2085E9F4318/Documents/Sample.quizlist
I assume this is a feature, not a bug. But why? And where is it documented?
Can anyone explain what is happening? Why is Xcode giving this error in the first place, and why is CODE_SIGNING_ALLOWED a fix for it?
I mean, if the original error is not a mistake, then it sounds like a hack, and there should be a better solution
Answering to myself: Works as designed
The trick here is that INFOPLIST_PREPROCESS = YES, and that the defines are in the preprocess header. To make it work like about, turn off INFOPLIST_PREPROCESS.
What I actually was is to keep it on, get rid of the .xcconfig files entirely, and use
<key>SharedGroupName</key>
<string>SHARED_GROUP_NAME_IOS</string>
which solved my primary problem
Thank you for your reply. Loopbacks and further experimentation, as well as reading code from .Net and Android got me the solution:
let symmetricKey = sharedSecret.withUnsafeBytes { rawBufferPointer in
var sha = SHA256()
sha.update(bufferPointer: rawBufferPointer)
let digest = sha.finalize()
return SymmetricKey(data: digest)
}
return symmetricKey
My biggest question here is: Is this x9.63 or hkdf, and I am simply using these functions wrong? Or is this derivation method missing from CryptoKit?
I have a similar issue. You can start to look further into your problem by attaching to the WebView via Safari on the Mac, and look exactly at what is happening. Add
if #available(iOS 16.4, *) {
webView.isInspectable = true
}
to your debug build to enable inspection
Thank you for your replies, I think I found the answer myself. The issue seems to be that I am formatting from the components. If I use string(from: to:), then the output is as I would expect it!
let formatter = DateComponentsFormatter()
formatter.unitsStyle = .full
formatter.allowedUnits = [.year, .month, .weekOfMonth, .day]
let result = formatter.string(from: startDate, to: endDate)