Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Swift UserId and DeviceId setter #299

Merged
merged 7 commits into from
Oct 19, 2020
Merged

fix: Swift UserId and DeviceId setter #299

merged 7 commits into from
Oct 19, 2020

Conversation

jooohhn
Copy link
Contributor

@jooohhn jooohhn commented Oct 16, 2020

Summary

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?:

Sets the userId.
Sets the userId and starts a new session.

**Note: this is deprecated** - please use `setUserId:(NSString*) userId startNewSession:(BOOL)startNewSession`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no space in between for (NSString*) userId

@@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will allow user to call setter without changing readonly for userId and deviceId inside Amplitude.h?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed so readwrite occurs in header instead of implementation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will revert so that we can solve the method syntax bug

Copy link
Contributor

@haoliu-amp haoliu-amp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jooohhn You can merge if you verified 2 things-

  1. Custom setter will be called.
  2. Setter can both be accessed in objc and swift.

@jooohhn jooohhn merged commit b7c0f90 into master Oct 19, 2020
@jooohhn jooohhn deleted the readwrite-setter-fix branch October 19, 2020 19:28
github-actions bot pushed a commit that referenced this pull request Oct 20, 2020
## [7.1.1](v7.1.0...v7.1.1) (2020-10-20)

### Bug Fixes

* **buildsettings:** Remove override for GCC_WARN_INHIBIT_ALL_WARNINGS ([#302](#302)) ([0e55297](0e55297))
* **deprecation warnings:** Fix deprecation warnings ([#301](#301)) ([e7b0e6e](e7b0e6e)), closes [/github.com//issues/250#issuecomment-655224554](https://github.com//github.com/amplitude/Amplitude-iOS/issues/250/issues/issuecomment-655224554)
* **deprecations:** Use DEPRECATED_MSG_ATTRIBUTE instead of notes ([#305](#305)) ([f501c6c](f501c6c))
* nil dynamic config refresh crash ([#288](#288)) ([#289](#289)) ([9dc896d](9dc896d))
* Swift UserId and DeviceId setter ([#299](#299)) ([b7c0f90](b7c0f90))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Readonly properties hide setters from Swift
2 participants