This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 46298 - Xamarin seems to replace asterisk with bundle id in Entitlements.plist file
Summary: Xamarin seems to replace asterisk with bundle id in Entitlements.plist file
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: MSBuild (show other bugs)
Version: XI 10.2 (iOS 10.1)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Future Cycle (TBD)
Assignee: Jeffrey Stedfast
URL:
Depends on:
Blocks:
 
Reported: 2016-11-02 15:59 UTC by Jonathan Moosekian
Modified: 2017-01-13 21:21 UTC (History)
7 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Jonathan Moosekian 2016-11-02 15:59:13 UTC
In our iOS app, we can universally link into our app if we have the following in our Entitlements.plist file:

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

However, if we want to ensure subdomains are also handled by our app, Apple suggests adding the following as well:

<string>applinks:*.ourdomain.com</string>

So, the Entitlements.plist file now has this in it:

<key>com.apple.developer.associated-domains</key>
<array>
    <string>applinks:ourdomain.com</string>
    <string>applinks:*.ourdomain.com</string>
</array>

When we build our app and deploy to a device, our app will open if we tap a link like https://ourdomain.com/, but if we try https://www.ourdomain.com/ it just goes to the website via Safari.

When we looked at what the entitlements plist was in the app bundle using this command:

codesign -d --ent :- /Users/user/Projects/myproject/bin/Debug/build-iphone9.3-10.1/MyApp.app

It shows:

<key>com.apple.developer.associated-domains</key>
<array>
    <string>applinks:ourdomain.com</string>
    <string>applinks:com.myapp.ourdomain.com</string>
</array>

If we do the same things using Xcode, the end results show that the wildcard is NOT replaced as we would expect:

<key>com.apple.developer.associated-domains</key>
<array>
    <string>applinks:ourdomain.com</string>
    <string>applinks:*.ourdomain.com</string>
</array>
Comment 1 Jonathan Moosekian 2016-11-02 16:00:13 UTC
Here's my current bits:

=== Xamarin Studio Professional ===

Version 6.1.1 (build 17)
Installation UUID: e6b7c7a2-f9c2-4f5f-b1d4-a7cad7d4d849
Runtime:
	Mono 4.6.1 (mono-4.6.0-branch-c8sr0/ef43c15) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406010005

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.1 (11544)
Build 8B62

=== Xamarin.iOS ===

Version: 10.2.0.4 (Visual Studio Professional)
Hash: b638977
Branch: xcode8.1
Build date: 2016-10-25 14:38:48-0400

=== Xamarin.Android ===

Version: 7.0.1.3 (Visual Studio Professional)
Android SDK: /Users/jonathanmoosekian/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)
		7.0   (API level 24)

SDK Tools Version: 25.2.2
SDK Platform Tools Version: 24.0.3
SDK Build Tools Version: 24.0.2

Java SDK: /usr
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 2.10.0.105 (Visual Studio Professional)

=== Build Information ===

Release ID: 601010017
Git revision: 44d481a9be9cf2bf7c01bfb99c59b77dfa08e712
Build date: 2016-10-25 14:27:24-04
Xamarin addins: 19cdb28081bf28d9688698030abb96e04e391f69
Build lane: monodevelop-lion-cycle8-sr0

=== Operating System ===

Mac OS X 10.12.1
Darwin Jonathans-MacBook-Pro.local 16.1.0 Darwin Kernel Version 16.1.0
    Thu Oct 13 21:26:57 PDT 2016
    root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64
Comment 2 Sebastien Pouliot 2016-11-03 01:59:38 UTC
I think that it's part of the iOS Addin (XS) but Jeff or Vincent will be able to confirm (and fix it) in both cases.
Comment 3 Vincent Dondain [MSFT] 2016-11-09 15:24:52 UTC
Hi, I can confirm a couple of things. Indeed Xcode will leave the asterisk as is and I can reproduce the issue with XS/XI.

Here's the guilty code in our MSBuild tasks: https://github.com/VincentDondain/xamarin-macios/blob/master/msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CompileEntitlementsTaskBase.cs#L100-L117
Comment 4 Vincent Dondain [MSFT] 2016-11-09 15:25:37 UTC
Fixed in master with PR https://github.com/xamarin/xamarin-macios/pull/1147
Comment 5 Chris Riesgo 2017-01-11 14:18:03 UTC
Has this fix gone out in a Cycle yet? I didn't see the bug number listed on any of the release notes. If it hasn't gone out, is there a target?
Comment 6 Vincent Dondain [MSFT] 2017-01-12 15:50:56 UTC
Hi,

This was originally slotted for Cycle 10 but I just back-ported it so it's included in our Cycle 9 release: https://github.com/xamarin/xamarin-macios/pull/1484

I apologize for the fact it hasn't been done before.

After this is merged, the next refresh of our Xamarin.iOS 10.4 build (currently in alpha and beta channels) will include the fix.
You can still monitor the release notes to know when that happens.

Thanks.

Note You need to log in before you can comment on or make changes to this bug.