diff --git a/Apps/VisionOS/VisionOS.xcodeproj/xcshareddata/xcschemes/VisionOS.xcscheme b/Apps/VisionOS/VisionOS.xcodeproj/xcshareddata/xcschemes/VisionOS.xcscheme index 67f4c4976..fd541a7b1 100644 --- a/Apps/VisionOS/VisionOS.xcodeproj/xcshareddata/xcschemes/VisionOS.xcscheme +++ b/Apps/VisionOS/VisionOS.xcodeproj/xcshareddata/xcschemes/VisionOS.xcscheme @@ -1,7 +1,7 @@ + version = "1.8"> String { return """ CustomerIO.shared.identify( - userId: ""\(profile.userId)"", + userId: "\(profile.userId)", traits: \(propertiesStr) ) """ @@ -20,7 +20,7 @@ private func identifyCodeSnippet(_ profile: Profile) -> String { return """ CustomerIO.shared.identify( - userId: ""\(profile.userId)"" + userId: "\(profile.userId)" ) """ } else if !profile.traits.isEmpty { diff --git a/Apps/VisionOS/VisionOS/APIViews/ProfileAttributesView.swift b/Apps/VisionOS/VisionOS/APIViews/ProfileAttributesView.swift index 99256b00c..96f14420a 100644 --- a/Apps/VisionOS/VisionOS/APIViews/ProfileAttributesView.swift +++ b/Apps/VisionOS/VisionOS/APIViews/ProfileAttributesView.swift @@ -17,7 +17,7 @@ struct ProfileAttributesView: View { @ObservedObject var state = AppState.shared @State private var attributes: [Attribute] = [] - + let onSuccess: (_ profileAttributes: [Attribute]) -> Void var body: some View { @@ -35,7 +35,6 @@ struct ProfileAttributesView: View { """ } - PropertiesInputView(terminology: .attributes, properties: $attributes) Button("Set/Update profile attribute") { diff --git a/Apps/VisionOS/VisionOS/APIViews/TrackEventsView.swift b/Apps/VisionOS/VisionOS/APIViews/TrackEventsView.swift index f5e4c739f..c65124e36 100644 --- a/Apps/VisionOS/VisionOS/APIViews/TrackEventsView.swift +++ b/Apps/VisionOS/VisionOS/APIViews/TrackEventsView.swift @@ -40,7 +40,7 @@ struct TrackEventsView: View { Using CustomerIO you can track any events. If there is an identified user, these events will be attributed to them or to an annonymouse user otherwise. An event must have a name. - + Optionally, you can add any properties payload to the event as long as the payload type conforms to the Codable protocol. [Learn more](https://customer.io/docs/sdk/ios/tracking/track-events/) @@ -52,7 +52,7 @@ struct TrackEventsView: View { } FloatingTitleTextField(title: "Event name", text: $event.name) - + .textInputAutocapitalization(.never) PropertiesInputView( terminology: .properties, properties: $event.properties diff --git a/Apps/VisionOS/VisionOS/CommonViews/MainLayoutView.swift b/Apps/VisionOS/VisionOS/CommonViews/MainLayoutView.swift index 8b6139d52..bcbbffc12 100644 --- a/Apps/VisionOS/VisionOS/CommonViews/MainLayoutView.swift +++ b/Apps/VisionOS/VisionOS/CommonViews/MainLayoutView.swift @@ -20,10 +20,8 @@ enum CIOExample: String, CaseIterable { switch self { case .initialize: return true - case .identify: + case .identify, .track, .profileAttributes: return AppState.shared.workspaceSettings.isSet() - case .track, .profileAttributes: - return AppState.shared.workspaceSettings.isSet() && AppState.shared.profile.loggedIn } } } diff --git a/Apps/VisionOS/VisionOS/MainScreen.swift b/Apps/VisionOS/VisionOS/MainScreen.swift index 805110823..d5688600a 100644 --- a/Apps/VisionOS/VisionOS/MainScreen.swift +++ b/Apps/VisionOS/VisionOS/MainScreen.swift @@ -60,7 +60,7 @@ struct MainScreen: View { TrackEventsView { event in CustomerIO.shared.track( name: event.name, - properties: event.properties + properties: event.properties.toDictionary() ) viewModel.successMessage = "Track API has been executed successfully" diff --git a/Apps/VisionOS/VisionOS/Storage/UserDefaultsCodable.swift b/Apps/VisionOS/VisionOS/Storage/UserDefaultsCodable.swift index e5b29bc75..b4ef25ef1 100644 --- a/Apps/VisionOS/VisionOS/Storage/UserDefaultsCodable.swift +++ b/Apps/VisionOS/VisionOS/Storage/UserDefaultsCodable.swift @@ -19,7 +19,8 @@ extension UserDefaultsCodable { static func loadFromStorage() -> Self { if let data = UserDefaults.standard.object(forKey: storageKey()) as? Data, - let storedInstance = from(data) { + let storedInstance = from(data) + { return storedInstance }