@@ -12,6 +12,7 @@ public class Adjust : MonoBehaviour
1212
1313 private static IAdjust instance = null ;
1414
15+ private static Action < string > deferredDeeplinkDelegate = null ;
1516 private static Action < AdjustEventSuccess > eventSuccessDelegate = null ;
1617 private static Action < AdjustEventFailure > eventFailureDelegate = null ;
1718 private static Action < AdjustSessionSuccess > sessionSuccessDelegate = null ;
@@ -21,6 +22,8 @@ public class Adjust : MonoBehaviour
2122 public bool startManually = true ;
2223 public bool eventBuffering = false ;
2324 public bool printAttribution = true ;
25+ public bool sendInBackground = false ;
26+ public bool launchDeferredDeeplink = true ;
2427
2528 public string appToken = "{Your App Token}" ;
2629
@@ -33,23 +36,27 @@ void Awake ()
3336 {
3437 if ( Adjust . instance != null )
3538 {
36- return ;
37- }
39+ return ;
40+ }
3841
3942 DontDestroyOnLoad ( transform . gameObject ) ;
4043
4144 if ( ! this . startManually )
4245 {
4346 AdjustConfig adjustConfig = new AdjustConfig ( this . appToken , this . environment ) ;
47+
4448 adjustConfig . setLogLevel ( this . logLevel ) ;
45- adjustConfig . setEventBufferingEnabled ( eventBuffering ) ;
49+ adjustConfig . setSendInBackground ( this . sendInBackground ) ;
50+ adjustConfig . setEventBufferingEnabled ( this . eventBuffering ) ;
51+ adjustConfig . setLaunchDeferredDeeplink ( this . launchDeferredDeeplink ) ;
4652
4753 if ( printAttribution )
4854 {
4955 adjustConfig . setEventSuccessDelegate ( EventSuccessCallback ) ;
5056 adjustConfig . setEventFailureDelegate ( EventFailureCallback ) ;
5157 adjustConfig . setSessionSuccessDelegate ( SessionSuccessCallback ) ;
5258 adjustConfig . setSessionFailureDelegate ( SessionFailureCallback ) ;
59+ adjustConfig . setDeferredDeeplinkDelegate ( DeferredDeeplinkCallback ) ;
5360 adjustConfig . setAttributionChangedDelegate ( AttributionChangedCallback ) ;
5461 }
5562
@@ -114,6 +121,7 @@ public static void start (AdjustConfig adjustConfig)
114121 Adjust . eventFailureDelegate = adjustConfig . getEventFailureDelegate ( ) ;
115122 Adjust . sessionSuccessDelegate = adjustConfig . getSessionSuccessDelegate ( ) ;
116123 Adjust . sessionFailureDelegate = adjustConfig . getSessionFailureDelegate ( ) ;
124+ Adjust . deferredDeeplinkDelegate = adjustConfig . getDeferredDeeplinkDelegate ( ) ;
117125 Adjust . attributionChangedDelegate = adjustConfig . getAttributionChangedDelegate ( ) ;
118126
119127 Adjust . instance . start ( adjustConfig ) ;
@@ -307,11 +315,26 @@ public void GetNativeSessionFailure (string sessionFailureData)
307315 Adjust . sessionFailureDelegate ( sessionFailure ) ;
308316 }
309317
318+ public void GetNativeDeferredDeeplink ( string deeplinkURL )
319+ {
320+ if ( instance == null )
321+ {
322+ Debug . Log ( Adjust . errorMessage ) ;
323+ return ;
324+ }
325+
326+ if ( Adjust . deferredDeeplinkDelegate == null )
327+ {
328+ Debug . Log ( "adjust: Deferred deeplink delegate was not set." ) ;
329+ return ;
330+ }
331+
332+ Adjust . deferredDeeplinkDelegate ( deeplinkURL ) ;
333+ }
310334 #endregion
311335
312336 #region Private & helper methods
313-
314- // Our delegate for detecting attribution changes if choosen not to start manually.
337+ // Our delegate for detecting attribution changes if chosen not to start manually.
315338 private void AttributionChangedCallback ( AdjustAttribution attributionData )
316339 {
317340 Debug . Log ( "Attribution changed!" ) ;
@@ -352,7 +375,7 @@ private void AttributionChangedCallback (AdjustAttribution attributionData)
352375 }
353376 }
354377
355- // Our delegate for detecting successful event tracking if choosen not to start manually.
378+ // Our delegate for detecting successful event tracking if chosen not to start manually.
356379 private void EventSuccessCallback ( AdjustEventSuccess eventSuccessData )
357380 {
358381 Debug . Log ( "Event tracked successfully!" ) ;
@@ -383,7 +406,7 @@ private void EventSuccessCallback (AdjustEventSuccess eventSuccessData)
383406 }
384407 }
385408
386- // Our delegate for detecting failed event tracking if choosen not to start manually.
409+ // Our delegate for detecting failed event tracking if chosen not to start manually.
387410 private void EventFailureCallback ( AdjustEventFailure eventFailureData )
388411 {
389412 Debug . Log ( "Event tracking failed!" ) ;
@@ -416,7 +439,7 @@ private void EventFailureCallback (AdjustEventFailure eventFailureData)
416439 }
417440 }
418441
419- // Our delegate for detecting successful session tracking if choosen not to start manually.
442+ // Our delegate for detecting successful session tracking if chosen not to start manually.
420443 private void SessionSuccessCallback ( AdjustSessionSuccess sessionSuccessData )
421444 {
422445 Debug . Log ( "Session tracked successfully!" ) ;
@@ -442,7 +465,7 @@ private void SessionSuccessCallback (AdjustSessionSuccess sessionSuccessData)
442465 }
443466 }
444467
445- // Our delegate for detecting failed session tracking if choosen not to start manually.
468+ // Our delegate for detecting failed session tracking if chosen not to start manually.
446469 private void SessionFailureCallback ( AdjustSessionFailure sessionFailureData )
447470 {
448471 Debug . Log ( "Session tracking failed!" ) ;
@@ -469,6 +492,21 @@ private void SessionFailureCallback (AdjustSessionFailure sessionFailureData)
469492 Debug . Log ( "JsonResponse: " + sessionFailureData . GetJsonResponse ( ) ) ;
470493 }
471494 }
495+
496+ // Our delegate for getting deferred deep link content if chosen not to start manually.
497+ private void DeferredDeeplinkCallback ( string deeplinkURL )
498+ {
499+ Debug . Log ( "Deferred deeplink reported!" ) ;
500+
501+ if ( deeplinkURL != null )
502+ {
503+ Debug . Log ( "Deeplink URL: " + deeplinkURL ) ;
504+ }
505+ else
506+ {
507+ Debug . Log ( "Deeplink URL is null!" ) ;
508+ }
509+ }
472510 #endregion
473511 }
474512}
0 commit comments