From d3bae81a81157f2d731741ea2353d1f4d4834195 Mon Sep 17 00:00:00 2001 From: Nan Date: Thu, 30 Nov 2023 14:36:13 -0800 Subject: [PATCH] Json representation of User State uses empty string, not "nil" 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`. --- iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSUserState.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSUserState.swift b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSUserState.swift index ce1deb19b..6f8715e84 100644 --- a/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSUserState.swift +++ b/iOS_SDK/OneSignalSDK/OneSignalUser/Source/OSUserState.swift @@ -41,8 +41,8 @@ public class OSUserState: NSObject { @objc public func jsonRepresentation() -> NSDictionary { return [ - "onesignalId": onesignalId ?? "nil", - "externalId": externalId ?? "nil" + "onesignalId": onesignalId ?? "", + "externalId": externalId ?? "" ] } }