Skip to content

Mark methods with StaticString for appUserID as deprecated#3739

Merged
MarkVillacampa merged 3 commits into
mainfrom
app-user-id-static
Feb 29, 2024
Merged

Mark methods with StaticString for appUserID as deprecated#3739
MarkVillacampa merged 3 commits into
mainfrom
app-user-id-static

Conversation

@MarkVillacampa

@MarkVillacampa MarkVillacampa commented Feb 29, 2024

Copy link
Copy Markdown
Member

I tried conditionally compiling the availability attribute, and marking it as unavailable in RELEASE builds, but the compiler is smart enough to ignore the method and choose the disfavored overload in that case.

I also tried conditionally compiling the return type in the same way, to cause a compilation error in RELEASE builds, but the compiler is again smart enough to choose the disfavored overload.

@MarkVillacampa MarkVillacampa added the pr:fix A bug fix label Feb 29, 2024
@available(*, deprecated, message: """
The appUserID passed to logIn is a constant string known at compile time.
This is likely a programmer error. This ID is used to identify the current user.
See https://docs.revenuecat.com/docs/user-ids for more information.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I wish there was a way to not repeat these strings but I have not found one :/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what was the behavior before this? After this, it will add a warning right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Before this, we were only logging a warning int he console. Now, it will show a compilation warning in the IDE.

@MarkVillacampa MarkVillacampa merged commit da11a79 into main Feb 29, 2024
@MarkVillacampa MarkVillacampa deleted the app-user-id-static branch February 29, 2024 18:39
joshdholtz added a commit that referenced this pull request Mar 5, 2024
**This is an automatic release.**

### New Features
* Paywalls: add `updateWithDisplayCloseButton` to
`PaywallViewController` (#3708) via Cesar de la Vega (@vegaro)
* New `syncAttributesAndOfferingsIfNeeded` method (#3709) via Burdock
(@lburdock)
* Add targeting to `PresentedOfferingContext` (#3730) via Josh Holtz
(@joshdholtz)
* Add `currentOffering(forPlacement: String)` to `Offerings` (#3707) via
Guido Torres (@guido732)
* New `Package.presentedOfferingContext` (#3712) via Josh Holtz
(@joshdholtz)
### Bugfixes
* Mark methods with StaticString for appUserID as deprecated (#3739) via
Mark Villacampa (@MarkVillacampa)
### Other Changes
* [EXTERNAL] Spelling typo fix to comment (#3713) via @vdeaugustine
(#3740) via Mark Villacampa (@MarkVillacampa)

---------

Co-authored-by: Josh Holtz <me@joshholtz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants