Search Unity

Retreiving URL when macOS app is opened from an URL scheme

Discussion in 'macOS' started by Coeur_EF, Aug 21, 2019.

  1. Coeur_EF

    Coeur_EF

    Joined:
    Aug 13, 2019
    Posts:
    1
    We made a bundle for macOS that registers for a scheme.

    To get the url of the scheme sent to the app (this is also called deep-linking), the following registration in Objective-C works when the app is already opened but not when the app was closed and is opened by the scheme.
    Code (csharp):
    1. +(void)load
    2. {
    3.     _instance = [MySchemeHandler new];
    4.     NSAppleEventManager *manager = [NSAppleEventManager sharedAppleEventManager];
    5.     [manager setEventHandler:_instance
    6.                  andSelector:@selector(handleGetURLEvent:withReplyEvent:)
    7.                forEventClass:kInternetEventClass
    8.                   andEventID:kAEGetURL];
    9. }
    We were told to see http://eppz.eu/blog/override-app-delegate-unity-ios-osx-1/ but it seems to go to extreme edges by swizzling reverse-engineered methods from Unity.

    Are there recommended ways to achieve classic deep-linking on a Unity macOS app? (aka, retreiving the URL that was used to open the app)
     
    JoeStrout likes this.
  2. mrocco_unity

    mrocco_unity

    Joined:
    May 5, 2020
    Posts:
    1
    Bump!

    Were you able to find a solution?
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Not right now, but this feature is in our backlog.
     
  6. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    can you offer any workaround until this will be added to Unity 2030? :)
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    I am unfortunately not familiar with how deep linking works on macOS.
     
  8. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    idbrii and JoeStrout like this.