firebase / quickstart-unity

Firebase Quickstart Samples for Unity
https://firebase.google.com/games
Apache License 2.0
822 stars 425 forks source link

Deeplink not working. application:continueUserActivity:restorationHandler missing #86

Closed moori closed 7 years ago

moori commented 7 years ago

Hello I'm trying follow the setup guides and implemented the deep link functionality on my Unity project. Android version is working fine, but on iOS I´m unable to retrieve the deeplink in my Unity code. The app opens when I click on my link, either closed or running in background, and I can see the full url in Xcode console, but my OnInviteReceived inside Unity never runs. I get a "DEBUG: Found application:continueUserActivity:restoreHandler" followed by "Implementation of application:continueUserActivity:restorationHandler: not found. Please add the handler into your App Delegate. Class: UnityAppController"

I don´t know if its related, but I´m also unable to log any event on Analytics on iOS.

Am I missing something?

stewartmiles commented 7 years ago

We have root caused this issue and have fixed internally, we'll have a release with the fix soon.

Cheers, Stewart

stewartmiles commented 7 years ago

We just published a fix for this https://firebase.google.com/support/release-notes/unity#4.0.0 please reopen if you continue to run into issues.

Cheers, Stewart

moori commented 7 years ago

Thank you,

I´m now correctly receiving the deeplink when the app is already open. Unfortunately, I´m still unable to retrieve it when I run the app by clicking in the custom url.

stewartmiles commented 7 years ago

To confirm, you're using the 4.0.0 SDK? The issue we fixed was primarily in the Firebase iOS SDK 4.0.2 which the 4.0.0 SDK depends upon.

You should also verify you've setup the URL handlers in your Xcode project:

e.g

moori commented 7 years ago

I´ve downloaded the firebase_unity_sdk_4.0.0.zip file from the site. I'm trusting this package to manage any iOS SDK.

I've setup the associated domains acordingly and assumed that if the deeplink was retrieved while the app was oppened and the app opens if I click on the link all Xcode configurations were all right.

stewartmiles commented 7 years ago

I just want to make sure I understand the test you're running:

Is this what you're doing?

moori commented 7 years ago

That´s right.

And if I click the same link in the browser with the app running in background, I get the InviteReceived event inside Unity correctly (since sdk 4.0.0).

stewartmiles commented 7 years ago

Could you share the following to see whether we can reproduce your issue:

Cheers, Stewart

stewartmiles commented 7 years ago

Ok we've reproduced it with Unity 5.6.01f3, Xcode 8.3.2, iOS SDK 10.3.

What is odd is that the code path for opening a link when the app isn't installed e.g

Is working correctly and I'm pretty sure it's exactly the same flow as clicking on a link. We'll take a look.

stewartmiles commented 7 years ago

I've tracked down the issue. When clicking on a link iOS calls the App Delegate method application:continueUserActivity:restorationHandler: which we hook and forward to the dynamic links / invites component. The issue we discovered is that when this is called the dynamic links / invites library isn't initialized which means the link disappears into the void. The regression happened during a refactor of the dynamic links and invites library to use a shared component.

Testing an internal patch now, there is no workaround as far as I can tell since you can't safely configure our dynamic links / invites C++ library without breaking the C# integration.

stewartmiles commented 7 years ago

We pushed a 4.0.1 bug fix release that should resolve this issue. https://firebase.google.com/support/release-notes/unity#4.0.1

Cheers, Stewart

moori commented 7 years ago

Thank you. I'll try right away!

Roma6 commented 7 years ago

Hi, i am in the same team as @moori. First of all, thank you @stewartmiles for the help and fast responses.

Unfortunately this release did not solve the issue. And we tried to start to use the "DynamicLinks.DynamicLinkReceived" event handler (instead of "FirebaseInvites.InviteReceived"), but this caused a xcode build error (screenshot below).

Are we doing something wrong?

a

a-maurice commented 7 years ago

Hi, I work on the same team as Stewart :)

So, that happens what the underlying static library is not being included. In your Unity project, under "Assets/Plugins/iOS/Firebase", there should be a "libDynamicLinks.a".

If it isn't there, import the DynamicLinks.unityBundle and make sure that it is included during the import process. If it is there, make sure that in the Inspector, "iOS" is selected under Include Platforms.

Hopefully that solves your issue, but if it doesn't please let us know.

-Anthony

