Using Universal links in Electron app on MacOS

211 views Asked by At

I'm trying to build and sign MacOS electron application for self-distribution using electron forge but if I add com.apple.developer.associated-domains to my entitlements, I get application launch error Library not loaded: @rpath/Electron Framework.framework/Electron Framework.

But if I setup provision profile manually from application /Contents/embedded.provisionprofile it will launch without any errors and Universal links feature also works.

If I remove com.apple.developer.associated-domains option from entitlements it also launches without any errors, but Universal links feature doesn't work obviously.

How should I sign my app to avoid manual provision profile installation?

forge.config.ts

osxSign: {
  identity: 'Developer ID Application: ***',
  provisioningProfile: './embedded.provisionprofile',
  optionsForFile: () => ({
    entitlements: './entitlements.plist'
  })
},

embedded.provisionprofile

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>com.apple.security.cs.allow-jit</key>
  <true/>
  <key>com.apple.security.device.audio-input</key>
  <true/>
  <key>com.apple.security.device.bluetooth</key>
  <true/>
  <key>com.apple.security.device.camera</key>
  <true/>
  <key>com.apple.security.device.print</key>
  <true/>
  <key>com.apple.security.device.usb</key>
  <true/>
  <key>com.apple.security.personal-information.location</key>
  <true/>
  <key>com.apple.developer.associated-domains</key>
  <array>
      <string>applinks:mydomain.com</string>
      <string>webcredentials:mydomain.com</string>
  </array>
</dict>
</plist>

Provision profile entitlements

'com.apple.developer.associated-domains': '*',
'com.apple.application-identifier': 'ZZ67H7XXXX.pro.***.***',
'keychain-access-groups': [ 'ZZ67H7XXXX.*' ],
'com.apple.developer.team-identifier': 'ZZ67H7XXXX'
1

There are 1 answers

0
JasonDesh On

Resolved by myself. Just moved from electron-forge to electron-builder with the same set of certificates, configurations and provision profiles and now it works as expected.