Skip to content

Commit aed0524

Browse files
committed
[nits] update comments for create user response
* Also update some comments for addressing the Create User response
1 parent a790ad6 commit aed0524

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSUserRequests.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,14 @@ class OSUserExecutor {
167167
return
168168
}
169169
OneSignalClient.shared().execute(request) { response in
170-
// TODO: Differentiate if we need to fetch based on response code 200, 201, 202
171-
// Create User's response won't send us the user's complete info if this user already existed.
172-
// We can parse the response OR fetch user (and then parse response then)
173-
// For now, do both, as we should parse to get the subscription_id from this request
170+
// TODO: Differentiate if we need to fetch the user based on response code of 200, 201, 202
171+
// Create User's response won't send us the user's complete info if this user already exists
174172
if let response = response {
173+
// Parse the response for any data we need to update
175174
parseFetchUserResponse(response: response, identityModel: request.identityModel, originalPushToken: originalPushToken)
176-
// If we logged into an external_id, fetch the user data
175+
176+
// If this user already exists and we logged into an external_id, fetch the user data
177+
// TODO: Only do this if response code is 200 or 202
177178
if let identity = request.parameters?["identity"] as? [String: String],
178179
let externalId = identity[OS_EXTERNAL_ID] {
179180
fetchUser(aliasLabel: OS_EXTERNAL_ID, aliasId: externalId, identityModel: request.identityModel)

0 commit comments

Comments
 (0)