-
IAP problem
Hi Everyone,
I am trying to add a check for my IAP store. I am using the "Can Payments be made?" condition as a gatekeeper for my shop. My events look like this:
+Button is pressed
+Can payments be made?
- Open shop
+Button is pressed
+Can payments be made? (NEGATE)
- Open popup message "Connect to the internet"
It seems that no matter what, the button produces no results. According to the docs, this condition checks for internet connection. Is there some other thing on the device that needs to be enabled for the condition to return true? I am testing this on a sandbox account using wifi on an ipod5.
Any insight is appreciated,
Reg
-
By pressing the button, neither the shop nor the popup message displays? Am I understanding correctly?
I would try the following: set a flag if payments can be made or not. And test for that flag when pressing the button. You could also enable/disable the button according to the "Can payments be made?" condition. That's what I am doing and it works well in sandbox.
-
Yea, neither of them displays. I was assuming that a negated condition would act as a "False" return, and would therefore open the popup message. I'll try a "middleman" flag as you suggested and see if it works.
Thanks,
Reg
-
The flag solution doesn't change anything. I can't tell if this condition is actually doing anything, but since the flag should be false by default, I would expect the popup to display. Unfortunately, it does not display. Nothing displays. Sadly, I can't test any of this on PC, since that flag always returns true (unless that is supposed to be the case).
-
Ah yes, this condition is always true with the Windows runtime. This should be added to the Help file.
-
Mobichan - stick a sample in there to play as the first action, that way you'll be able to audibly tell whether or not the event has started executing; if it does then the conditions were met...
-
There is a sample in there, but alas (on device) nothing plays. :'<
-
I am just now realizing that I am requesting 3 product information actions in a single event and that might not be a good approach. Is this something that needs to be cued up so that I only request one at a time and then on receiving the first item's info, I then request the next in the cue? Has anyone got a successful approach they can share?
-
You can request any amount of product information simultaneously. IIRC Anders is doing it in his IAP example. Works great.
-
Thanks. I just noticed that example and was looking at what he did. Since my code needs to have all the prices before drawing the screen, I am trying to pause player input while they wait for the prices to come from Apple's server. Although this could potentially take a while, I am gating the player's control by waiting for the "On request response" for each item to be sent. When all 3 come back, then the shop should be displayed.
Can anyone give a rough estimate how long it takes for sandbox prices to be received? I only have 3, but I wanted to make a timeout for this in case someone waits too long for the data. I have it set to 20 seconds right now, but the prices are never received.
-
For me it takes about 1 to 2 seconds for the prices to appear in sandbox.
-
I was afraid of that. Is it possible this only works in final release code? I have triple checked the spelling of the IAP identifiers, so I can't figure out why the data is never received. One thing the example does differently is it uses more generalized calls. I am actually using the "specific item" callbacks. Has anyone successfully used those? I am just trying to rule out possible bugs here.
-
Do you check for errormessages? It might give you something useful.
-
I added some conditions for "On invalid identifier" with a sound effect and it seems to play the sound effect. This makes me think the name of the identifier is wrong. I am double checking it everywhere I can, but that is something my publisher sent me, so they control the itunes connect side of the equation, unfortunately.
Since the publisher is in Germany, I might have to wait until the start of work tomorrow morning. Sigh...
-
Have you finished your tax information? If you haven't then IAPs won't work. Even in sandbox. I discovered the same problem myself.
And to answer your other question, no it isn't required to have your app released for the IAPs to show up.
-
I'll check with my publisher about the tax info. Thanks for the heads up. By "release" I meant the Final Build code" option in MMF. I remember in the past some things only worked in FInal Build code as opposed to working with cci files.
-
Sorry to go on and on about this but I really can't quite understand what the "Can payments be made?" condition is looking for. The help file describes it as checking if you are online, but if I turn on airplane mode or turn off wifi, I would expect the condition to return false. But on device it always seems to return true.
-
"Can payments be made?" isn't for the internet connection. It's for the devices permissions settings. If IAP's are turned off in the device options your buttons for payment should vanish. It's an Apple user experience thing for users that don't want in-app purchases.
You can test this by disabling IAPs in settings and you'll see that it returns true.
Make sure when you're loading your store to add a time out feature so that it won't get stuck if the user isn't online.
-
Directly from the MMF help file:
Can payments be made?
Tells you if it is possible at the current time to make store purchases. If there is no internet connection or connection to the Apple store, this event will not be true.
It is advisable to use this condition in any event where you want to query the store for information or request for payments.
This is why I assumed it detected an internet connection. Can someone from Clickteam confirm this?
-
Check it out for yourself and you'll see that I'm right!
-
By golly, UrbanMonk is right!
-
Yup, he is right. But I am getting frustrated by mysterious function of this condition. I wish it was better documented EXACTLY what it is checking for.
-
I don't think even Clickteam knew. They just added all the functions from the Apple documentation, and didn't actually test them fully. I guess that's our job. :P
-
As I wrote in another thread I believe this functionality was changed in the Apple API at some time.
What do you prefer?
Should the 'Can payments be made' return false if there is no internet connection but it is allowed?
- or should it stay as it is now and then have an extra feature to test for a working internet connection?
-
Somewhere we already discussed a different function provided by Apple which checks for internet connection. Would be great if you can add this. (Maybe better to add it to the iOS Object?) This way we could check for IAP authorization and connection separately, which means we could show very clear error messages to the user.
-
+1 for the internet connection test, I think you can also return both (3G/EE or WIFI) too which would be cool...
-
I would rather have separate checks, one for network connection and one for IAPs. That way we can return a more relevant message to the user, like JoKa wrote.
This means that the "Can payments be made" condition is good as it is now. We would just need a network connection check in the iOS object preferably.
-
-
Great!
The way I checked if they had an interenet connection was by having a time-out. If it takes too long to get the prices it just times-out.
-
-
I agree it would be good to have 2 separate checks: 1 for IAP and one for internet. Just knowing if the device has an internet connection is invaluable. It will also help with Game Center. :)
-
Sorry, I was away for a bit and just now getting back... I'm all for a separate check too.