Automattic / pocket-casts-ios

Pocket Casts iOS app 🎧
Mozilla Public License 2.0
1.66k stars 133 forks source link

Referrals: Integrate api calls on claim referral #2223

Closed SergioEstevao closed 1 month ago

SergioEstevao commented 1 month ago
📘 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:

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