This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.d.ts
1661 lines (1480 loc) · 62.8 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
declare module 'react-native-flurry-sdk' {
/**
* A React Native plugin for Flurry SDK.
* The Flurry agent allows you to track the usage and behavior of your application
* on users' devices for viewing in the Flurry Analytics system.
* Set of methods that allow developers to capture detailed, aggregate information
* regarding the use of their app by end users.
*/
export class Flurry {
/**
* Constants for setting log level in Flurry Analytics.
*/
static LogLevel: {
VERBOSE: number,
DEBUG: number,
INFO: number,
WARN: number,
ERROR: number,
ASSERT: number
}
/**
* Constants for setting gender in Flurry Analytics.
*/
static Gender: {
MALE: string,
FEMALE: string
}
/**
* Constants for logging post install events using Flurry's FlurrySKAdNetwork class.
*/
static SKAdNetworkEvent: {
NO_EVENT: number,
REGISTRATION: number,
LOGIN: number,
SUBSCRIPTION: number,
IN_APP_PURCHASE: number
}
/**
* Constants for status in Flurry Config.
*/
static ConfigStatus: {
SUCCESS: string,
UNCHANGED: string,
ERROR: string,
ACTIVATED: string
}
/**
* Constants for message types in Flurry Push.
*/
static MessageType: {
RECEIVED: string,
CLICKED: string,
CANCELLED: string,
REFRESH: string
}
/**
* Set the timeout for expiring a Flurry session.
*
* @param sessionMillis The time in milliseconds to set the session timeout to. Minimum value of 5000.
*/
static setContinueSessionMillis(sessionMillis?: number): void;
/**
* True to enable or false to disable the ability to catch all uncaught exceptions
* and have them reported back to Flurry.
*
* @param crashReporting true to enable, false to disable.
*/
static setCrashReporting(crashReporting?: boolean): void;
/**
* True if this session should be added to total sessions/DAUs when applicationstate is inactive or background.
*
* @param includeBackgroundSessionsInMetrics if background and inactive session should be counted toward dau
*/
static setIncludeBackgroundSessionsInMetrics(includeBackgroundSessionsInMetrics?: boolean): void;
/**
* True to enable or false to disable the internal logging for the Flurry SDK.
*
* @param enableLog true to enable logging, false to disable it.
*/
static setLogEnabled(enableLog?: boolean): void;
/**
* Set the log level of the internal Flurry SDK logging.
*
* @param logLevel The level to set it to { VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT }.
*/
static setLogLevel(logLevel?: number): void;
/**
* True to enable or false to disable SSL Pinning for Flurry Analytics connection. Defaults to false.
*
* Turn on to add SSL Pinning protection for the Flurry Analytics connections. Disable it
* if your app is using proxy or any services that are not compliant with SSL Pinning.
*
* @param sslPinningEnabled true to enable SSL Pinning for Flurry Analytics connection, false to disable it.
*/
static setSslPinningEnabled(sslPinningEnabled?: boolean): void;
/**
* Sets the age of the user at the time of this session.
*
* ```javascript
* e.g., Flurry.setAge(36);
* ```
*
* @param age valid values are 0-110
*/
static setAge(age: number): void;
/**
* Sets the gender of the user.
*
* ```javascript
* e.g., Flurry.setGender(Flurry.Gender.FEMALE);
* ```
*
* @param gender type of Flurry.Gender
*/
static setGender(gender: string): void;
/**
* Set whether Flurry should record location via GPS.
*
* ```javascript
* e.g., Flurry.setReportLocation('reportLocation');
* ```
*
* @param reportLocation True to allow Flurry to record location via GPS, false otherwise
*/
static setReportLocation(reportLocation: boolean): void;
/**
* This method allows you to specify session origin and deep link for each session.
*
* ```javascript
* e.g., Flurry.setSessionOrigin('originName', 'deepLink');
* ```
*
* @param originName Name of the origin.
* @param deepLink Url of the deep Link.
*/
static setSessionOrigin(originName: string, deepLink: string): void;
/**
* Sets the Flurry userId for this session.
*
* ```javascript
* e.g., Flurry.setUserId(userId);
* ```
*
* @param userId Unique user id for session.
*/
static setUserId(userId: string): void;
/**
* Set the version name of the app.
*
* ```javascript
* e.g., Flurry.setVersionName('versionName');
* ```
*
* @param versionName The version of the app.
*/
static setVersionName(versionName?: string): void;
/**
* Sets the iOS In-App Purchase reporting enabled.
*
* ```javascript
* e.g., Flurry.setIAPReportingEnabled(true);
* ```
*
* @param enableIAP True to enable iOS In-App Purchase reporting, false otherwise
*/
static setIAPReportingEnabled(enableIAP?: boolean): void;
/**
* Set Flurry Consent for the IAB Global Privacy Platform (GPP). To pass an IAB string to Flurry,
*
* ```javascript
* e.g., Flurry.setGppConsent('GPP string', [1, 2]);
* ```
*
* @param gppString IAB GPP String.
* @param gppSectionIds Integer set of IAB GPP section ids that are applicable for this bid request.
*/
static setGppConsent(gppString: string, gppSectionIds: number[]): void;
/**
* This api allows you to set opt-out/opt-in for data sale
*
* ```javascript
* e.g., Flurry.setDataSaleOptOut(true);
* ```
*
* @param isOptOut true to opt-out data sale, false to opt-in
*/
static setDataSaleOptOut(isOptOut?: boolean): void;
/**
* This api allows you to delete data collected by Flurry
*
* ```javascript
* e.g., Flurry.deleteData();
* ```
*/
static deleteData(): void;
/**
* This api opens privacy dashboard in Chrome CustomTab
* (if its dependency's been included in the gradle and device support it as well)
* otherwise will open it in the external browser.
*
* ```javascript
* e.g., Flurry.openPrivacyDashboard();
* ```
*/
static openPrivacyDashboard(): void;
/**
* Add origin attribution.
*
* There are two overloads,
* ```javascript
* e.g., Flurry.addOrigin('name', 'version');
* Flurry.addOrigin('name', 'version'), {param: 'true'});
* ```
* - addOrigin(originName, originVersion)
* - addOrigin(originName, originVersion, originParameters)
*
* @param originName The name/id of the origin you wish to attribute.
* @param originVersion The version of the origin you wish to attribute.
*/
static addOrigin(originName: string, originVersion: string, originParameters?: { [key: string]: string; }): void;
static addOrigin(originName: string, originVersion: string, originParameters?: Map<string, string> ): void;
/**
* This method allows you to associate parameters with an session.
*
* ```javascript
* e.g., Flurry.addSessionProperty('name', 'value');
* ```
*
* @param name Property name.
* @param value Property value.
*/
static addSessionProperty(name: string, value: string): void;
/**
* Get the version of the Flurry SDK.
*
* There are two overloads,
* e.g., 3 ways to call
*
* ```javascript
* Flurry.getVersions(
* (msg) => {
* console.error(msg);
* },
* (agentVersion, releaseVersion, sessionId) => {
* console.log('Versions: ' + agentVersion + ' : ' + releaseVersion + ' : ' + sessionId);
* }
* );
* ```
*
* OR
*
* ```javascript
* (async () => {
* var versions = await Flurry.getVersions();
* console.log('Versions: ' + versions.agentVersion + ' : ' + versions.releaseVersion + ' : ' + versions.sessionId);
* })();
* ```
*
* OR
*
* ```javascript
* Flurry.getVersions().then(
* (versions) => {
* console.log('Versions: ' + versions.agentVersion + ' : ' + versions.releaseVersion + ' : ' + versions.sessionId);
* },
* (msg) => {
* console.error(msg);
* }
* );
* ```
*
* @param errorCallback error callback.
* @param successCallback success callback.
* @return the Promise object if called without callbacks specified.
*/
static getVersions(errorCallback?: (errorMessage: string) => void,
successCallback?: (agentVersion: number, releaseVersion: string, sessionId: string) => void):
Promise<{ agentVersion: number; releaseVersion: string; sessionId: string; }>;
/**
* Get the Publisher Segmentation data.
*
* e.g., 2 ways to call
*
* ```javascript
* (async () => {
* var segmentations = await Flurry.getPublisherSegmentation();
* console.log('Publisher Segmentation: ' + segmentations.segments);
* })()
* ```
*
* OR
*
* ```javascript
* Flurry.getPublisherSegmentation().then(
* (segmentations) => {
* console.log('Publisher Segmentation: ' + segmentations.segments);
* },
* (msg) => {
* console.error(msg);
* }
* );
* ```
*
* @param refresh false to get cached data if available, otherwise fetch and wait.
* @return the Promise object.
*/
static getPublisherSegmentation(refresh?: boolean):
Promise<{ [key: string]: string; }>;
/**
* Fetch the Publisher Segmentation.
*
* ```javascript
* e.g., Flurry.fetchPublisherSegmentation();
* ```
*/
static fetchPublisherSegmentation(): void;
/**
* Logs the breadcrumb.
*
* ```javascript
* e.g., Flurry.logBreadcrumb('crashBreadcrumb');
* ```
*
* @param crashBreadcrumb crash breadcrumb
*/
static logBreadcrumb(crashBreadcrumb: string): void;
/**
* Log an event.
*
* There are three overloads,
* ```javascript
* e.g., Flurry.logEvent('eventId');
* Flurry.logEvent('eventId', true);
* Flurry.logEvent('eventId', 'timedId');
* ```
* - logEvent(eventId)
* - logEvent(eventId, timed)
* - logEvent(eventId, timedId)
*
* @param eventId The name/id of the event.
* @param timed True if this event is timed, false otherwise.
* @param timedId The 2nd key for timed event.
*/
static logEvent(eventId: string, timed?: boolean, timedId?: string): void;
/**
* Log an event with parameters.
*
* There are three overloads,
* ```javascript
* e.g., Flurry.logEvent('eventId', {param: 'true'});
* Flurry.logEvent('eventId', {param: 'true'}, true);
* Flurry.logEvent('eventId', {param: 'true'}, 'timedId');
* ```
* Example for timed event logging with the 2nd key:
* ```javascript
* // 0 1 2 3 4 5 6 sec.
* // ID1 ID2 ID3
* // - - - ID2: 3 sec.
* // - - ID3: 2 sec.
* // - - - - - - ID1: 6 sec.
*
* Flurry.logEvent('TimedEventName', 'InstanceId1');
* // sleep 1 sec.
* Flurry.logEvent('TimedEventName', 'InstanceId2');
* // sleep 2 sec.
* Flurry.logEvent('TimedEventName', 'InstanceId3');
*
* // sleep 1 sec.
* Flurry.endTimedEvent('TimedEventName', 'InstanceId2'); // ID2 duration: 3 sec.
* // sleep 1 sec.
* Flurry.endTimedEvent('TimedEventName', 'InstanceId3'); // ID3 duration: 2 sec.
* // sleep 1 sec.
* Flurry.endTimedEvent('TimedEventName', 'InstanceId1'); // ID1 duration: 6 sec.
* ```
* - logEvent(eventId, parameters)
* - logEvent(eventId, parameters, timed)
* - logEvent(eventId, parameters, timedId)
*
* @param eventId The name/id of the event.
* @param parameters A {@code Map<String, String>} of parameters to log with this event.
* @param timed True if this event is timed, false otherwise.
* @param timedId The 2nd key for timed event.
*/
static logEvent(eventId: string, parameters: { [key: string]: string; }, timed?: boolean, timedId?: string): void;
static logEvent(eventId: string, parameters: Map<string, string>, timed?: boolean, timedId?: string): void;
/**
* Log a standard event with parameters.
*
* e.g.,
* ```javascript
* var params = new Map([
* [Flurry.EventParam.TOTAL_AMOUNT, 34.99],
* [Flurry.EventParam.SUCCESS, true],
* [Flurry.EventParam.ITEM_NAME, 'book 1'],
* ['note', 'This is an awesome book to purchase !!!']
* ]);
* Flurry.logStandardEvent(Flurry.Event.PURCHASED, params);
* ```
*
* @param eventId The id {@code Flurry.Event} of the event.
* @param parameters A {@code Map<string|Flurry.EventParam, string|number|boolean>} of parameters to log with this event.
*/
static logStandardEvent(eventId: number, parameters?: { [key: string]: string|number|boolean; }): void;
static logStandardEvent(eventId: number, parameters?: Map<string, string|number|boolean> ): void;
/**
* End a timed event.
*
* There are four overloads,
* ```javascript
* e.g., Flurry.endTimedEvent('eventId');
* Flurry.endTimedEvent('eventId', 'timedId');
* Flurry.endTimedEvent('eventId', {param: 'true'});
* Flurry.endTimedEvent('eventId', {param: 'true'}, 'timedId');
* ```
* - endTimedEvent(eventId)
* - endTimedEvent(eventId, timedId)
* - endTimedEvent(eventId, parameters)
* - endTimedEvent(eventId, parameters, timedId)
*
* @param eventId The name/id of the event.
* @param parameters A {@code Map<String, String>} of parameters to log with this event.
* @param timedId The 2nd key for timed event.
*/
static endTimedEvent(eventId: string, parameters?: { [key: string]: string; }): void;
static endTimedEvent(eventId: string, parameters?: Map<string, string> ): void;
/**
* Log a payment.
*
* ```javascript
* e.g., Flurry.logPayment('productName', 'productId', 6, 36, 'currency', 'transactionId', {param: 'true'});
* ```
*
* @param productName The name of the product purchased.
* @param productId The id of the product purchased.
* @param quantity The number of products purchased.
* @param price The price of the the products purchased in the given currency.
* @param currency The currency for the price argument.
* @param transactionId A unique identifier for the transaction used to make the purchase.
* @param parameters A {@code Map<String, String>} of the parameters which should be submitted
* with this event.
*/
static logPayment(productName: string, productId: string, quantity: number, price: number,
currency: string, transactionId: string, parameters: { [key: string]: string; }): void;
static logPayment(productName: string, productId: string, quantity: number, price: number,
currency: string, transactionId: string, parameters: Map<string, string> ): void;
/**
* Report errors that your app catches.
*
* There are two overloads,
* ```javascript
* e.g., Flurry.onError('errorId', 'message', 'errorClass');
* Flurry.onError('errorId', 'message', 'errorClass', {param: 'true'});
* ```
* - onError(errorId, message, errorClass)
* - onError(errorId, message, errorClass, errorParams)
*
* @param errorId Unique ID for reported error.
* @param message Message for the error reported.
* @param errorClass Class in which the error is reported.
* @param errorParams A {@code Map<String, String>} of parameters to log with this report.
*/
static onError(errorId: string, message: string, errorClass: string, errorParams?: { [key: string]: string; }): void;
static onError(errorId: string, message: string, errorClass: string, errorParams?: Map<string, string> ): void;
/**
* Log a page view.
*
* ```javascript
* e.g., Flurry.onPageView();
* ```
* @deprecated API removed, no longer supported by Flurry.
*/
static onPageView(): void;
/**
* Sets the iOS conversion value sent to Apple through SKAdNetwork.
*
* ```javascript
* e.g., Flurry.updateConversionValue(conversionValue);
* ```
*
* @param conversionValue An integer value between 0-63. The conversion values meaning is determined by the developer.
*/
static updateConversionValue(conversionValue: number): void;
/**
* Allows Flurry to set the SKAdNetwork conversion value for you.
* The final conversion value is a decimal number between 0-63.
* The conversion value is calculated from a 6 bit binary number.
* The first two bits represent days of user retention from 0-3 days
* The last four bits represent a true false state indicating if the user has completed the post install event.
*
* ```javascript
* e.g., Flurry.updateConversionValueWithEvent(flurryEvent);
* ```
*
* @param flurryEvent Valid events are { NO_EVENT, REGISTRATION, LOGIN, SUBSCRIPTION, IN_APP_PURCHASE }.
*/
static updateConversionValueWithEvent(flurryEvent: number): void;
/**
* Constants and Methods for User Properties.
*
* ```javascript
* e.g., Flurry.UserProperties.set (Flurry.UserProperties.PROPERTY_REGISTERED_USER, 'True');
* Flurry.UserProperties.add (Flurry.UserProperties.PROPERTY_REGISTERED_USER, 'True');
* Flurry.UserProperties.remove(Flurry.UserProperties.PROPERTY_REGISTERED_USER, 'True');
* Flurry.UserProperties.flag (Flurry.UserProperties.PROPERTY_PURCHASER);
* ```
*/
static UserProperties: {
PROPERTY_CURRENCY_PREFERENCE: string,
PROPERTY_PURCHASER: string,
PROPERTY_REGISTERED_USER: string,
PROPERTY_SUBSCRIBER: string,
/**
* Exactly set, or replace if any previously exists, any state for the property.
* null clears the property state.
*
* ```javascript
* e.g., Flurry.UserProperties.set(Flurry.UserProperties.PROPERTY_REGISTERED_USER, 'True');
* ```
* @param propertyName property name
* @param propertyValue single property value
*/
set(propertyName: string, propertyValue: string): void,
/**
* Exactly set, or replace if any previously exists, any state for the property.
* Empty list or null clears the property state.
*
* ```javascript
* e.g., Flurry.UserProperties.set(Flurry.UserProperties.PROPERTY_CURRENCY_PREFERENCE, ['USD', 'EUR']);
* ```
* @param propertyName property name
* @param propertyValues list of property values
*/
set(propertyName: string, propertyValue: string[]): void,
/**
* Extend any property, even no previous property.
* Adding values already included in the state has no effect and does not error.
*
* ```javascript
* e.g., Flurry.UserProperties.add(Flurry.UserProperties.PROPERTY_REGISTERED_USER, 'True');
* ```
* @param propertyName property name
* @param propertyValue single property value
*/
add(propertyName: string, propertyValue: string): void,
/**
* Extend any property, even no previous property.
* Adding values already included in the state has no effect and does not error.
*
* ```javascript
* e.g., Flurry.UserProperties.add(Flurry.UserProperties.PROPERTY_CURRENCY_PREFERENCE, ['USD', 'EUR']);
* ```
* @param propertyName property name
* @param propertyValues list of property values
*/
add(propertyName: string, propertyValue: string[]): void,
/**
* Reduce any property.
* Removing values not already included in the state has no effect and does not error
* Called with only the property name argument will clear the property to be empty.
*
* ```javascript
* e.g., Flurry.UserProperties.remove(Flurry.UserProperties.PROPERTY_REGISTERED_USER, 'True');
* Flurry.UserProperties.remove(Flurry.UserProperties.PROPERTY_CURRENCY_PREFERENCE);
* ```
* @param propertyName roperty name
* @param propertyValue single property value
*/
remove(propertyName: string, propertyValue?: string): void,
/**
* Reduce any property.
* Removing values not already included in the state has no effect and does not error
*
* ```javascript
* e.g., Flurry.UserProperties.remove(Flurry.UserProperties.PROPERTY_CURRENCY_PREFERENCE, ['USD', 'EUR']);
* ```
* @param propertyName property name
* @param propertyValues list of property values
*/
remove(propertyName: string, propertyValue: string[]): void,
/**
* Exactly set, or replace if any previously exists, any state for the property to a single true state.
* Implies that value is boolean and should only be flagged and cleared.
*
* ```javascript
* e.g., Flurry.UserProperties.flag(Flurry.UserProperties.PROPERTY_PURCHASER);
* ```
* @param propertyName property name
*/
flag(propertyName: string): void
}
/**
* Constants and Methods for Performance Metrics.
*/
static Performance: {
NONE: 0,
COLD_START: 1,
SCREEN_TIME: 2,
ALL: 1 | 2,
/**
* Report to the Flurry Cold Start metrics that your app is now fully drawn.
* This is only used to help measuring application launch times, so that the
* app can report when it is fully in a usable state similar to
* {@link android.app.Activity#reportFullyDrawn}.
*/
reportFullyDrawn(): void,
/**
* Provide a Resource logger that users can start before profiled codes start,
* then log event after finished. Flurry will compute the time.
*
* e.g.,
* ```javascript
* Flurry.Performance.startResourceLogger;
* {
* // profiled codes ...
* }
* Flurry.Performance.logResourceLogger;
* ```
*/
startResourceLogger(): void,
/**
* Log Flurry Resources Consuming events.
*
* e.g.,
* ```javascript
* Flurry.Performance.startResourceLogger;
* {
* // profiled codes ...
* }
* Flurry.Performance.logResourceLogger;
* ```
* @param id The group ID
*/
logResourceLogger(id: string): void
}
/**
* Register a listener for the state of fetching. Multiple listeners can be passed in and each
* one will be called in the order they are registered.
*
* ```
* Event.Type: ConfigStatus.SUCCESS: Config data is successfully loaded from server.
* ConfigStatus.UNCHANGED: Fetch completes but no changes from server.
* ConfigStatus.ERROR: Config data is failed to load from server.
* Flurry Config will retry if failed in 10 sec., 30 sec., 3 min., then abandon.
* Event.isRetrying: true if it is still retrying fetching
* ConfigStatus.ACTIVATED: Config data is activated.
* Flurry Config can receive activate notification when cached data is read,
* and when newly fetched data is been activated.
* Event.isCache: true if activated from the cached data
* ```
*
* e.g.,
* ```javascript
* Flurry.addConfigListener((event) => {
* if (event.Type === Flurry.ConfigStatus.SUCCESS) {
* // Data fetched, activate it.
* Flurry.activateConfig();
* } else if (event.Type === Flurry.ConfigStatus.ACTIVATED) {
* // Received cached data, or newly activated data.
* Flurry.getConfigString('welcome_message', 'Welcome!').then((value) => {
* console.log((event.isCache ? 'Received cached data: ' : 'Received newly activated data: ') + value.welcome_message);
* });
* } else if (event.Type === Flurry.ConfigStatus.UNCHANGED) {
* // Fetch finished, but data unchanged.
* Flurry.getConfigString('welcome_message', 'Welcome!').then((value) => {
* console.log('Received unchanged data: ' + value.welcome_message);
* });
* } else if (event.Type === Flurry.ConfigStatus.ERROR) {
* // Fetch failed.
* console.log('Fetch error! Retrying: ' + event.isRetrying);
* }
* });
*
* Flurry.fetchConfig();
* ```
*
* @param callback Callback listener to be registered.
*/
static addConfigListener(
callback: (event: { Type: string; isCache?: boolean; isRetrying?: boolean; }) => void): void;
/**
* Unregister a callback listener
*
* @param callback Callback listener to be removed.
*/
static removeConfigListener(
callback: (event: { Type: string; isCache?: boolean; isRetrying?: boolean; }) => void): void;
/**
* Fetch Config will trigger an async call to the server. Server has a throttle where when
* the user calls fetchConfig many times in a row, it will basically do a no-op.
* If we do go out to server, once we return we should store this value onto disk,
* to be picked up during initialization the next time around.
*/
static fetchConfig(): void;
/**
* Activate Config attempts to apply the most recent config.
*/
static activateConfig(): void;
/**
* Retrieves a String value, or a Map of String values from the configuration.
*
* e.g.,
* ```javascript
* Flurry.getConfigString('welcome_message', 'Welcome!').then((value) => {
* console.log('Received data: ' + value.welcome_message);
* });
* ```
*
* @param key The name of the configuration to retrieve.
* @param defaultValue Value to return if this configuration does not exist.
* @returns The configuration value if it exists, or defaultValue.
*/
static getConfigString(key: string, defaultValue: string):
Promise<{ [key: string]: string; }>;
/**
* Retrieves a Map of String values from the configuration.
*
* e.g.,
* ```javascript
* let keysAndDefaults = {
* welcome_message: 'Welcome!',
* welcome_font_size: '12',
* welcome_font_color: '#990066'
* };
*
* Flurry.getConfigString(keysAndDefaults).then((value) => {
* console.log('Received map of data: ' +
* value.welcome_message + ':' + value.welcome_font_size + ':' + value.welcome_font_color);
* });
* ```
*
* @param keysAndDefaults A Map of names and the default values.
* @returns Map of configuration values if exist, or default values.
*/
static getConfigString(keysAndDefaults: { [key: string]: string; }):
Promise<{ [key: string]: string; }>;
/**
* Add a listener to receive messaging events, and handle the notification.
* ```
* Message.Type: RECEIVED: a notification has been received.
* CLICKED: a notification has been clicked.
* CANCELLED: a notification has been cancelled. (Android only)
* REFRESH: push notification token has been changed. (Android only)
* Message.Title: message title
* Message.Body: message body
* Message.Data: message data (Map)
* Message.ClickAction: click action (Android only)
* Message.Token: refreshed token
* ```
*
* Please call required Flurry.willHandleMessage(boolean) when received event types of
* MessageType.RECEIVED or MessageType.CLICKED as soon as possible to avoid delay.
* (Android only) If you would like to handle the notification yourself, return true to notify Flurry
* you've handled it, and Flurry will not show the notification (MessageType.RECEIVED),
* or Flurry will not launch the app or 'click_action' activity (MessageType.CLICKED).
*
* e.g.,
* ```javascript
* Flurry.addMessagingListener((message) => {
* if (message.Type === Flurry.MessageType.RECEIVED) {
* Flurry.willHandleMessage(false);
* } else if (message.Type === Flurry.MessageType.CLICKED) {
* Flurry.willHandleMessage(false);
* }
*
* Flurry.printMessage(message);
* });
* ```
*
* @param callback messaging event callback.
*/
static addMessagingListener(callback: (message: { Type: string;
Title?: string; Body?: string; Data?: { [key: string]: string; }; ClickAction?: string;
Token?: string; }) => void): void;
/**
* Remove a messaging events listener.
*
* @param callback messaging event callback.
*/
static removeMessagingListener(callback: (message: { Type: string;
Title?: string; Body?: string; Data?: { [key: string]: string; }; ClickAction?: string;
Token?: string; }) => void): void;
/**
* If you would like to handle the notification yourself, return true to notify Flurry
* you've handled it, and Flurry will not show the notification (MessageType.RECEIVED),
* or Flurry will not launch the app or 'click_action' activity (MessageType.CLICKED).
*
* Required: Even it is supported by Android only, it is required to notify Flurry
* when received event types of MessageType.RECEIVED or MessageType.CLICKED.
*
* ```javascript
* e.g., Flurry.willHandleMessage(true);
* ```
*
* @param handled True if you've handled the notification.
* False if you haven't and want Flurry to handle it.
*/
static willHandleMessage(handled: boolean): void;
/**
* A helper function to print the message.
*
* @param message the message received.
*/
static printMessage(message: { Type: string;
Title?: string; Body?: string; Data?: { [key: string]: string; }; ClickAction?: string;
Token?: string; }): void;
/**
* Constants for Standard Event Types.
*/
static Event: {
/**
* Log this event when a user clicks on an Ad.
* @param mandatory_parameters none
* @param recommended_parameters Param.AD_TYPE
*/
AD_CLICK: number,
/**
* Log this event when a user views an Ad impression.
* @param mandatory_parameters none
* @param recommended_parameters Param.AD_TYPE
*/
AD_IMPRESSION: number,
/**
* Log this event when a user is granted a reward for viewing a rewarded Ad.
* @param mandatory_parameters none
* @param recommended_parameters Param.AD_TYPE
*/
AD_REWARDED: number,
/**
* Log this event when a user skips an Ad.
* @param mandatory_parameters none
* @param recommended_parameters Param.AD_TYPE
*/
AD_SKIPPED: number,
/**
* Log this event when a user spends credit in the app.
* @param mandatory_parameters Param.TOTAL_AMOUNT
* @param recommended_parameters Param.LEVEL_NUMBER, Param.IS_CURRENCY_SOFT, Param.CREDIT_TYPE, Param.CREDIT_ID, Param.CREDIT_NAME, Param.CURRENCY_TYPE
*/
CREDITS_SPENT: number,
/**
* Log this event when a user purchases credit in the app.
* @param mandatory_parameters Param.TOTAL_AMOUNT
* @param recommended_parameters Param.LEVEL_NUMBER, Param.IS_CURRENCY_SOFT, Param.CREDIT_TYPE, Param.CREDIT_ID, Param.CREDIT_NAME, Param.CURRENCY_TYPE
*/
CREDITS_PURCHASED: number,
/**
* Log this event when a user earns credit in the app.
* @param mandatory_parameters Param.TOTAL_AMOUNT
* @param recommended_parameters Param.LEVEL_NUMBER, Param.IS_CURRENCY_SOFT, Param.CREDIT_TYPE, Param.CREDIT_ID, Param.CREDIT_NAME, Param.CURRENCY_TYPE
*/
CREDITS_EARNED: number,
/**
* Log this event when a user unlocks an achievement in the app.
* @param mandatory_parameters none
* @param recommended_parameters Param.ACHIEVEMENT_ID
*/
ACHIEVEMENT_UNLOCKED: number,
/**
* Log this event when an App user completes a level.
* @param mandatory_parameters Param.LEVEL_NUMBEER
* @param recommended_parameters Param.LEVEL_NAME
*/
LEVEL_COMPLETED: number,
/**
* Log this event when an App user fails a level.
* @param mandatory_parameters Param.LEVEL_NUMBEER
* @param recommended_parameters Param.LEVEL_NAME
*/
LEVEL_FAILED: number,
/**
* Log this event when an App user levels up.
* @param mandatory_parameters Param.LEVEL_NUMBEER
* @param recommended_parameters Param.LEVEL_NAME
*/
LEVEL_UP: number,
/**
* Log this event when an App user starts a level.
* @param mandatory_parameters Param.LEVEL_NUMBEER
* @param recommended_parameters Param.LEVEL_NAME
*/
LEVEL_STARTED: number,
/**
* Log this event when an App user skips a level.
* @param mandatory_parameters Param.LEVEL_NUMBEER
* @param recommended_parameters Param.LEVEL_NAME
*/
LEVEL_SKIP: number,
/**
* Log this event when an App user posts his score.
* @param mandatory_parameters Param.SCORE
* @param recommended_parameters Param.LEVEL_NUMBEER
*/
SCORE_POSTED: number,
/**
* Log this event when a user rates a content in the App.
* @param mandatory_parameters Param.CONTENT_ID, Param.RATING
* @param recommended_parameters Param.CONTENT_TYPE, Param.CONTENT_NAME
*/
CONTENT_RATED: number,
/**
* Log this event when a specific content is viewed by a user.
* @param mandatory_parameters Param.CONTENT_ID
* @param recommended_parameters Param.CONTENT_TYPE, Param.CONTENT_NAME
*/
CONTENT_VIEWED: number,
/**
* Log this event when a user saves the content in the App.
* @param mandatory_parameters Param.CONTENT_ID
* @param recommended_parameters Param.CONTENT_TYPE, Param.CONTENT_NAME
*/
CONTENT_SAVED: number,
/**
* Log this event when a user customizes the App/product.
* @param mandatory_parameters none
* @param recommended_parameters none
*/
PRODUCT_CUSTOMIZED: number,
/**
* Log this event when the App is activated.
* @param mandatory_parameters none
* @param recommended_parameters none