diff --git a/Sources/Amplitude/Amplitude.h b/Sources/Amplitude/Amplitude.h index 2a3aba10..7616991d 100644 --- a/Sources/Amplitude/Amplitude.h +++ b/Sources/Amplitude/Amplitude.h @@ -541,7 +541,8 @@ typedef NSDictionary *_Nullable (^AMPLocationInfoBlock)(void); */ /** - Sets the userId. + Sets the userId and starts a new session. + @param userId If your app has its own login system that you want to track users with, you can set the userId. @see [Setting Custom UserIds](https://github.com/amplitude/Amplitude-iOS#setting-custom-user-ids) */ @@ -549,10 +550,12 @@ typedef NSDictionary *_Nullable (^AMPLocationInfoBlock)(void); - (void)setUserId:(nullable NSString *)userId; /** - Sets the userId and starts a new session. The previous session for the previous user will be terminated and a new session will begin for the new user id. + Sets the userId. If startNewSession is true, the previous session for the previous user will be terminated and a new session will begin for the new userId. @param userId If your app has its own login system that you want to track users with, you can set the userId. + @param startNewSession Terminates previous user session and creates a new one for the new user + @see [Setting Custom UserIds](https://github.com/amplitude/Amplitude-iOS#setting-custom-user-ids) */ - (void)setUserId:(nullable NSString *)userId startNewSession:(BOOL)startNewSession; diff --git a/Sources/Amplitude/Amplitude.m b/Sources/Amplitude/Amplitude.m index c56d65be..ac95656b 100644 --- a/Sources/Amplitude/Amplitude.m +++ b/Sources/Amplitude/Amplitude.m @@ -87,6 +87,8 @@ @interface Amplitude() @property (nonatomic, assign) long long sessionId; @property (nonatomic, assign) BOOL backoffUpload; @property (nonatomic, assign) int backoffUploadBatchSize; +@property (nonatomic, copy, readwrite, nullable) NSString *userId; +@property (nonatomic, copy, readwrite) NSString *deviceId; #if TARGET_OS_IOS || TARGET_OS_MACCATALYST @property (nonatomic, strong) AMPEventExplorer *eventExplorer; #endif diff --git a/Sources/Amplitude/AmplitudePrivate.h b/Sources/Amplitude/AmplitudePrivate.h index b48e0925..3d3f5744 100644 --- a/Sources/Amplitude/AmplitudePrivate.h +++ b/Sources/Amplitude/AmplitudePrivate.h @@ -11,8 +11,6 @@ @interface Amplitude () @property (nonatomic, copy, readwrite) NSString *apiKey; -@property (nonatomic, copy, readwrite) NSString *userId; -@property (nonatomic, copy, readwrite) NSString *deviceId; @property (nonatomic, copy, readwrite) NSString *instanceName; @end