firebase-unity-sdk
firebase-unity-sdk copied to clipboard
[Bug] Dynamic Links on iOS doesn't open and iOS 16 metadata issue
[REQUIRED] Please fill in the following fields:
- Unity editor version: 2020_3.23f1
- Firebase Unity SDK version: 10.0
- Source you installed the SDK: .unitypackage
- Problematic Firebase Component: Dynamic Links
- Other Firebase Components in use: Crashlytics, Analytics, Messaging
- Additional SDKs you are using: Facebook, GoogleSignIn, Spine, AppleAuth
- Platform you are using the Unity editor on: Windows
- Platform you are targeting: iOS
- Scripting Runtime: IL2CPP
- Pre-built SDK from the website or open-source from this repo: _____
[REQUIRED] Please describe the issue here:
We tried to open a Deep Link on iOS but it doesn't open app.
We did all steps documented on Google about to make setup on iOS also we putted on code for PostProcessBuild to add the AssociationDomains capability and verify my data on AASA verifying team id, bundle id but it didn't work.
I have to mention that we activate Associated Domains in Apple Developer on our Identifier but also it didn't work.
This is the first time experiencing that using Firebase.
NOTE: I built check on xcode and everything is there, Firebase plugin, GoogleService-Info.plist and Associated Domains are there but still not working.
Another bug is on iOS 16 each Dynamic Link we created doesn't have metadata but I tested same build with iOS 15.7 and it works perfectly.
NOTE: We already published our app on AppStore without Dynamic Links but we tried our test on TestFlight and it didn't work just send us to download the app to the store but it didn't open the app
Steps to reproduce:
Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? What's the issue repro rate? (eg 100%, 1/5 etc)
Repro rate 5/5
What happened? How can we make the problem occur? This could be a description, log/console output, etc.
1.- Build app with all steps to setup project 2.- Install app on TestFlight 3.- Share a Deep Link 4.- Click on Deep Link 5.- Observe
If you have a downloadable sample project that reproduces the bug you're reporting, you will likely receive a faster response on your issue.
Relevant Code:
private static void AddCapabilities(BuildTarget buildTarget, string pathToBuiltProject)
{
string projectPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
PBXProject project = new PBXProject();
project.ReadFromString(File.ReadAllText(projectPath));
string targetGUID = project.GetUnityMainTargetGuid();
var capabilityManager = new ProjectCapabilityManager(projectPath, "Entitlements.entitlements", null, targetGUID);
capabilityManager.AddAssociatedDomains(new[] { "applinks:domicile.page.link" });
capabilityManager.WriteToFile();
}

Hi @SrTartarus,
Thanks for reporting this. Could you share any stack traces that you have encountered as well as the actual behavior you're facing? If possible, you may provide a minimal, reproducible example of your project that could be used as a baseline for troubleshooting.
Hi @paulinon,
Thanks for you response.
About our bugs that we already have on the project I can tell you that I compiled my project directly on Xcode so, the first bug it's about general iOS and I can confirm when you install an app on TestFlight and if you touch a Deep Link it goes to AppStore and not to the app so I tested on my physical devices with iOS 14.5 and iOS 16.0.3 and they work perfectly installed directly from Xcode and both go to the app also I tested it on iOS simulators and work so they go to the app.
The second bug is more about iOS 16 because I putted all files that we need like Configuration file, we added the Associated Domain that Firebase provided us and I can tell you that iOS 13, iOS 14 and iOS 15 work very well but I tested same build, same project with iOS 16.
so, I'll attach iOS 14.5 stack trace where is working and iOS 16.0.3 where it is not working the metadata information and their videos as well when I've got those stack traces.
iOS 14.5 (Working) iOS_14.5_stack_trace.txt
https://user-images.githubusercontent.com/39415987/197644953-6045c4ab-4b01-47a9-af41-c954e8a5b914.mp4
iOS 16.0.3 iOS_16.0.3_stack_trace.txt
https://user-images.githubusercontent.com/39415987/197643918-a22220f8-e8ef-4dfb-a262-f321803ad8d4.mp4
These are the MVCE to reproduce them.
public class DynamicLinksManager : SingletonBehaviour<DynamicLinksManager>
{
private void Start()
{
DynamicLinks.DynamicLinkReceived += OnDynamicLinkReceived;
}
private void OnDynamicLinkReceived(object _sender, ReceivedDynamicLinkEventArgs _args)
{
DomicileLogger.Instance.Log($"Received dynamic link {_args.ReceivedDynamicLink.Url.OriginalString}", true);
}
protected override void OnDestroy()
{
DynamicLinks.DynamicLinkReceived -= OnDynamicLinkReceived;
}
public void CreateDynamicLinks(string imageUrl, Action<bool, string> callback)
{
StartCoroutine(CreateDynamicLinksCoroutine(imageUrl, callback));
}
private IEnumerator CreateDynamicLinksCoroutine(string imageUrl, Action<bool, string> callback)
{
var components = new DynamicLinkComponents(new Uri("http://www.domicile.com/"), "https://domicile.page.link")
{
IOSParameters = new IOSParameters("com.domicile.domicile")
{
AppStoreId = "1559966423",
},
AndroidParameters = new AndroidParameters("com.domicile.domicile"),
SocialMetaTagParameters = new SocialMetaTagParameters
{
Title = "Domicile: Game of Homes",
ImageUrl = new Uri(imageUrl)
}
};
var options = new DynamicLinkOptions
{
PathLength = DynamicLinkPathLength.Unguessable
};
yield return DynamicLinks.GetShortLinkAsync(components, options).ContinueWith(task => {
if (task.IsCanceled)
{
DomicileLogger.Instance.Log("[DynamicLinksManager.CreateDynamicLinks] GetShortLinkAsync was canceled.");
callback?.Invoke(false, null);
return;
}
if (task.IsFaulted)
{
DomicileLogger.Instance.Log($"[DynamicLinksManager.CreateDynamicLinks] Error {task.Exception}");
callback?.Invoke(false, null);
return;
}
// Short Link has been created.
ShortDynamicLink link = task.Result;
callback?.Invoke(true, link.Url.OriginalString);
var warnings = new List<string>(link.Warnings);
if (warnings.Count > 0)
{
foreach (var linkWarning in link.Warnings)
{
DomicileLogger.Instance.Log($"[DynamicLinksManager.CreateDynamicLinks] Warning {linkWarning}");
}
}
});
}
}
and this one it's when we add the Assiociated Domain that Firebase provided me
public class BuildTools : MonoBehaviour
{
#if UNITY_IOS
[PostProcessBuild]
public static void OnPostProcessBuild(BuildTarget buildTarget, string pathToBuiltProject)
{
if (buildTarget == BuildTarget.iOS)
{
AddCapabilities(buildTarget, pathToBuiltProject);
}
}
// This function is used on iOS PostProcessBuild to add AssociatedDomains Entitlement
private static void AddCapabilities(BuildTarget buildTarget, string pathToBuiltProject)
{
string projectPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
PBXProject project = new PBXProject();
project.ReadFromString(File.ReadAllText(projectPath));
string targetGUID = project.GetUnityMainTargetGuid();
var capabilityManager = new ProjectCapabilityManager(projectPath, "Entitlements.entitlements", null, targetGUID);
capabilityManager.AddAssociatedDomains(new[] { "applinks:domicile.page.link" });
capabilityManager.WriteToFile();
}
#endif
}
NOTE: Second bug it's about metadata we putted on SocialMetaTagParameters an image and a title so when we tried to share the short link that we created at runtime, it loads on iOS 13, 14.5 and 15.7, but on iOS 16 it doesn't load, so iMessage doesn't load its metadata information for that previously created Deep Link (You can see on videos attached on this response)
Hi @SrTartarus,
I reached out to the Dynamic Links team because this seems like its an issue in the Firebase Dynamic Links library for iOS. After failing to reproduce this locally we decided that we need more information from you, including some of your account information.
This GitHub issue isn't appropriate for gathering that data since this thread is public. Could you please open a Firebase Support Ticket and reference to this thread within it?
Specifically we're looking for a FDL so a support engineer could reproduce the issue and look into the debug page and FDL setup. It would be helpful to have a TestFlight link, too, if possible.
I'm going to keep this ticket open because we'd love to hear what ends up being the problem. Hopefully other people can troubleshoot similar issues in the future.
Thanks so much!
Hi @DellaBitta we already created a ticket from Firebase Support.
We hope they can help us because support team assigned us an engineer that is looking those bugs. Support team know about this Github issue so they mentioned this issue in the email chain we opened.
Thanks!
Hi @SrTartarus,
Checking in to see how things have gone with Firebase Support. Thanks!
Hey @SrTartarus. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@SrTartarus if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.