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: Integrate api calls on claim referral #2223

Merged
merged 17 commits into from
Oct 1, 2024

Conversation

SergioEstevao
Copy link
Contributor

@SergioEstevao SergioEstevao commented Sep 27, 2024

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

Fixes #

1 2 3
Simulator Screenshot - iPhone 16 Pro - 2024-09-30 at 14 53 44 Simulator Screenshot - iPhone 16 Pro - 2024-09-30 at 14 59 24 Simulator Screenshot - iPhone 16 Pro - 2024-09-30 at 14 59 27

Integrates the API calls to the claim referral flow:

  • validate: before the IAP purchase is done
  • redeem: after the IAP purchase is complete

Note at the moment this flow only works correctly for logged in users, for users without an account yet I will do a follow up PR to check for login.

To test

  1. Configure the podcast scheme to use the StoreKit Configuration file: Pocket Casts Configuration.storekit
  2. Start the app
  3. Ensure that you have the referrals FF enabled

Get a referral url

  1. Login with an account that has an Plus or Patron active
  2. Go to Profile
  3. Tap on the gift icon on the top left
  4. Tap on the Send Pass
  5. Send the URL to the reminders app
  6. Save it in Reminders

Use the referral url

  1. Now login with an account that doesn't have a subscription
  2. Switch to the Reminders app
  3. Tap on the referral URL
  4. The PocketCasts app should open an show the claim guest pass screen
  5. Tap on Activate Pass
  6. You should see a loading item on the button
  7. Then you should see the IAP screen
  8. Purchase the subscription ( This is using Xcode IAP simulator so no need to insert card)
  9. The flow should finish and return you to main screen

Test claim in again

  1. Switch back to Reminders app
  2. Tap on the deep link for referral
  3. Check if Pocket Casts app open and show the claim guest pass screen
  4. Tap on Not Now
  5. Check if you see the claim referral cell on the Profile tab
  6. Tap on it
  7. Tap on Activate Pass
  8. You should see The offer isn't available 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 modified the milestones: 7.74, 7.75 Sep 30, 2024
@SergioEstevao SergioEstevao marked this pull request as ready for review September 30, 2024 15:23
@SergioEstevao SergioEstevao requested a review from a team as a code owner September 30, 2024 15:23
@SergioEstevao SergioEstevao requested review from danielebogo and removed request for a team September 30, 2024 15:23
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.

@SergioEstevao everything seems working fine.
I just had a problem with the last step, as (I think) I had to remove the purchase from the debug panel to show the banner.
Code looks good. I just left a question but not a blocker.

Comment on lines 30 to 31
Task {
await MainActor.run {
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: can we just dispatch on the main queue? As we don't have to await for other task.

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 call out, just did it here: 643d9d8

@SergioEstevao SergioEstevao merged commit 9ac2397 into trunk Oct 1, 2024
4 of 6 checks passed
@SergioEstevao SergioEstevao deleted the referrals/integrate_api_calls_on_claim_referral branch October 1, 2024 10:52
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