Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entitlements duplicate entries #177

Open
sanderschnydrig opened this issue Mar 22, 2023 · 3 comments
Open

Entitlements duplicate entries #177

sanderschnydrig opened this issue Mar 22, 2023 · 3 comments

Comments

@sanderschnydrig
Copy link

sanderschnydrig commented Mar 22, 2023

Hi Max! Hope you're well.

Not really an issue but more of a question:

I have two targets that I use the application for. One of those targets has recently gone through a domain change. Now I'm trying to keep the old domain for deep linking only for one of the targets:

<key>com.apple.developer.associated-domains</key>
<array>
    <string>applinks:example.ch</string>
    <string>applinks:exampletwo.ch</string>
</array>

Which works fine, but when I'm applying the config for the other target I get a duplicate entry:

<key>com.apple.developer.associated-domains</key>
<array>
    <string>applinks:example.ch</string>
    <string>applinks:example.ch</string>
</array>

Since the other target does not need backward compatibility. I managed this using the following trapeze config:

platforms:
  ios:
    targets:
      App:
        entitlements:
          replace: true
          entries:
            - com.apple.developer.associated-domains: ['applinks:$BASE_URL', 'applinks:$ALTERNATIVE_BASE_URL', 'applinks:$NEWSAPP_PAGE_LINK']

Is there a way I can remove the ALTERNATIVE_BASE_URL applink for the second target (i.e. conditionally add entries to this array used for com.apple.developer.associated-domains)?

Best regards

@mlynch
Copy link
Contributor

mlynch commented Mar 24, 2023

I'm not quite following. If you have two targets then you would use two different blocks under the targets: entry, right? And they would have different entries below, so you could replace them separately. Or if I'm not understanding can you rephrase it?

@sanderschnydrig
Copy link
Author

sanderschnydrig commented Mar 27, 2023

@mlynch sorry I should have elaborated more.

With target I mean one of our clients (we use the same codebase and whitelabel it so that our clients get an application with the same features but different databases and color themes for example). And every client has their own domain with their own configs etc.

Trying to avoid redundancy in the code is why I'm using a single yaml file for the capacitor configuration with trapeze for all clients.

One of our clients has recently switched their domain. In order to preserve backwards compatibility with old deeplinks for only 1 single client, I was wondering if it's already possible to achieve this, so building the application for one client with all configs would give us the com.apple.developer.associated-domains entitlements for both domains example.com and exampletwo.com. However for the other clients we only need 1 single value for that entitlement key: examplethree.com.

For now I just duplicate the examplethree.com domain for all other clients (as they dont need a secondary domain but still need this .env variable for a secondary domain, I guess), so far it seemed to work.

TLDR

Is there a way to omit the secondary domain (ALTERNATIVE_BASE_URL) from the array below for our customers that dont need one?

platforms:
  ios:
    targets:
      App:
        entitlements:
          replace: true
          entries:
            - com.apple.developer.associated-domains: ['applinks:$BASE_URL', 'applinks:$ALTERNATIVE_BASE_URL', 'applinks:$NEWSAPP_PAGE_LINK']

If not we will just use the duplicated entry, seems to be no problem. Was just wondering if its possible somehow.

@mlynch
Copy link
Contributor

mlynch commented Apr 5, 2023

Yea I'm not sure, I would just duplicate the entries for now. Sorry, I'm having trouble understanding the use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants