Electron failed to setup iap sandbox environment

Hi there, I'm implementing in app purchase in Electron following docs here: https://www.electronjs.org/zh/docs/latest/tutorial/in-app-purchases

But :

  • getProducts returns []
  • calls to purchaseProduct, nothing happend(no dialog, no login)
  • calls to restoreCompletedTransactions , a login dialog appears, and I can login my sandbox tester account. The account even appears int the Apple Store.

More info list as follow.

Packaging using electron builder, configuration is :

"masDev": {
    "type":"development",
    "identity": "York Chan",
    "hardenedRuntime": false,
    "gatekeeperAssess": false,
    "entitlements": "./build/entitlements.mas.plist",
    "entitlementsInherit": "./build/entitlements.mas.inherit.plist",
    "provisioningProfile": './build/provisionloginsight.provisionprofile', //development的描述文件,确保系统描述文件里已经安装好
  },
  "mas": {
    "type": "distribution",
    "identity": "York Chan",
    "hardenedRuntime": false,
    "entitlements": "./build/entitlements.mas.plist",
    "entitlementsInherit": "./build/entitlements.mas.inherit.plist",
    "entitlementsLoginHelper": "./build/entitlements.mas.loginhelper.plist", //如果需要testflight则该项必须
    "provisioningProfile": './build/provisionloginsightappstore.provisionprofile', //distribution描述文件
  },
  "mac": {
    "artifactName": "${productName}_${version}.${ext}",
    "identity":null,
    "type": "development", //mas - distribution; mas-dev - development,
    "icon": "./icons/icon512.icns",
    "target": [
      {
        "target": "mas-dev",//mas
        "arch": [
          "universal"
        ],
      }
    ],
    "extendInfo":{
    }
  },

I wrap StoreKit API into 'Platform' class, and call from render process to main process using ipcRender.invoke

If I create a Xcode project, and set bundler identifier to the same one, configure the storekit in schema, I can successfully 'purchase', and seeing [Enviroment: Xcode].

Someone can help me please ?

Closing this. Issue resolved.

Just because I didn't finish my 'Bussiness' in Apple Store connect

Electron failed to setup iap sandbox environment
 
 
Q