Skip to content

Commit

Permalink
fix(expo-contacts): #29198 store full url & remove useless restrictio…
Browse files Browse the repository at this point in the history
…n on social profiles
  • Loading branch information
mlecoq committed May 29, 2024
1 parent 9be1ca7 commit afbf0fb
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions packages/expo-contacts/ios/Decoding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ func decodeSocialProfiles(_ input: [SocialProfile]?) -> [CNLabeledValue<CNSocial
var output = [CNLabeledValue<CNSocialProfile>]()
for item in input {
let label = decodeLabel(label: item.label)
if let urlString = item.url,
let username = item.username,
let userId = item.userId,
let service = item.service {
let profile = CNSocialProfile(urlString: urlString.path, username: username, userIdentifier: userId, service: service)
output.append(CNLabeledValue(label: label, value: profile))
}
let urlString = item.url
let username = item.username
let userId = item.userId
let service = item.service
let profile = CNSocialProfile(urlString: urlString?.path(), username: username, userIdentifier: userId, service: service)
output.append(CNLabeledValue(label: label, value: profile))
}
return output
}
Expand Down Expand Up @@ -69,7 +68,7 @@ func decodeUrlAddresses(_ input: [UrlAddress]?) -> [CNLabeledValue<NSString>]? {
var output = [CNLabeledValue<NSString>]()
for item in input {
let label = decodeUrlAddressLabel(item.label)
if let urlString = item.url?.path {
if let urlString = item.url?.formatted() {
output.append(CNLabeledValue(label: label, value: urlString as NSString))
}
}
Expand Down

0 comments on commit afbf0fb

Please sign in to comment.