Skip to content

Commit

Permalink
Json representation of User State uses empty string, not "nil"
Browse files Browse the repository at this point in the history
When giving a jsonRepresentation of OSUserState, choose empty string as the representation of a null value instead of the string literal "nil". The string "nil" can be interpreted as an existing value whereas the empty string is a better option as it can be checked for `isEmpty`.
  • Loading branch information
nan-li committed Dec 5, 2023
1 parent e50fbb4 commit 0d03a50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSUserState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public class OSUserState: NSObject {

@objc public func jsonRepresentation() -> NSDictionary {
return [
"onesignalId": onesignalId ?? "nil",
"externalId": externalId ?? "nil"
"onesignalId": onesignalId ?? "",
"externalId": externalId ?? ""
]
}
}
Expand Down

0 comments on commit 0d03a50

Please sign in to comment.