@@ -8,7 +8,7 @@ namespace com.adjust.sdk
88#if UNITY_ANDROID
99 public class AdjustAndroid
1010 {
11- private const string sdkPrefix = "unity4.36 .0" ;
11+ private const string sdkPrefix = "unity4.37 .0" ;
1212 private static bool launchDeferredDeeplink = true ;
1313 private static AndroidJavaClass ajcAdjust = new AndroidJavaClass ( "com.adjust.sdk.Adjust" ) ;
1414 private static AndroidJavaObject ajoCurrentActivity = new AndroidJavaClass ( "com.unity3d.player.UnityPlayer" ) . GetStatic < AndroidJavaObject > ( "currentActivity" ) ;
@@ -19,6 +19,7 @@ public class AdjustAndroid
1919 private static SessionTrackingFailedListener onSessionTrackingFailedListener ;
2020 private static SessionTrackingSucceededListener onSessionTrackingSucceededListener ;
2121 private static VerificationInfoListener onVerificationInfoListener ;
22+ private static DeeplinkResolutionListener onDeeplinkResolvedListener ;
2223
2324 public static void Start ( AdjustConfig adjustConfig )
2425 {
@@ -684,6 +685,14 @@ public static void VerifyPlayStorePurchase(AdjustPlayStorePurchase purchase, Act
684685 ajcAdjust . CallStatic ( "verifyPurchase" , ajoPurchase , onVerificationInfoListener ) ;
685686 }
686687
688+ public static void ProcessDeeplink ( string url , Action < string > resolvedLinkCallback )
689+ {
690+ onDeeplinkResolvedListener = new DeeplinkResolutionListener ( resolvedLinkCallback ) ;
691+ AndroidJavaClass ajcUri = new AndroidJavaClass ( "android.net.Uri" ) ;
692+ AndroidJavaObject ajoUri = ajcUri . CallStatic < AndroidJavaObject > ( "parse" , url ) ;
693+ ajcAdjust . CallStatic ( "processDeeplink" , ajoUri , ajoCurrentActivity , onDeeplinkResolvedListener ) ;
694+ }
695+
687696 // Used for testing only.
688697 public static void SetTestOptions ( Dictionary < string , string > testOptions )
689698 {
@@ -1024,6 +1033,24 @@ public void onVerificationFinished(AndroidJavaObject verificationInfo)
10241033 }
10251034 }
10261035
1036+ private class DeeplinkResolutionListener : AndroidJavaProxy
1037+ {
1038+ private Action < string > callback ;
1039+
1040+ public DeeplinkResolutionListener ( Action < string > pCallback ) : base ( "com.adjust.sdk.OnDeeplinkResolvedListener" )
1041+ {
1042+ this . callback = pCallback ;
1043+ }
1044+
1045+ public void onDeeplinkResolved ( string resolvedLink )
1046+ {
1047+ if ( callback != null )
1048+ {
1049+ callback ( resolvedLink ) ;
1050+ }
1051+ }
1052+ }
1053+
10271054 // Private & helper methods.
10281055 private static bool IsAppSecretSet ( AdjustConfig adjustConfig )
10291056 {
0 commit comments