@@ -12,6 +12,7 @@ public class Adjust : MonoBehaviour
12
12
13
13
private static IAdjust instance = null ;
14
14
15
+ private static Action < string > deferredDeeplinkDelegate = null ;
15
16
private static Action < AdjustEventSuccess > eventSuccessDelegate = null ;
16
17
private static Action < AdjustEventFailure > eventFailureDelegate = null ;
17
18
private static Action < AdjustSessionSuccess > sessionSuccessDelegate = null ;
@@ -21,6 +22,8 @@ public class Adjust : MonoBehaviour
21
22
public bool startManually = true ;
22
23
public bool eventBuffering = false ;
23
24
public bool printAttribution = true ;
25
+ public bool sendInBackground = false ;
26
+ public bool launchDeferredDeeplink = true ;
24
27
25
28
public string appToken = "{Your App Token}" ;
26
29
@@ -33,23 +36,27 @@ void Awake ()
33
36
{
34
37
if ( Adjust . instance != null )
35
38
{
36
- return ;
37
- }
39
+ return ;
40
+ }
38
41
39
42
DontDestroyOnLoad ( transform . gameObject ) ;
40
43
41
44
if ( ! this . startManually )
42
45
{
43
46
AdjustConfig adjustConfig = new AdjustConfig ( this . appToken , this . environment ) ;
47
+
44
48
adjustConfig . setLogLevel ( this . logLevel ) ;
45
- adjustConfig . setEventBufferingEnabled ( eventBuffering ) ;
49
+ adjustConfig . setSendInBackground ( this . sendInBackground ) ;
50
+ adjustConfig . setEventBufferingEnabled ( this . eventBuffering ) ;
51
+ adjustConfig . setLaunchDeferredDeeplink ( this . launchDeferredDeeplink ) ;
46
52
47
53
if ( printAttribution )
48
54
{
49
55
adjustConfig . setEventSuccessDelegate ( EventSuccessCallback ) ;
50
56
adjustConfig . setEventFailureDelegate ( EventFailureCallback ) ;
51
57
adjustConfig . setSessionSuccessDelegate ( SessionSuccessCallback ) ;
52
58
adjustConfig . setSessionFailureDelegate ( SessionFailureCallback ) ;
59
+ adjustConfig . setDeferredDeeplinkDelegate ( DeferredDeeplinkCallback ) ;
53
60
adjustConfig . setAttributionChangedDelegate ( AttributionChangedCallback ) ;
54
61
}
55
62
@@ -114,6 +121,7 @@ public static void start (AdjustConfig adjustConfig)
114
121
Adjust . eventFailureDelegate = adjustConfig . getEventFailureDelegate ( ) ;
115
122
Adjust . sessionSuccessDelegate = adjustConfig . getSessionSuccessDelegate ( ) ;
116
123
Adjust . sessionFailureDelegate = adjustConfig . getSessionFailureDelegate ( ) ;
124
+ Adjust . deferredDeeplinkDelegate = adjustConfig . getDeferredDeeplinkDelegate ( ) ;
117
125
Adjust . attributionChangedDelegate = adjustConfig . getAttributionChangedDelegate ( ) ;
118
126
119
127
Adjust . instance . start ( adjustConfig ) ;
@@ -307,11 +315,26 @@ public void GetNativeSessionFailure (string sessionFailureData)
307
315
Adjust . sessionFailureDelegate ( sessionFailure ) ;
308
316
}
309
317
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
+ }
310
334
#endregion
311
335
312
336
#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.
315
338
private void AttributionChangedCallback ( AdjustAttribution attributionData )
316
339
{
317
340
Debug . Log ( "Attribution changed!" ) ;
@@ -352,7 +375,7 @@ private void AttributionChangedCallback (AdjustAttribution attributionData)
352
375
}
353
376
}
354
377
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.
356
379
private void EventSuccessCallback ( AdjustEventSuccess eventSuccessData )
357
380
{
358
381
Debug . Log ( "Event tracked successfully!" ) ;
@@ -383,7 +406,7 @@ private void EventSuccessCallback (AdjustEventSuccess eventSuccessData)
383
406
}
384
407
}
385
408
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.
387
410
private void EventFailureCallback ( AdjustEventFailure eventFailureData )
388
411
{
389
412
Debug . Log ( "Event tracking failed!" ) ;
@@ -416,7 +439,7 @@ private void EventFailureCallback (AdjustEventFailure eventFailureData)
416
439
}
417
440
}
418
441
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.
420
443
private void SessionSuccessCallback ( AdjustSessionSuccess sessionSuccessData )
421
444
{
422
445
Debug . Log ( "Session tracked successfully!" ) ;
@@ -442,7 +465,7 @@ private void SessionSuccessCallback (AdjustSessionSuccess sessionSuccessData)
442
465
}
443
466
}
444
467
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.
446
469
private void SessionFailureCallback ( AdjustSessionFailure sessionFailureData )
447
470
{
448
471
Debug . Log ( "Session tracking failed!" ) ;
@@ -469,6 +492,21 @@ private void SessionFailureCallback (AdjustSessionFailure sessionFailureData)
469
492
Debug . Log ( "JsonResponse: " + sessionFailureData . GetJsonResponse ( ) ) ;
470
493
}
471
494
}
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
+ }
472
510
#endregion
473
511
}
474
512
}
0 commit comments