Cannot test in-app purchases in Xcode 9 for macOS app - macos

As of the release of iOS11 it has been a pain (if not impossible) testing in-app purchases. While I've found a great workaround for testing on iOS here: https://stackoverflow.com/a/46467498/4514671 I could not find anything for macOS apps.

So here is what I did that kind of does the same as with the iOS workaround:
In the App Store app Sign Out of your account (Store/Sign Out)
In iTunes Connect create a brand new Tester
Restart your computer
Open your Xcode project
Build & run
Click on your Buy button to start a purchase
Sign in with your newly created test account
When prompted to Change the store click on Cancel
Click on your Buy button to start a purchase again and the correct Buy Alert will pop up; finish the transaction by actually making the purchase
Done! Hours of frustration saved! Thanks Apple :[

Related

macOS In-App Purchase in sandbox environment not authorised

I'm trying to get In-App Purchases (IAPs) working in a macOS app using the same Swift code, sandbox testers, and iTunes Connect account that I used for my iOS app. However, I can't get it to work. I'm using macOS High Sierra 10.13.6.
Open app
Apple's IAP testing recommendations are found here:
On a development macOS device, sign out of the Mac App Store. Then build your app in Xcode and launch it from the Finder.
If the text “[Environment: Sandbox]” doesn’t appear, you’re using the production environment. Make sure you’re running a development-signed build of your app. Production-signed builds use the production environment.
I have followed these steps by signing out of the Mac App Store, and building my app – signed for development – then launching it from the Finder. This means I don't get debug logs, unfortunately.
Navigate to table of products in-app
Here's my table of products:
I can buy a product by pressing the "Free" button or the "£4.99" button.
Attempt to buy product by pressing "Free"
After a short wait, brings up this popup saying 'Sign-in required'. I sign in using one of my sandbox testers (note: I have tried five different test accounts now, all of which worked on an iOS app under the same iTunes Connect account), registered with email addresses that aren't Apple IDs:
Having selected 'Buy', a short wait after that, this next popup appears:
After selecting 'Cancel' (as recommended here), after a short wait, the next popup appears:
You are not authorized to make purchases of this InApp in Sandbox at this time.
[Environment: Sandbox]
So I'm not sure whether it logged me in or not, and I assume that my purchase has failed (my table UI doesn't update to say 'purchased'). Note that I have also tried pressing 'Change Store' here, and it still fails ultimately.
Attempt to buy product by pressing "Free" again
This time, I'm not prompted to log in; I'm instead asked immediately whether I'd like to purchase the product. I click 'Confirm'.
However, now the purchase transaction never completes:
What might I be doing wrong? Do I need to log out of anything (e.g. iCloud) in Settings > Internet Accounts too?
Seems lame, but I eventually solved this by making new Sandbox tester accounts (tip: this time, I configured them as being US-based to avoid the complication of switching stores during the payment flow).
I think the problem was that I hadn't verified the Sandbox tester accounts I'd been using. This is either because Apple's email asking me to verify/activate the Sandbox tester accounts got sorted into my junk mail and missed completely, or because their backend had been having problems when I did click the link in their emails (I experienced both of these behaviours).

How to build app on iphone/physical device without developer account?

I have xcode 8.3 along with mac sierra10.12.4 and i am building cordova app .am not able to build/generate app on iphone.I didnot have apple developer account so am trying with appleid but am not getting provisioning profile.App builds in simulator only.How to build app on iphone/physical device without developer account?
You don't need Paid Apple Developer Account to run app on your device , but you do need Paid Apple Developer account for app distribution. To run the app on your iPhone, you just need to enter your Apple developer account credentials in the Xcode like this :
After adding your apple developer account, just follow these and you will be able to run the app, small note before doing this select your device from the dropdown list.
You need to sign up your Apple ID to be a free developer account. This will allow Xcode to create free, 7-day provisioning profiles that you can use to build to a connected device.
For more information, you can see this tutorial. You seem like you already have an Apple ID, so you can skip step 1. But follow the other steps to make it a dev account and then link it inside Xcode.

In-App purchase not working after creating new iTunes connect test user

My problem is testing In-App purchase in my Mac OS X application; it seems to me that the problem is related to my test account. I could test IAP on my own Mac quite well with a test user account before. But a few weeks ago while I was trying to make a purchase in sandbox a dialog box showed up saying that I should review my account information on App Store, I made a mistake by logging into the real App Store and my test account can't be used for testing now.
Here is the problem: I deleted the old test account and created a new one. Now, when I want to test the IAP the dialog box that asks if I want to purchase a product in sandbox environment and the next one that prompts for user/pass don't show up.
Using NSLog I figured out that when I enter In-App store, products are being loaded and when I click on a product to buy it, app starts buying product with product ID. If I am right, at this stage the prompt should show up saying: do you want to buy product myproduct [sandbox environment]? But this dialog box never shows up! I never experienced the same problem with the old test account.
Any suggessions?
The problem is resolved. I can now test IAP using my new test user account AFTER I updated iTunes!

Mac App Store possibility to allow free download of paid app

I am having an application which I will be putting into the Mac App Store soon.
It will be a paid application.
It is my first app I'm transmitting, so please excuse my lack of knowledge so far.
I have some guys that helped me a lot during the development with testing and stuff.
As some kind of reward we arranged that each of them will get his version of the app for free.
The thing is that I did not think of code signing and security stuff in the beginning and now I'm having a bit of a dilemma.
I could of course give them a non-code-signed version of the app, but I do not want to have another development branch for these versions in case of future updates.
Is there any possibility for them to download the app from the App Store legally with some kind of "voucher"?
For each version of your app that you submit to the app store, you can generate 50 promo codes, which can be redeemed in iTunes
Note: promo codes expire after 30 days. I usually only generate 10 at a time, keep them safely stored in a text file with the date of generation, and delete them after sending to an individual.
To create promo codes:
1) In iTunes Connect, click "Manage your Applications"
2) Click the app
3) Click "View Details"
4) Click "Promo Codes"
For my Mac store app, I only have Release builds code signed (and sandboxed as well). Debug builds are not code signed / not sandboxed and have a "Beta" attached to the bundle ID (thus avoiding issues with non-sandbox and sandbox versions of the same bundle ID). I can then quickly give out betas to testers.
Yes, it's possible. On iTunes Connect you can create promo codes which these testers can "redeem" to get a full copy of your app on the Mac App Store.
Look for this button:

How do I access my iPhone 4's UDID?

I have just bought an iPhone 4 for development.
Unfortunately, I forgot to register my phone to my development account before I tried installing the iOS 4.3 beta 2 software.
Now I can't restore my iPhone because I haven't got my UDID in my developer account, and I cannot get the UDID in iTunes because my phone is stuck in recovery mode.
Does anyone know how to restore my phone, or how to get the UDID into the developer account so it can be restored?
Thank you
Try this online service — http://get.udid.io
You should open the site on your mobile, tap the button and follow instructions, I've been described in my blog. It's easy as taping "Next" every time. Hope it helps.
You should be able to just click "Restore" in recovery mode in iTunes and it'll restore the current 4.2.1 firmware.
Perhaps you need to put it in DFU mode first.
Can't you downgrade the firmware by downloading the older version from the internet and hold shift and click restore and select the firmware file?

Resources