Skip to content

Commit 835afee

Browse files
committed
Fix errors
1 parent 77f4575 commit 835afee

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Sources/Optimizely+Decide/OptimizelyUserContext+ObjC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ extension OptimizelyClient {
100100
@available(swift, obsoleted: 1.0)
101101
@objc(createUserContextWithUserId:attributes:region:)
102102
public func objcCreateUserContext(userId: String, attributes: [String: Any]? = nil, region: String) -> ObjcOptimizelyUserContext {
103-
let user = createUserContext(userId: userId, attributes: attributes)
103+
let user = OptimizelyUserContext(optimizely: self, userId: userId, attributes: attributes, region: region)
104104
return ObjcOptimizelyUserContext(user: user)
105105
}
106106

Sources/Optimizely+Decide/OptimizelyUserContext.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ public class OptimizelyUserContext {
7070
/// - optimizely: An instance of OptimizelyClient to be used for decisions.
7171
/// - userId: The user ID to be used for bucketing.
7272
/// - attributes: A map of attribute names to current user attribute values.
73+
/// - region: The region for the user context (optional). Defaults to the region from the project config.
7374
public convenience init(optimizely: OptimizelyClient,
7475
userId: String,
75-
attributes: [String: Any?]? = nil) {
76+
attributes: [String: Any?]? = nil,
77+
region: String? = nil) {
7678
self.init(optimizely: optimizely, userId: userId, attributes: attributes ?? [:], identify: true)
7779
}
7880

0 commit comments

Comments
 (0)