Working on first iOS in-app purchase app... questions

Interesting. Thank you Jeremie. Are you suggesting to not include a clear in the final app for risk of clicking while not connected?

Yes that’s what I am suggesting.

Very good. I do appreciate all of the help from you guys! Going to submit to Apple now and we’ll see what happens. Maybe when it’s live, I can have someone download it and try the Restore button to see what happens. Hopefully won’t be an easy way for someone to get a free app :slight_smile:

Why don’t you distribute it through TestFlight first ?

Another great suggestion thanks! Didn’t even think of it. Ok, TestFlight is set up. Who wants to try it out for me?

Preface: I created the app itself in about a week and a half. My goal was to learn IAP to use on another app, not to make a super awesome app that I expect to make oodles of money, so don’t expect a mind-blowing experience :smiley:

Send me a DM with your email address if interested

I just threw together an extremely quick and dirty example of how the Notification_Center works (in a desktop app since the module is pure Xojo and works on any platform :slight_smile: ). You can find it here:
https://www.dropbox.com/s/am7zl44x7df0zbz/notification_example.xojo_binary_project?dl=1

For StoreKit + Notification_Center, there should be an event with “name” SKProvideContentForProductNotification (a constant defined in the InAppPurchaseHelper class) that is triggered when a product is purchased/restored. As long as you have subscribed to that notification name, you’ll receive a notification with a userDict containing a single key of “productID” and a value of the ID string for the item that was purchased. Hopefully that makes sense :slight_smile:

Hi Jason. Thank you for this. I will be delving into your project momentarily.

So I’ve hit a roadblock. I submitted to Apple last night and the app was rejected. Here is their response

[quote]We found that your in-app purchase products exhibited one or more bugs when reviewed on iPad running iOS 13.2.3 on Wi-Fi.

Specifically, we were unable to purchase your app’s IAP content at time of review, as nothing happened within your app when we actioned the “Purchase!” tab.

Next Steps

When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code “Sandbox receipt used in production,” you should validate against the test environment instead.[/quote]

When I tested on my phone and my wife’s, clicking the Purchase button did pull up the box to enter in your Apple ID and password, so I’m not sure why their test didn’t. Unless they mean the best approach is to close the purchase view after the purchase is successful, which the app does not do at this time. Instead, I have a “thank you” label and a close button that appears after the purchase is successful.

In addition, I had not implemented a validation of receipts as they have in their Next Steps. Missed that step. Unless the dim productPurchased as Boolean = Foundation.NSUserDefaults.StandardUserDefaults.BoolForKey(productID) piece covers this, which I do use in the app startup and after purchase is successful. Once this returns True, the full features are enabled

Could their testing just be wrong? Would anyone like to send me a DM with their email address so I can add you to TestFlight to try it out?

Just sent you a DM with my email address. I’ll let you know my thoughts as soon as I test the app.

I do not thing their testing can be wrong for this, they test thousands of app every day and do expect the app to do something when the purchase is completed.

EDIT:
I do not validate receipts with my server, I just log the purchase in the database with userID, transactionDate, purchaseID and some additional information for analytics.

Validating is especially useful for subscriptions but not really for one-time purchases IMO.

Thank you. I just sent you the invite. Not sure if I did everything correctly in TF. First time using

My new iOS app with in-app purchases got approved earlier this week! Many thanks to Jason King for compiling the StoreKit together for us and to Jeremie Leroy for the personalized help last week and for paving the way with your creativity and inspiring apps

I’m hoping to set some time aside next week to work on an IAP tutorial and sample project. Hopefully others will find it helpful

Thanks again all and happy thanksgiving

1 Like