On Mon, Jun 19, 2017 at 2:24 PM, Gabriel Romano notifications@github.com wrote:

Hi, i am in the same team as @moori https://github.com/moori. First of all, thank you @stewartmiles https://github.com/stewartmiles for the help and fast responses.

Unfortunately this release did not solve the issue. And we tried to start to use the "DynamicLinks.DynamicLinkReceived" event handler (instead of "FirebaseInvites.InviteReceived"), but this caused a xcode build error (screenshot below).

Are we doing something wrong?

[image: a] https://user-images.githubusercontent.com/6913921/27306341-9d7b9480-551b-11e7-9e93-6dfb3a80e2ed.jpg

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/firebase/quickstart-unity/issues/86#issuecomment-309578122, or mute the thread https://github.com/notifications/unsubscribe-auth/AKLyPfARMGJQvU97ce0eCXF7RU-R1Exuks5sFuckgaJpZM4NqnKD .

Roma6 commented 7 years ago

Ok, what you said is right! "libDynamicLinks.a" was missing. (TortoiseSVN ignores "*.a" by default)

I corrected that and build went successful, but it is still not receiving the DeepLink when clicking on a link (at saffari) with the app closed. Clicking on the same link with app opened (and minimized) I receive the DeepLink via "DynamicLinks.DynamicLinkReceived" AND "FirebaseInvites.InviteReceived" (and that's ok).

I started to think that I am not registering soon enough to the events, but I am doing this as soon as possible (on the first line of a Start of a MonoBehaviour in the first scene).

Just for the record, this is my Associated Domains: a

a-maurice commented 7 years ago

Everything you described should be working, there isn't really a "soon enough" to be concerned about, it should be holding onto any deep links until a callback is registered on the event.

I've confirmed that case seems to be failing on our testapp as well. We're looking into a fix, and will keep you updated. Thanks for notifying us of this issue.

jonsimantov commented 7 years ago

Firebase Unity SDK version 4.0.2 has been released, which should resolve this issue: https://firebase.google.com/support/release-notes/unity#4.0.2

Jon

moori commented 7 years ago

Hello,

I´m getting the version 3.0.1 following this link: https://firebase.google.com/docs/unity/setup

Is there another way to download 4.0.2?

stewartmiles commented 7 years ago

That's odd I'm seeing https://firebase.google.com/download/unity point to https://dl.google.com/firebase/sdk/unity/firebase_unity_sdk_4.0.2.zip - as expected . Any chance you could share the region your downloading from or the language you have the site set to?

Cheers, Stewart

On Mon, Jul 10, 2017 at 11:33 AM, moori notifications@github.com wrote:

Hello,

I´m getting the version 3.0.1 following this link: https://firebase.google.com/docs/unity/setup

Is there another way to download 4.0.2?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firebase/quickstart-unity/issues/86#issuecomment-314195292, or mute the thread https://github.com/notifications/unsubscribe-auth/AFw1RBYer19OwASQdAPtjUgV6CmxpUbrks5sMm6MgaJpZM4NqnKD .

moori commented 7 years ago

You´re right. I´ve changed to English and got the 4.0.2.

The "Português Brasileiro" site is pointing to 3.0.1.

Thanks.

moori commented 7 years ago

We´ve just tested the 4.0.2 sdk and the problem persists. The deeplink is not retrieved if it's opened when the app is installed and not running. We´ll keep trying to figure out if we configured something wrong, but it doesn´t seems like.

Thanks

Roma6 commented 6 years ago

The problem persists, and we're still waiting for a fix. Shouldn't this issue be open?

Thanks.

stewartmiles commented 6 years ago

AFAIK we fixed this in 4.0.2. Do you have a project - based upon our quickstart sample - that reproduces this issue? There are many steps to follow to make sure a link is retrieved when the app starts up, if you don't follow the setup instructions the link will not be retrieved.

Roma6 commented 6 years ago

We are trying to use this firebase feature for some months. We tried so many things and this is not working. Anyway, tomorrow we will prepare a repro of our project to send to you.

Roma6 commented 6 years ago

The quickstart exemple is really working normally. But we are doing the same thing to our project and its not working. We will check if there is a incompatibility with another plugin.

Roma6 commented 6 years ago

Our problema was a incompatibility with another plugin that implements UnityAppController. Removing it resolved the issue. Everything is working normally now. Thank you very much for all the help and fixes.