Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Unity Reflect - Android Login Callback

Discussion in 'Unity Reflect' started by deets_inthepocket, Oct 21, 2020.

  1. deets_inthepocket

    deets_inthepocket

    Joined:
    Apr 26, 2019
    Posts:
    5
    Hi,

    I'm building an application that shows BIM data from revit in AR on top of a real building to show possible issue's happening with the buildings infrastructure.
    To create this we've stripped some of the reflect code that was bound to UI to add it to our custom UI. So far so good.

    Everything is working on iOS! Yay!
    But on Android we have an issue with logging in. When we press the login button it does go to the unity webpage and we are able to login and it returns us back to the app. But in the app it doesn't receive that it has been logged in and we are kinda stuck and not receiving the cloud projects.

    After debugging quite a while I've found that the code never ends up in the "onDeepLink" method and related methods.
    I believe that it is because of code in the extended unity player activity not being called. Perhaps I have to add an Android Manifest file that refers back to the ReflectUnityPlayerActivity. I've tried that but didn't get it to work. Perhaps I didn't include everything in that manifest file.

    So I'm kind of stuck and not really sure how to continue debugging.


    Can anyone help me out? Or does anyone have a suggestion what is going wrong?
     
  2. unity_WeHJyHh-zs3pog

    unity_WeHJyHh-zs3pog

    Unity Technologies

    Joined:
    Sep 3, 2019
    Posts:
    4
    Hello!
    The com.unity.reflect package contains all that is needed to build Android apps that will handle the redirection from the browser. Getting back from the browser into the app suggest that the manifest correctly registered it on the device to handle our custom url scheme. So it must be the native code handling the token that is not finding the gameobject on your scene that contains the "onDeeplink" method. There are a few requirements here that you can double-check:
    - the gameobject must be named "Managers"
    - It needs to have the "loginResolver" script attach to it (it is this one that contains the "onDeeplink" method).
     
    deets_inthepocket likes this.
  3. deets_inthepocket

    deets_inthepocket

    Joined:
    Apr 26, 2019
    Posts:
    5
    Thanks unity_WeHJyHh-zs3pog,

    This finally fixed the issue for me! I had no idea the gameobject had to be named "Managers" :/
    After changing that it worked instantly!

    What a fast reply! Thanks again!
     
    unity_WeHJyHh-zs3pog likes this.