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

How to display the price without store.refresh() #217

Closed
Sanafan opened this issue Jun 12, 2015 · 7 comments
Closed

How to display the price without store.refresh() #217

Sanafan opened this issue Jun 12, 2015 · 7 comments

Comments

@Sanafan
Copy link

Sanafan commented Jun 12, 2015

Hey Guys,
we have an Application in which we have some non consumeable products. We want to display the price for the user, but therefore we need store.refresh(). Apples Guidelines are clear: If you want to display the price, you have to take the price which comes from your request to the server.

So if i no implement store.refresh() it will prompt the user to sign in into his apple ID but this isn't a normal behaviour.

If i choose an application from the app store, which has InApp-Purchases, and i start the application for the first time, i don't have to log in to the the prices for the inApp-Purchases.

So... does anybody have an idea how to fix this or what would be the best workflow for that? I don't want the user to enter his password, only for the reason, that he's able to see our prices.

And if i would need the user to login into his apple id, why do i retrieve title, description and price although i click cancel when the login window appears.

@uareurapid
Copy link
Collaborator

You need to connect to the Apple server to get the product details, period.
An app downloaded from the store is different than testing In-App purchases on sandbox.
When you download an app from the app store, you´re already logged in, otherwise you couldn´t download it, so it will not ask your credentials again.
Now, when testing In-App purchase on sandbox mode, things are a bit different and can be a bit tricky. There are some rules to follow:
1 - Make sure you start logged out, got to settings->iTunes & app store and sign out of any account.
2 - When prompted for credentials, use a sandbox testing account, do not use a real account or start mixing them, cause things tend to become even more confuse.
Then purchase your products,
if for some reason you need to restart the app, than you´ll need to repeat the steps

@Sanafan
Copy link
Author

Sanafan commented Jun 12, 2015

Man... this took us 2 days to get the helping answer! Thanks in advance, thats great to hear.

So, if i'm not in sandbox mode, the store.refresh() will not prompt up a login window where i have to enter my password? I have to request the prices every time the user starts the application because i need them from the apple server. I'm testing on a real device (testing device) on which is no apple id logged in.

@uareurapid
Copy link
Collaborator

You mean in production env? When you´re just using the app downloaded from the App Store?
No, it should not since you´re already logged in with your real account, and you´re just getting the product details, not buying anything.
However, it is possible that at the moment that you actually purchase it can ask you a password just for confirmation (this depends of the device configurations on Settings-->iTunes & App Store-->Password Settings). There are some options there regarding "password requirement" for in-app purchases that should be considered

@Sanafan
Copy link
Author

Sanafan commented Jun 12, 2015

Okay, so i think i'm able to figure out the process round about store.order() - the only thing which took us to days now was store.refresh() because of this stupid popup which appears every time we call the page, where our inApp-Purchases are listed because we need the prices on that page.

Do you think that is the right way?

  1. User opens Page with things to buy
  2. I'm checking his connection, if true i open the page, if false i show a popup.
  3. If true i'm displaying that site and set the store.ready(true).
  4. After that, i'm running store.register(), registering my products.
  5. When the register is succesfull i would run store.refresh() to retrieve the prices.
  6. If the user now chooses to buy a video, i would run the full store.order() process with fallbacks etc.

@rwillett
Copy link

Thats the way we're doing it.

InApp purchasing using a Sandbox is really tricky on an iPhone. Its a real PITA.

@Sanafan
Copy link
Author

Sanafan commented Jun 16, 2015

I found out, that these crappy (sorry) window only pops up if you connected your device to xcode. After i did a reinstall from the application on my ipad and plugged it off, all worked totaly fine for me! :)

@stale
Copy link

stale bot commented May 11, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 11, 2018
@stale stale bot closed this as completed Jun 10, 2018
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

4 participants