You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Android only, once an app is opened after receiving data from a Branch.io link, the callback fires again when the native dialog is opened and closed.
When I manually put the app in the background and come back to the app, this problem does not occur.
I tried the same problem in a minimal configuration as shown in the video, so I suspect it is a BranchSDK bug.
BranchNativeDialogBug.mp4
My code.
usingSystem;usingSystem.Collections.Specialized;usingSystem.Text.RegularExpressions;usingSystem.Web;usingNewtonsoft.Json.Linq;usingTMPro;usingUnityEngine;usingUnityEngine.UI;publicclassReceiveDemo:MonoBehaviour{[SerializeField]privateTMP_Text_text;[SerializeField]privateButton_clearButton;[SerializeField]privateButton_cameraButton;[SerializeField]privateButton_locationButton;privatevoidStart(){if(Application.isEditor){varuri=newUri("https://hoge.test-app.link/?$desktop_url=https://hoge/?scene=5d755773-74f5-44d6-825b-e08cf218dcbc");Parse(uri);return;}Branch.initSession(CallbackWithBranchUniversalObject);_clearButton.onClick.AddListener(()=>_text.text="");_cameraButton.onClick.AddListener(()=>UnityEngine.Android.Permission.RequestUserPermission(UnityEngine.Android.Permission.Camera));_locationButton.onClick.AddListener(()=>UnityEngine.Android.Permission.RequestUserPermission(UnityEngine.Android.Permission.FineLocation));}privatevoidCallbackWithBranchUniversalObject(BranchUniversalObjectbuo,BranchLinkPropertieslinkProps,stringerror){if(error!=null){Debug.LogError("Error on CallbackWithBranchUniversalObject: "+error);}if(buo==null)return;Parse(newUri(GetLink(buo.ToJsonString())));}privatestaticstringGetLink(stringjsonString){varjsonObject=JObject.Parse(jsonString);varmetadata=(string)jsonObject["metadata"];if(metadata==null)returnnull;varmetadataObject=JObject.Parse(metadata);varreferringLink=(string)metadataObject["~referring_link"];if(referringLink==null)returnnull;varmatch=Regex.Match(referringLink,@"https:\/\/[a-zA-Z0-9.-]*app\.link\/?.*");referringLink=match.Success?match.Value:referringLink;varampersandIndex=referringLink.IndexOf("&",StringComparison.Ordinal);if(ampersandIndex!=-1){referringLink=referringLink.Substring(0,ampersandIndex);}Debug.Log("Referring Link: "+referringLink);returnreferringLink;}privatevoidParse(Uriuri){Debug.Log($"Try to parse : {uri}");varqueryStrings=newNameValueCollection();if(Regex.IsMatch(uri.DnsSafeHost,"app\\.link")){Debug.Log("URL is included app.link");queryStrings=HttpUtility.ParseQueryString(newUri(HttpUtility.ParseQueryString(uri.Query).Get("$desktop_url")).Query);}else{Debug.Log("URL is not included app.link");queryStrings=HttpUtility.ParseQueryString(uri.Query);}varquery="";for(inti=0;i<queryStrings.Count;++i){Debug.Log(queryStrings.GetKey(i)+": "+queryStrings.Get(i));if(!string.IsNullOrEmpty(queryStrings.GetKey(i))){query+=$"Query{i}: {queryStrings.GetKey(i)}={queryStrings.Get(i)}";}}_text.text=query;}}
Testing Instructions
Please build and run the sample project scene on Android with all settings completed, including my code.
Steps to reproduce
Build and run your sample project scene on Android with all settings completed, including my code.
Expected behavior
Once an app is opened after receiving data from a Branch.io link, the callback does not fire again when the native dialog is opened and closed.
SDK Version
2.0.0
Unity Version
2022.3.24f1
Make and Model
GalaxyS22 / Xperia 5 II
OS
Android12 / 13
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Summary
On Android only, once an app is opened after receiving data from a Branch.io link, the callback fires again when the native dialog is opened and closed.
When I manually put the app in the background and come back to the app, this problem does not occur.
I tried the same problem in a minimal configuration as shown in the video, so I suspect it is a BranchSDK bug.
BranchNativeDialogBug.mp4
My code.
Testing Instructions
Please build and run the sample project scene on Android with all settings completed, including my code.
Steps to reproduce
Expected behavior
Once an app is opened after receiving data from a Branch.io link, the callback does not fire again when the native dialog is opened and closed.
SDK Version
2.0.0
Unity Version
2022.3.24f1
Make and Model
GalaxyS22 / Xperia 5 II
OS
Android12 / 13
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: