Hello folks,
I stumbled upon a weird CNContact serialization problem. I use the Contacts framework to update the AIM field, which is one of the instantMessageAddresses within a single Contact. Here is the simplified code I used:
func updateAIMFieldOn(contact: CNContact, aimValue: String) {
do {
guard let mutableContact = contact.mutableCopy() as? CNMutableContact else {
logger.error("[CM] Couldn't update contact with aim \(aimValue)")
return
}
var updatedAddresses = mutableContact.instantMessageAddresses
updatedAddresses.append(CNLabeledValue(label: "", value: CNInstantMessageAddress(username: aimValue, service: CNInstantMessageServiceAIM)))
mutableContact.instantMessageAddresses = updatedAddresses
let saveRequest = CNSaveRequest()
saveRequest.update(mutableContact)
try CNContactStore().execute(saveRequest)
logger.verbose("Contact's AIM updated successfully!")
} catch {
logger.error("Couldn't update contact")
}
}
And after serializing the contact to data, and then deserializing, the contact got two AIM fields with the same value:
X-AIM;type=pref:some:part:of_my_aim_value
IMPP;X-SERVICE-TYPE=AIM;type=pref:some:part:of_my_aim_value
Why does it work in this manner? Is it possible that ":" char causes that? Format of my aim username is {some:part:of_my_aim_value}. I didn't find any information in the docs.
Thanks!
Post
Replies
Boosts
Views
Activity
Hello,
I faced a weird problem with my framework imported into my app. MyFramework uses some other frameworks like OpenSSL etc. I build MyFramework with the script:
FrameworkName="MyFramework"
rm -rf build/
xcodebuild archive -scheme "$FrameworkName" \
-configuration Debug -destination 'generic/platform=iOS' \
-archivePath "./build/$FrameworkName.framework-iphoneos.xcarchive" \
SKIP_INSTALL=NO \
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme "$FrameworkName" \
-configuration Debug -destination 'generic/platform=iOS Simulator' \
-archivePath "./build/$FrameworkName.framework-iphonesimulator.xcarchive" \
SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme "$FrameworkName" \
-configuration Debug -destination 'generic/platform=macOS' \
-archivePath "./build/$FrameworkName.framework-macos.xcarchive" \
SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
# Fix https://bugs.swift.org/browse/SR-14195 (caused by https://bugs.swift.org/browse/SR-898)
pattern="./build/$FrameworkName.framework-iphoneos.xcarchive/Products/Library/Frameworks/$FrameworkName.framework/Modules/$FrameworkName.swiftmodule/*.swiftinterface"
grep -rli "$FrameworkName.$FrameworkName" $pattern \
| xargs sed -i '' "s,$FrameworkName.$FrameworkName,$FrameworkName,g"
# end fix
xcodebuild -create-xcframework \
-framework "./build/$FrameworkName.framework-iphoneos.xcarchive/Products/Library/Frameworks/$FrameworkName.framework" \
-framework "./build/$FrameworkName.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/$FrameworkName.framework" \
-framework "./build/$FrameworkName.framework-macos.xcarchive/Products/Library/Frameworks/$FrameworkName.framework" \
-output "./build/$FrameworkName.xcframework"
# Wait for process completion and verify result
pid=$!
wait $pid
echo "Process with PID $pid has finished with Exit status: $?"
[[ ! -d "./build/$FrameworkName.xcframework/" ]] && {
msg="[ERROR] expected ./build/$FrameworkName.xcframework/ to exist"; echo -e $msg
exit 1
}
As you can see, it is also built framework for the macOS platform.
A little digression: I prefer using Carthage to build xcframeworks, but here it doesn't work, I don't the reason.
The aforementioned build solution works great, all frameworks included in MyFramework don't have any issues when I use MyFramework in my iOS App. The problem starts with using MyFramework in macOS target App. It shows two related errors, I tried some solutions but didn't find a proper way... Errors:
blablabla/DerivedData/MyApp-hdzvzxtsnsdivzcialzikxjdwidw/Build/Products/Debug/MyFramework.framework/Modules/MyFramework.swiftmodule/arm64-apple-macos.swiftinterface:9:8: error: no such module 'OpenSSL'
import OpenSSL
And the second one:
blablabla/Helpers/Injected/Services.swift:10:8: error: failed to build module 'MyFramework' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug
import MyFramework
I can import the OpenSSL framework to the macOS app and then I faced the same problem with the next framework from MyFramework's importing list - it isn't a solution...
What causes that problem?
Thanks in advance for any help... 🥺
Hello guys!
I faced a problem with building...
My device suddenly updated to iOS 15.4.1, my Xcode was 13.2 and I had to update it to the latest version (13.3.1) to build the app. After the update, I had a few problems which were successfully solved but one of them stopped me for a few hours. The problem is with Bridging Headers or Swift Compiler, I really don't know what I did badly, and what causes problems.
On several forums I often read that is important to set:
Build Settings > Build Options > Build Libraries for Distribution
But in any case it doesn't work, on yes:
error: using bridging headers with module interfaces is unsupported
on no:
(line with import framework SWXMLHash) /Users/blablabla/SSLModel.swift:9:8: error: module compiled with Swift 5.5.1 cannot be imported by the Swift 5.6 compiler: /Users/blablabla2/Build/Products/Debug-iphoneos/SWXMLHash.framework/Modules/SWXMLHash.swiftmodule/arm64-apple-ios.swiftmodule
import SWXMLHash
It will be important that I use Carthage.
What should I do?
Clone all 10 frameworks that I use and re-build them with a new Xcode which includes compiler 5.6? That may be a bad solution... Any answers on similar topics don't help..
Like above. The main purpose is to reject managed apple id login to shared iPad from the same Business Manager. Want to check login on check-in, and then eventually don't pass user. When I send logOutUser on check-in, it takes a while and it's not user-friendly solution. Returning 401 just removes communication with that user channel.
Thanks in advance!
Is it possible to trigger finger/mouse click in iOS app?
Next question, is possible to call clicks from my app working in background to make some clicks in other apps/launcher?
I want to make remote screen app for my purposes.
Thanks in advance!
I read Mobile User Logins and Users in macOS documentation and whole thing, but I still don't know, which key should I attach to send configuration like install app to specified user on Shared iPad. When user logs in first time I received:
- Pushmagic always the same
- Token - always different
- UDID - always the same
- UserID - FFFFFF-FF....
- UserShortName means AppleID
What should I do to f.e. this plist to send app to user container?
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0">
<dict>
<key>Command</key>
<dict>
<key>ManagementFlags</key>
<integer>0</integer>
<key>Options</key>
<dict>
<key>PurchaseMethod</key>
<integer>1</integer>
</dict>
<key>RequestType</key>
<string>InstallApplication</string>
<key>iTunesStoreID</key>
<integer>1096834193</integer>
</dict>
<key>CommandUUID</key>
<string>0001_InstallApplication</string>
</dict>
</plist>
Thanks!