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

Referrals: send pass share #2166

Merged
merged 15 commits into from
Sep 18, 2024
Merged

Referrals: send pass share #2166

merged 15 commits into from
Sep 18, 2024

Conversation

SergioEstevao
Copy link
Contributor

@SergioEstevao SergioEstevao commented Sep 12, 2024

| 📘 Part of: #2083 |
|:---:|

Fixes #

This PR adds the share capability for the Referrals send pass screen.

1 2 3 4 5
IMG_0145 IMG_0144 IMG_0143 IMG_0141 IMG_0142

I initially tried to wrap the UIActivityViewController on an SwiftUI View but was having issues with the presentation using a bottom sheet ( there was always a part of the bottom sheet that didn't get the right color)

I tried to user ShareLink but the functionality is iOS 16 and above only so I needed to replicate it using UIActivityViewController any way.

In the end I'm using the UIActivityViewController in the host VC for the SendPass View. This allow me to proper display it and keep it contained inside the SendPass flow.

To test

  1. Start the app
  2. Ensure you the Referrals FF enabled and you are using a Plus or Patron account
  3. Go to Profile
  4. Tap on the gift icon on the top left
  5. Tap On Share Guest Pass
  6. See the Share system view
  7. Choose different types of Share and check if they work:
  8. Share and see if you go back to the profile screen.

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@SergioEstevao SergioEstevao changed the base branch from trunk to referrals/update_to_unlimited_passes September 13, 2024 16:12
# Conflicts:
#	podcasts/en.lproj/Localizable.strings
Base automatically changed from referrals/update_to_unlimited_passes to trunk September 17, 2024 10:28
@SergioEstevao SergioEstevao modified the milestones: 7.73 ❄️, 7.74 Sep 17, 2024
@SergioEstevao SergioEstevao marked this pull request as ready for review September 17, 2024 11:22
@SergioEstevao SergioEstevao requested a review from a team as a code owner September 17, 2024 11:22
@SergioEstevao SergioEstevao requested review from danielebogo and removed request for a team September 17, 2024 11:22
Copy link
Contributor

@danielebogo danielebogo left a comment

Choose a reason for hiding this comment

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

Hey @SergioEstevao works as described.
I just left few comments about the URL which can be replaced by a constant we already have

@@ -500,7 +500,7 @@ class ProfileViewController: PCViewController, UITableViewDataSource, UITableVie

@objc private func referralsTapped() {
hideReferralsHint()
let viewModel = ReferralSendPassModel(offerInfo: referralsOfferInfo,
let viewModel = ReferralSendPassModel(offerInfo: referralsOfferInfo, referralURL: URL(string: "https://pocketcasts.com"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: we have a Server constant called pocketcastsDotCom -> ServerConstants.Urls.pocketcastsDotCom. We use it in few spot like the sharing helper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, but the URL here will be something defined by the server for each user... so this was a temporary use. But I updated it here to use the constant for now.

podcasts/Referrals/ReferralSendPassView.swift Outdated Show resolved Hide resolved
@SergioEstevao
Copy link
Contributor Author

@danielebogo can you give it another look

Copy link
Contributor

@danielebogo danielebogo left a comment

Choose a reason for hiding this comment

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

:shipit:

@SergioEstevao SergioEstevao merged commit 4276d07 into trunk Sep 18, 2024
4 of 6 checks passed
@SergioEstevao SergioEstevao deleted the referrals/send_pass_share branch September 18, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants