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

Test implementation of simulatesAskToBuyInSandbox #453

Open
3 of 9 tasks
lukegf opened this issue Mar 18, 2019 · 5 comments
Open
3 of 9 tasks

Test implementation of simulatesAskToBuyInSandbox #453

lukegf opened this issue Mar 18, 2019 · 5 comments

Comments

@lukegf
Copy link

lukegf commented Mar 18, 2019

Platform

  • iOS
  • macOS
  • tvOS

In app purchase type

  • Consumable
  • Non-consumable
  • Auto-Renewable Subscription
  • Non-Renewing Subscription

Environment

  • Sandbox
  • Production

Version

ℹ 0.14.2

Related issues

ℹ I didn't find any

Report

Issue summary

I don't know how to test the simulatesAskToBuyInSandbox feature.
I'm initiating a purchase with this code:

SwiftyStoreKit.purchaseProduct(self.product!, atomically: true, simulatesAskToBuyInSandbox: true) { result in
.. code here ..
}

And I'm handling the .deferred status on AppDelegate with the suggested function SwiftyStoreKit.completeTransactions(atomically: false)

So, the purchase is initiated correctly, the ask to buy is simulated correctly and the purchase is reported as .deferred.
However I don't know how to test the flow when a "parent" approve or deny the purchase because, as expected, I didn't receive any ask to buy notification as there is not a family group defined anywhere.

Is there a way to test this case? How can I test it?

What did you expect to happen

Some way to simulate the ask to buy approval/denial.

What happened instead

Nothing.

@raxxpack
Copy link

@lukegf I'm also interested in this, did you end up finding a way to test it?

@Sam-Spencer
Copy link
Collaborator

When you receive a deferral for a purchase, StoreKit will let your app know -- at some unspecified future time -- if the purchase is a success or failure. Other than receiving that deferral, not much should be different, as far as I understand. You should check your callback in appDidFinishLaunching....

@dorinsimina
Copy link

@lukegf did you found a way to test on sandbox? Keep getting the parent popup and I did not found from where to approve it. The testing account was not configured as a kid profile.

@Sam-Spencer
Copy link
Collaborator

If anyone would like to help tackle the new StoreKit Tests explained in issue #550, that would likely help with a solution for this issue.

@gerchicov-vg
Copy link

I have the same issue. In the same time how to switch to sandbox mode correctly? Or does an app do it automatically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants