Unity 上的 Firebase 动态链接 iOS 表示 "Deep Link does not contain valid required params"
Firebase Dynamic Links on Unity iOS says "Deep Link does not contain valid required params"
我正在使用 Firebase Dynamic Links for Unity,并且它与 Android 配合得很好。我什至有一个桌面解决方案,后备 link 将用户带到一个网页,我可以在该网页上向用户提供有关如何在桌面上获取他们的 link 内容的说明。
在 iOS 上,但是,我在尝试动态 links:
时总是遇到这样的错误
[Firebase/Analytics][I-ACS023001] Deep Link does not contain valid required params. URL params: {
"_cpb" = 1;
"_cpt" = cpit;
"_fpb" = "CIAIEIAGGgVlbi11cw==";
"_iipp" = 1;
"_iumchkactval" = 1;
"_iumenbl" = 1;
"_osl" = "https://cgs.link/zu_tiles_hime?_iipp=1";
"_plt" = 260;
"_uit" = 1064;
apn = "com.finoldigital.cardgamesim";
cid = 8062347334713659136;
ibi = "com.finoldigital.CardGameSim";
isi = 1392877362;
link = "https://www.cardgamesimulator.com/link%%3Furl%%3Dhttps://www.cardgamesimulator.com/games/zu_tiles_hime/zu_tiles_hime.json";
sd = "Play Zu Tile: Hime on CGS!";
si = "https://www.cardgamesimulator.com/games/zu_tiles_hime/Banner.png";
st = "Card Game Simulator - Zu Tiles: Hime";
}
我在看到可能是因为?
,=
,&
符号在link,所以我url-编码了那些,但我仍然遇到同样的错误。
作为参考,我的 iOS 代码实际上是:
private void Start()
{
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
{
var dependencyStatus = task.Result;
if (dependencyStatus != DependencyStatus.Available)
{
Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
return;
}
DynamicLinks.DynamicLinkReceived += OnDynamicLinkReceived;
});
}
我立即登录 OnDynamicLinkReceived
,所以这个回调显然从未发生过。有谁知道我做错了什么,或者我可以做些什么来获得动态 link 收到的回调?
对于遇到相同问题的任何人:
我通过修改我的构建脚本以将 FirebaseDynamicLinksCustomDomains
和 FirebaseAppDelegateProxyEnabled
的值添加到 Info.plist 作为我构建过程的一部分来解决这个问题。
后处理代码:
var pbxProjectPath = PBXProject.GetPBXProjectPath(buildPath);
var pbxProject = new PBXProject(); pbxProject.ReadFromFile(pbxProjectPath);
const string targetName = "Unity-iPhone"; var targetGuid = pbxProject.GetUnityMainTargetGuid();
var src = AssetDatabase.GetAssetPath(file);
var fileName = Path.GetFileName(src);
var dst = buildPath + "/" + targetName + "/" + fileName;
if (!File.Exists(dst)) FileUtil.CopyFileOrDirectory(src, dst); pbxProject.AddFile(targetName + "/" + fileName, fileName);
pbxProject.AddBuildProperty(targetGuid, "CODE_SIGN_ENTITLEMENTS", targetName + "/" + fileName);
pbxProject.WriteToFile(pbxProjectPath);
var plistPath = buildPath + "/Info.plist";
var plistDocument = new PlistDocument(); plistDocument.ReadFromString(File.ReadAllText(plistPath));
var rootDict = plistDocument.root;
rootDict.SetBoolean("FirebaseAppDelegateProxyEnabled", false);
PlistElementArray customDomains = rootDict.CreateArray("FirebaseDynamicLinksCustomDomains");
customDomains.AddString("https://cgs.link");
File.WriteAllText(plistPath);
我正在使用 Firebase Dynamic Links for Unity,并且它与 Android 配合得很好。我什至有一个桌面解决方案,后备 link 将用户带到一个网页,我可以在该网页上向用户提供有关如何在桌面上获取他们的 link 内容的说明。
在 iOS 上,但是,我在尝试动态 links:
时总是遇到这样的错误[Firebase/Analytics][I-ACS023001] Deep Link does not contain valid required params. URL params: {
"_cpb" = 1;
"_cpt" = cpit;
"_fpb" = "CIAIEIAGGgVlbi11cw==";
"_iipp" = 1;
"_iumchkactval" = 1;
"_iumenbl" = 1;
"_osl" = "https://cgs.link/zu_tiles_hime?_iipp=1";
"_plt" = 260;
"_uit" = 1064;
apn = "com.finoldigital.cardgamesim";
cid = 8062347334713659136;
ibi = "com.finoldigital.CardGameSim";
isi = 1392877362;
link = "https://www.cardgamesimulator.com/link%%3Furl%%3Dhttps://www.cardgamesimulator.com/games/zu_tiles_hime/zu_tiles_hime.json";
sd = "Play Zu Tile: Hime on CGS!";
si = "https://www.cardgamesimulator.com/games/zu_tiles_hime/Banner.png";
st = "Card Game Simulator - Zu Tiles: Hime";
}
我在?
,=
,&
符号在link,所以我url-编码了那些,但我仍然遇到同样的错误。
作为参考,我的 iOS 代码实际上是:
private void Start()
{
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
{
var dependencyStatus = task.Result;
if (dependencyStatus != DependencyStatus.Available)
{
Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
return;
}
DynamicLinks.DynamicLinkReceived += OnDynamicLinkReceived;
});
}
我立即登录 OnDynamicLinkReceived
,所以这个回调显然从未发生过。有谁知道我做错了什么,或者我可以做些什么来获得动态 link 收到的回调?
对于遇到相同问题的任何人:
我通过修改我的构建脚本以将 FirebaseDynamicLinksCustomDomains
和 FirebaseAppDelegateProxyEnabled
的值添加到 Info.plist 作为我构建过程的一部分来解决这个问题。
后处理代码:
var pbxProjectPath = PBXProject.GetPBXProjectPath(buildPath);
var pbxProject = new PBXProject(); pbxProject.ReadFromFile(pbxProjectPath);
const string targetName = "Unity-iPhone"; var targetGuid = pbxProject.GetUnityMainTargetGuid();
var src = AssetDatabase.GetAssetPath(file);
var fileName = Path.GetFileName(src);
var dst = buildPath + "/" + targetName + "/" + fileName;
if (!File.Exists(dst)) FileUtil.CopyFileOrDirectory(src, dst); pbxProject.AddFile(targetName + "/" + fileName, fileName);
pbxProject.AddBuildProperty(targetGuid, "CODE_SIGN_ENTITLEMENTS", targetName + "/" + fileName);
pbxProject.WriteToFile(pbxProjectPath);
var plistPath = buildPath + "/Info.plist";
var plistDocument = new PlistDocument(); plistDocument.ReadFromString(File.ReadAllText(plistPath));
var rootDict = plistDocument.root;
rootDict.SetBoolean("FirebaseAppDelegateProxyEnabled", false);
PlistElementArray customDomains = rootDict.CreateArray("FirebaseDynamicLinksCustomDomains");
customDomains.AddString("https://cgs.link");
File.WriteAllText(plistPath);