Hello.
I have an application that consists of two parts: Python (the main app, which works as a server) and Electron ("helper" app, which works as a UI).
I plan to submit it to the App Store, so it's sandboxed.
Right now, I'm testing the sandboxed development-signed build, and I have a problem with it.
Some info about the entitlements and signing:
The Python app is packaged with Py2App (I heard that it's the only possible way to package a Python app for the App Store).
The Python app has com.apple.security.network.client, com.apple.security.network.server, and sandbox entitlements, I sign it using the Mac Development certificate.
The Electron app is packaged with electron-builder and signed with electron-osx-sign (Mac Development certificate, as well).
The Electron app has standard entitlements, I just added the sandbox and security.inherit to its entitlements.
I have generated the development provision profile and embedded it into the app's bundle.
Yes, I know that this architecture is a bad choice for the macOS/App Store, I'm aware of it.
The project is 99% done, and it's just easier for me to somehow overcome this issue, rather than rewriting everything from zero to Swift/Obj-C.
So, when the user clicks on the .APP, this is what happens:
the Python app starts, it creates the server, and finally, launches the Electron.
The problem begins here: the Electron successfully starts but fails to load the server's URL.
I tried to open my server's URL in Chrome and everything works fine.
So this problem is related to the Electron or maybe entitlements.
I also tried to load any other webpages, like google.com, and it still doesn't work, I get the exact same error.
When I load the page (like calling the app.loadURL or changing the window.location.href), these messages get printed out in the Console:
default 13:36:40.749975 +0200 trustd cert[2]: AnchorTrusted =(leaf)[force]> 0
default 13:36:42.903489 +0200 symptomsd rssi (-49) or transmitRate (145.000000) changed on interface en1 for BSSID:b0:95:75:21:bc:d8
default 13:36:50.909786 +0200 symptomsd rssi (-50) or transmitRate (145.000000) changed on interface en1 for BSSID:b0:95:75:21:bc:d8
default 13:36:51.321708 +0200 trustd could not enable test hierarchy: no UAT pinning preferences set
I googled this "no UAT pinning preferences set", and didn't find anything useful.
These messages are always the same, it doesn't matter if I try to open a localhost page or google.com.
I also tried using "fetch" in the Electron's app console, it outputs this error:
>>> await fetch("https://google.com")
---> VM123:1 GET https://google.com/ net::ERR_NAME_NOT_RESOLVED
---> VM123:2 Uncaught TypeError: Failed to fetch
---> at <anonymous>:1:7
I think that this issue is somehow related to security.inherit entitlement.
Maybe when I launch the Electron, Python's entitlements don't get passed to the Electron?
So, Electron doesn't inherit the "com.apple.security.network.client" entitlement and has no right to load any web pages, am I right?
If yes, then how should I properly launch the Electron?
Currently, I tried using the "open" command and an AppleScript, the error stays the same in any case.
Here are the commands I used:
Open:
open "MyPythonApp.app/Contents/MacOS/MyElectronApp.app"
AppleScript:
osascript -e "tell application \"MyPythonApp.app/Contents/MacOS/MyElectronApp.app\" to activate"
I sign the Python app with these entitlements:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>com.abtco.myquickmaclite</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.assets.pictures.read-write</key>
<true/>
<key>com.apple.security.assets.music.read-write</key>
<true/>
<key>com.apple.security.assets.movies.read-write</key>
<true/>
</dict>
</plist>
And the Electron app with these ones:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.inherit</key>
<true/>
</dict>
</plist>
Mac Mini 2012 (macOS 10.13.6)
Python 3.9.1
Electron 16.0.5
Thank you.
Post
Replies
Boosts
Views
Activity
Hello, Apple Developer Forum team.
My team wishes you happy New Year and late Merry Christmas!
We wish you a pay raise and a lot of days off! :)
Right now, my company works on a new program called MyQuickMac for macOS, which we plan to submit to App Store.
Currently, my developer team is working on adding the in-app purchases to our product.
While working on it, they encountered several issues, and this is exactly why I'm writing to you.
Below, my team describes exactly which error did they encounter, and what did they try to resolve it.
Please help us resolve these problems, it's very important for us.
Our current product is built using Electron and Python as a server (Flask).
We use the "InAppPurchases" module from Electron to add the in-app purchases (https://www.electronjs.org/docs/latest/tutorial/in-app-purchases).
Currently, we use the Sandbox to test our system, and we encountered the following problem when we try to purchase any product:
Purchasing mqm_1y2m...
{
transactionIdentifier: '',
transactionDate: '',
originalTransactionIdentifier: '',
transactionState: 'failed',
errorCode: 0,
errorMessage: 'MZFinance.NoAccount_message',
payment: { productIdentifier: 'mqm_1y2m', quantity: 1 }
}
{ productIdentifier: 'mqm_1y2m', quantity: 1 }
Failed to purchase mqm_1y2m.
This error occurs when we click on the "Buy" button, after our program submits the payment to the payments queue.
The payment is successfully added to the payment queue, but after we log in with our testing account, this error occurs.
We have read the documentation (https://developer.apple.com/documentation/storekit/in-app_purchase/testing_in-app_purchases_with_sandbox?language=objc), and it says that to test the in-app purchases, we need to try to buy the product, log in with the testing account, and after this testing account will be added to the App Store automatically, but it doesn't happen.
What do we do wrong? We tried creating several testing accounts, but none of them worked.
Also, we can't sign out of the testing account after logging in.
Currently, to do this we have to clear the App Store cache, remove all testing account-related items from the Keychain and reboot our device, which is a long process.
We have read that to log out of the testing account, you need to select "Sign out" from the App Store, but because of the problem specified above, the App store doesn't have this option.
Is this the correct way to sign out of the testing account? We hope that there should be some easy way to do it.
We tried to find some information about the error "MZFinance.NoAccount_message", but there were only 5 results, and none of them were helpful.
We tried the following to resolve this error:
created different testing accounts (we tried 3 accounts, none worked)
changed the country of the testing accounts
cleared the payment queue
reset the password of the testing account
tried different products
tried to log in to the App Store and iCloud with the testing account
restarted our device numerous times
cleared the App Store cache
deleted the entries left after trying some testing accounts in the Keychain
signed the Electron ".app" with our certificate
None of these helped us, we get the same error every time.
Here's the link to the code we use to initialize the payments and observe the queue.
Initialize payments: https://pastebin.com/S9KvsNGK
Observe queue: https://pastebin.com/v1Gmqqz5
Also, we attach 2 log files that were recorded with the "Console" application, while trying to purchase a product.
Log #1 (all messages): https://pastebin.com/jpuJaMqv
Log #2 (only messages from "commerce" process): https://pastebin.com/w27qkyEB
So, our questions are:
Why testing account isn't added to the App Store?
Why does "MZFinance.NoAccount_message" error occur?
How do we log out from the testing account?
We hope that the Apple Developer Forum team will help us resolve these issues.
Some information:
Device: Mac Mini 2011 with macOS 10.12.6
Electron: 16.0.4
Python: 3.8.8
If you need any other information, please let us know, and we will send it to you as soon as possible.
I hope that together, we will resolve these problems, and our new program will be successfully submitted to the App Store.
Thank you and have a nice day!
Oleksii and team.
Owner of American Best Technologies Company, LLC.
Hello!
I would like to a deploy a program (more on which later) to the Apple Store, and I have a couple of questions regarding Apple Pay API usage.
My product will be a paid program, and I have some problems with the Apple Pay API due to technical reasons.
My program is an "Electron-like" application, it consists of two parts, backend, and UI.
The "Backend" runs directly in the user's computer, it's written in Python and Flask.
The "UI" is actually a browser that opens a webpage from the "Backend", and interacts with it using AJAX.
The issue here is that I don't understand how in-app payments can be implemented.
As far as I understand, the only option to deploy a paid application and the Apple Store is to use Apple Pay API, which is only available from Swift or Objective-C.
I don't understand how can I use Apple Pay API, how I can check for a valid payment, etc.
Can you please send me some kind of guide, tutorial, or instruction that can help me to use Apple Pay in my program?
Thank you very much,
Alex.