- Home /
The problem has been resolved.
Facebook Deep Link in Unity3D equal to null
Question - why is Facebook Deep Link in Unity3D always null? My colleagues who work in Android Studio have never faced such problems. I think it's just that the Facebook SDK for Unity is made of sticks and crutches, because I haven't been able to achieve absolutely anything with it for two weeks now. This is a complete failure.
Unity Editor Version:
2019.3.0f5
Unity Facebook SDK Version:
7.21.2
The order of my actions:
1) I copied data from Unity to my Facebook app Screen #1
2) I added the scheme in Facebook settings and regenerate the AndroidManifest Screen #2
3) I added this to AndroidManifest because I saw that the unit's Unity help for Deep Links also had it Screen #3
4) In my app's Facebook settings, I also enabled Deep Linking Screen #4
5) My code:
void Awake() { if (FB.IsInitialized) FB.ActivateApp(); else { FB.Init(() => { FB.ActivateApp(); }); } } public void Click() { FB.Mobile.FetchDeferredAppLinkData(DeepLinkCallback); } void DeepLinkCallback(IAppLinkResult result) { if (!string.IsNullOrEmpty(result.Url)) { _floats.DeepLink = result.Url; // Deep Link = null (????????????) Debug.Log("Deep Link: " + _floats.DeepLink); } SceneManager.LoadScene(2); } void Update() { DontDestroyOnLoad(this); }
6) I tested Deep Link with Facebook Deep Link Tester. Deep Link looked something like this:
SS://testDeep
7) Facebook recorded the following a Deep Link, albeit not without some imaginary mistakes Screen #5 Screen #6
8) BUT as a result, the DeepLink variable was still empty. There was nothing there. Null. But in the editor, the variable was not empty: Screen #7
9) Removing scheme from AndroidManifest and Facebook settings didn't help me either. Also, I tried enabling "Native or desktop app?" in the Facebook app settings, but it was also useless