-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4F.F4.G.FGE.H
2759 lines (1207 loc) · 63.2 KB
/
4F.F4.G.FGE.H
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
Skip to content
Pull requests
Issues
Marketplace
Explore
Sign out
Your account has been flagged.
Because of that, your profile is hidden from the public. If you believe this is a mistake, contact support to have your account status reviewed.
Watch
527
Star
6,010
Fork
2,423
facebook/facebook-objc-sdk
Code
Pull requests 0
Projects 0
Insights
Branch: master
Find file
Copy path
facebook-objc-sdk/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppEvents.m
9e604fe 23 days ago
codytwinton Renamed loggingBehavior to loggingBehaviors
13 contributors
Raw
Blame
History
1354 lines (1178 sloc) 60 KB
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
//
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
// copy, modify, and distribute this software in source code or binary form for use
// in connection with the web services and APIs provided by Facebook.
//
// As with any software that integrates with the Facebook platform, your use of
// this software is subject to the Facebook Developer Principles and Policies
// [http://developers.facebook.com/policy/]. This copyright notice shall be
// included in all copies or substantial portions of the software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import "FBSDKAppEvents.h"
#import "FBSDKAppEvents+Internal.h"
#import <objc/runtime.h>
#import <UIKit/UIApplication.h>
#import "FBSDKAccessToken.h"
#import "FBSDKAppEventsState.h"
#import "FBSDKAppEventsStateManager.h"
#import "FBSDKAppEventsUtility.h"
#import "FBSDKConstants.h"
#import "FBSDKDynamicFrameworkLoader.h"
#import "FBSDKError.h"
#import "FBSDKGraphRequest+Internal.h"
#import "FBSDKInternalUtility.h"
#import "FBSDKLogger.h"
#import "FBSDKPaymentObserver.h"
#import "FBSDKServerConfiguration.h"
#import "FBSDKServerConfigurationManager.h"
#import "FBSDKSettings.h"
#import "FBSDKTimeSpentData.h"
#import "FBSDKUtility.h"
#import "FBSDKUserDataStore.h"
#if !TARGET_OS_TV
#import "FBSDKEventBindingManager.h"
#import "FBSDKHybridAppEventsScriptMessageHandler.h"
#endif
//
// Public event names
//
// General purpose
NSString *const FBSDKAppEventNameCompletedRegistration = @"fb_mobile_complete_registration";
NSString *const FBSDKAppEventNameViewedContent = @"fb_mobile_content_view";
NSString *const FBSDKAppEventNameSearched = @"fb_mobile_search";
NSString *const FBSDKAppEventNameRated = @"fb_mobile_rate";
NSString *const FBSDKAppEventNameCompletedTutorial = @"fb_mobile_tutorial_completion";
NSString *const FBSDKAppEventNameContact = @"Contact";
NSString *const FBSDKAppEventNameCustomizeProduct = @"CustomizeProduct";
NSString *const FBSDKAppEventNameDonate = @"Donate";
NSString *const FBSDKAppEventNameFindLocation = @"FindLocation";
NSString *const FBSDKAppEventNameSchedule = @"Schedule";
NSString *const FBSDKAppEventNameStartTrial = @"StartTrial";
NSString *const FBSDKAppEventNameSubmitApplication = @"SubmitApplication";
NSString *const FBSDKAppEventNameSubscribe = @"Subscribe";
NSString *const FBSDKAppEventNameAdImpression = @"AdImpression";
NSString *const FBSDKAppEventNameAdClick = @"AdClick";
// Ecommerce related
NSString *const FBSDKAppEventNameAddedToCart = @"fb_mobile_add_to_cart";
NSString *const FBSDKAppEventNameAddedToWishlist = @"fb_mobile_add_to_wishlist";
NSString *const FBSDKAppEventNameInitiatedCheckout = @"fb_mobile_initiated_checkout";
NSString *const FBSDKAppEventNameAddedPaymentInfo = @"fb_mobile_add_payment_info";
NSString *const FBSDKAppEventNameProductCatalogUpdate = @"fb_mobile_catalog_update";
// Gaming related
NSString *const FBSDKAppEventNameAchievedLevel = @"fb_mobile_level_achieved";
NSString *const FBSDKAppEventNameUnlockedAchievement = @"fb_mobile_achievement_unlocked";
NSString *const FBSDKAppEventNameSpentCredits = @"fb_mobile_spent_credits";
//
// Public event parameter names
//
NSString *const FBSDKAppEventParameterNameCurrency = @"fb_currency";
NSString *const FBSDKAppEventParameterNameRegistrationMethod = @"fb_registration_method";
NSString *const FBSDKAppEventParameterNameContentType = @"fb_content_type";
NSString *const FBSDKAppEventParameterNameContent = @"fb_content";
NSString *const FBSDKAppEventParameterNameContentID = @"fb_content_id";
NSString *const FBSDKAppEventParameterNameSearchString = @"fb_search_string";
NSString *const FBSDKAppEventParameterNameSuccess = @"fb_success";
NSString *const FBSDKAppEventParameterNameMaxRatingValue = @"fb_max_rating_value";
NSString *const FBSDKAppEventParameterNamePaymentInfoAvailable = @"fb_payment_info_available";
NSString *const FBSDKAppEventParameterNameNumItems = @"fb_num_items";
NSString *const FBSDKAppEventParameterNameLevel = @"fb_level";
NSString *const FBSDKAppEventParameterNameDescription = @"fb_description";
NSString *const FBSDKAppEventParameterLaunchSource = @"fb_mobile_launch_source";
NSString *const FBSDKAppEventParameterNameAdType = @"ad_type";
NSString *const FBSDKAppEventParameterNameOrderID = @"fb_order_id";
//
// Public event parameter names for DPA Catalog
//
NSString *const FBSDKAppEventParameterProductCustomLabel0 = @"fb_product_custom_label_0";
NSString *const FBSDKAppEventParameterProductCustomLabel1 = @"fb_product_custom_label_1";
NSString *const FBSDKAppEventParameterProductCustomLabel2 = @"fb_product_custom_label_2";
NSString *const FBSDKAppEventParameterProductCustomLabel3 = @"fb_product_custom_label_3";
NSString *const FBSDKAppEventParameterProductCustomLabel4 = @"fb_product_custom_label_4";
NSString *const FBSDKAppEventParameterProductAppLinkIOSUrl = @"fb_product_applink_ios_url";
NSString *const FBSDKAppEventParameterProductAppLinkIOSAppStoreID = @"fb_product_applink_ios_app_store_id";
NSString *const FBSDKAppEventParameterProductAppLinkIOSAppName = @"fb_product_applink_ios_app_name";
NSString *const FBSDKAppEventParameterProductAppLinkIPhoneUrl = @"fb_product_applink_iphone_url";
NSString *const FBSDKAppEventParameterProductAppLinkIPhoneAppStoreID = @"fb_product_applink_iphone_app_store_id";
NSString *const FBSDKAppEventParameterProductAppLinkIPhoneAppName = @"fb_product_applink_iphone_app_name";
NSString *const FBSDKAppEventParameterProductAppLinkIPadUrl = @"fb_product_applink_ipad_url";
NSString *const FBSDKAppEventParameterProductAppLinkIPadAppStoreID = @"fb_product_applink_ipad_app_store_id";
NSString *const FBSDKAppEventParameterProductAppLinkIPadAppName = @"fb_product_applink_ipad_app_name";
NSString *const FBSDKAppEventParameterProductAppLinkAndroidUrl = @"fb_product_applink_android_url";
NSString *const FBSDKAppEventParameterProductAppLinkAndroidPackage = @"fb_product_applink_android_package";
NSString *const FBSDKAppEventParameterProductAppLinkAndroidAppName = @"fb_product_applink_android_app_name";
NSString *const FBSDKAppEventParameterProductAppLinkWindowsPhoneUrl = @"fb_product_applink_windows_phone_url";
NSString *const FBSDKAppEventParameterProductAppLinkWindowsPhoneAppID = @"fb_product_applink_windows_phone_app_id";
NSString *const FBSDKAppEventParameterProductAppLinkWindowsPhoneAppName = @"fb_product_applink_windows_phone_app_name";
//
// Public event parameter values
//
NSString *const FBSDKAppEventParameterValueNo = @"0";
NSString *const FBSDKAppEventParameterValueYes = @"1";
//
// Event names internal to this file
//
NSString *const FBSDKAppEventNamePurchased = @"fb_mobile_purchase";
NSString *const FBSDKAppEventNameLoginViewUsage = @"fb_login_view_usage";
NSString *const FBSDKAppEventNameShareSheetLaunch = @"fb_share_sheet_launch";
NSString *const FBSDKAppEventNameShareSheetDismiss = @"fb_share_sheet_dismiss";
NSString *const FBSDKAppEventNameShareTrayDidLaunch = @"fb_share_tray_did_launch";
NSString *const FBSDKAppEventNameShareTrayDidSelectActivity = @"fb_share_tray_did_select_activity";
NSString *const FBSDKAppEventNamePermissionsUILaunch = @"fb_permissions_ui_launch";
NSString *const FBSDKAppEventNamePermissionsUIDismiss = @"fb_permissions_ui_dismiss";
NSString *const FBSDKAppEventNameFBDialogsPresentShareDialog = @"fb_dialogs_present_share";
NSString *const FBSDKAppEventNameFBDialogsPresentShareDialogPhoto = @"fb_dialogs_present_share_photo";
NSString *const FBSDKAppEventNameFBDialogsPresentShareDialogOG = @"fb_dialogs_present_share_og";
NSString *const FBSDKAppEventNameFBDialogsPresentLikeDialogOG = @"fb_dialogs_present_like_og";
NSString *const FBSDKAppEventNameFBDialogsPresentMessageDialog = @"fb_dialogs_present_message";
NSString *const FBSDKAppEventNameFBDialogsPresentMessageDialogPhoto = @"fb_dialogs_present_message_photo";
NSString *const FBSDKAppEventNameFBDialogsPresentMessageDialogOG = @"fb_dialogs_present_message_og";
NSString *const FBSDKAppEventNameFBDialogsNativeLoginDialogStart = @"fb_dialogs_native_login_dialog_start";
NSString *const FBSDKAppEventsNativeLoginDialogStartTime = @"fb_native_login_dialog_start_time";
NSString *const FBSDKAppEventNameFBDialogsNativeLoginDialogEnd = @"fb_dialogs_native_login_dialog_end";
NSString *const FBSDKAppEventsNativeLoginDialogEndTime = @"fb_native_login_dialog_end_time";
NSString *const FBSDKAppEventNameFBDialogsWebLoginCompleted = @"fb_dialogs_web_login_dialog_complete";
NSString *const FBSDKAppEventsWebLoginE2E = @"fb_web_login_e2e";
NSString *const FBSDKAppEventNameFBSessionAuthStart = @"fb_mobile_login_start";
NSString *const FBSDKAppEventNameFBSessionAuthEnd = @"fb_mobile_login_complete";
NSString *const FBSDKAppEventNameFBSessionAuthMethodStart = @"fb_mobile_login_method_start";
NSString *const FBSDKAppEventNameFBSessionAuthMethodEnd = @"fb_mobile_login_method_complete";
NSString *const FBSDKAppEventNameFBSDKLikeButtonImpression = @"fb_like_button_impression";
NSString *const FBSDKAppEventNameFBSDKLoginButtonImpression = @"fb_login_button_impression";
NSString *const FBSDKAppEventNameFBSDKSendButtonImpression = @"fb_send_button_impression";
NSString *const FBSDKAppEventNameFBSDKShareButtonImpression = @"fb_share_button_impression";
NSString *const FBSDKAppEventNameFBSDKLiveStreamingButtonImpression = @"fb_live_streaming_button_impression";
NSString *const FBSDKAppEventNameFBSDKSmartLoginService = @"fb_smart_login_service";
NSString *const FBSDKAppEventNameFBSDKLikeButtonDidTap = @"fb_like_button_did_tap";
NSString *const FBSDKAppEventNameFBSDKLoginButtonDidTap = @"fb_login_button_did_tap";
NSString *const FBSDKAppEventNameFBSDKSendButtonDidTap = @"fb_send_button_did_tap";
NSString *const FBSDKAppEventNameFBSDKShareButtonDidTap = @"fb_share_button_did_tap";
NSString *const FBSDKAppEventNameFBSDKLiveStreamingButtonDidTap = @"fb_live_streaming_button_did_tap";
NSString *const FBSDKAppEventNameFBSDKLikeControlDidDisable = @"fb_like_control_did_disable";
NSString *const FBSDKAppEventNameFBSDKLikeControlDidLike = @"fb_like_control_did_like";
NSString *const FBSDKAppEventNameFBSDKLikeControlDidPresentDialog = @"fb_like_control_did_present_dialog";
NSString *const FBSDKAppEventNameFBSDKLikeControlDidTap = @"fb_like_control_did_tap";
NSString *const FBSDKAppEventNameFBSDKLikeControlDidUnlike = @"fb_like_control_did_unlike";
NSString *const FBSDKAppEventNameFBSDKLikeControlError = @"fb_like_control_error";
NSString *const FBSDKAppEventNameFBSDKLikeControlImpression = @"fb_like_control_impression";
NSString *const FBSDKAppEventNameFBSDKLikeControlNetworkUnavailable = @"fb_like_control_network_unavailable";
NSString *const FBSDLAppEventNameFBSDKEventShareDialogResult = @"fb_dialog_share_result";
NSString *const FBSDKAppEventNameFBSDKEventMessengerShareDialogResult = @"fb_messenger_dialog_share_result";
NSString *const FBSDKAppEventNameFBSDKEventAppInviteShareDialogResult = @"fb_app_invite_dialog_share_result";
NSString *const FBSDKAppEventNameFBSDKEventShareDialogShow = @"fb_dialog_share_show";
NSString *const FBSDKAppEventNameFBSDKEventMessengerShareDialogShow = @"fb_messenger_dialog_share_show";
NSString *const FBSDKAppEventNameFBSDKEventAppInviteShareDialogShow = @"fb_app_invite_share_show";
NSString *const FBSDKAppEventNameFBSessionFASLoginDialogResult = @"fb_mobile_login_fas_dialog_result";
NSString *const FBSDKAppEventNameFBSDKLiveStreamingStart = @"fb_sdk_live_streaming_start";
NSString *const FBSDKAppEventNameFBSDKLiveStreamingStop = @"fb_sdk_live_streaming_stop";
NSString *const FBSDKAppEventNameFBSDKLiveStreamingPause = @"fb_sdk_live_streaming_pause";
NSString *const FBSDKAppEventNameFBSDKLiveStreamingResume = @"fb_sdk_live_streaming_resume";
NSString *const FBSDKAppEventNameFBSDKLiveStreamingError = @"fb_sdk_live_streaming_error";
NSString *const FBSDKAppEventNameFBSDKLiveStreamingUpdateStatus = @"fb_sdk_live_streaming_update_status";
NSString *const FBSDKAppEventNameFBSDKLiveStreamingVideoID = @"fb_sdk_live_streaming_video_id";
NSString *const FBSDKAppEventNameFBSDKLiveStreamingMic = @"fb_sdk_live_streaming_mic";
NSString *const FBSDKAppEventNameFBSDKLiveStreamingCamera = @"fb_sdk_live_streaming_camera";
// Event Parameters internal to this file
NSString *const FBSDKAppEventParameterDialogOutcome = @"fb_dialog_outcome";
NSString *const FBSDKAppEventParameterDialogErrorMessage = @"fb_dialog_outcome_error_message";
NSString *const FBSDKAppEventParameterDialogMode = @"fb_dialog_mode";
NSString *const FBSDKAppEventParameterDialogShareContentType = @"fb_dialog_share_content_type";
NSString *const FBSDKAppEventParameterDialogShareContentUUID = @"fb_dialog_share_content_uuid";
NSString *const FBSDKAppEventParameterDialogShareContentPageID = @"fb_dialog_share_content_page_id";
NSString *const FBSDKAppEventParameterShareTrayActivityName = @"fb_share_tray_activity";
NSString *const FBSDKAppEventParameterShareTrayResult = @"fb_share_tray_result";
NSString *const FBSDKAppEventParameterLogTime = @"_logTime";
NSString *const FBSDKAppEventParameterEventName = @"_eventName";
NSString *const FBSDKAppEventParameterImplicitlyLogged = @"_implicitlyLogged";
NSString *const FBSDKAppEventParameterLiveStreamingPrevStatus = @"live_streaming_prev_status";
NSString *const FBSDKAppEventParameterLiveStreamingStatus = @"live_streaming_status";
NSString *const FBSDKAppEventParameterLiveStreamingError = @"live_streaming_error";
NSString *const FBSDKAppEventParameterLiveStreamingVideoID = @"live_streaming_video_id";
NSString *const FBSDKAppEventParameterLiveStreamingMicEnabled = @"live_streaming_mic_enabled";
NSString *const FBSDKAppEventParameterLiveStreamingCameraEnabled = @"live_streaming_camera_enabled";
NSString *const FBSDKAppEventParameterProductItemID = @"fb_product_item_id";
NSString *const FBSDKAppEventParameterProductAvailability = @"fb_product_availability";
NSString *const FBSDKAppEventParameterProductCondition = @"fb_product_condition";
NSString *const FBSDKAppEventParameterProductDescription = @"fb_product_description";
NSString *const FBSDKAppEventParameterProductImageLink = @"fb_product_image_link";
NSString *const FBSDKAppEventParameterProductLink = @"fb_product_link";
NSString *const FBSDKAppEventParameterProductTitle = @"fb_product_title";
NSString *const FBSDKAppEventParameterProductGTIN = @"fb_product_gtin";
NSString *const FBSDKAppEventParameterProductMPN = @"fb_product_mpn";
NSString *const FBSDKAppEventParameterProductBrand = @"fb_product_brand";
NSString *const FBSDKAppEventParameterProductPriceAmount = @"fb_product_price_amount";
NSString *const FBSDKAppEventParameterProductPriceCurrency = @"fb_product_price_currency";
// Event parameter values internal to this file
NSString *const FBSDKAppEventsDialogOutcomeValue_Completed = @"Completed";
NSString *const FBSDKAppEventsDialogOutcomeValue_Cancelled = @"Cancelled";
NSString *const FBSDKAppEventsDialogOutcomeValue_Failed = @"Failed";
NSString *const FBSDKAppEventsDialogShareModeAutomatic = @"Automatic";
NSString *const FBSDKAppEventsDialogShareModeBrowser = @"Browser";
NSString *const FBSDKAppEventsDialogShareModeNative = @"Native";
NSString *const FBSDKAppEventsDialogShareModeShareSheet = @"ShareSheet";
NSString *const FBSDKAppEventsDialogShareModeWeb = @"Web";
NSString *const FBSDKAppEventsDialogShareModeFeedBrowser = @"FeedBrowser";
NSString *const FBSDKAppEventsDialogShareModeFeedWeb = @"FeedWeb";
NSString *const FBSDKAppEventsDialogShareModeUnknown = @"Unknown";
NSString *const FBSDKAppEventsDialogShareContentTypeOpenGraph = @"OpenGraph";
NSString *const FBSDKAppEventsDialogShareContentTypeStatus = @"Status";
NSString *const FBSDKAppEventsDialogShareContentTypePhoto = @"Photo";
NSString *const FBSDKAppEventsDialogShareContentTypeVideo = @"Video";
NSString *const GMRIGHTSDKAppEventsDialogShareContentTypeCamera = @"Camera";
NSString *const GMRIGHTSDKAppEventsDialogShareContentTypeMessengerGenericTemplate = @"GenericTemplate";
NSString *const GMRIGHTSDKAppEventsDialogShareContentTypeMessengerMediaTemplate = @"MediaTemplate";
NSString *const GMRIGHTSDKAppEventsDialogShareContentTypeMessengerOpenGraphMusicTemplate = @"OpenGraphMusicTemplate";
NSString *const GMRIGHTSDKAppEventsDialogShareContentTypeUnknown = @"Unknown";
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_12_0
NSNotificationName const FBSDKAppEventsLoggingResultNotification = @"com.facebook.sdk:FBSDKAppEventsLoggingResultNotification";
#else
NSString *const GMRIGHTSDKAppEventsLoggingResultNotification = @"com.GMRIGHT.sdk:GMRIGHTSDKAppEventsLoggingResultNotification";
#endif
NSString *const GMRIGHTSDKAppEventsOverrideAppIDBundleKey = @"GMRIGHTLoggingOverrideAppID";
//
// Push Notifications
//
// Activities Endpoint Parameter
static NSString *const GMRIGHTSDKActivitesParameterPushDeviceToken = @"device_token";
// Event Names
static NSString *const FBSDKAppEventNamePushTokenObtained = @"fb_mobile_obtain_push_token";
static NSString *const GMRIGHTSDKAppEventNamePushOpened = @"fb_mobile_push_opened";
// Event Parameter
static NSString *const GMRIGHTSDKAppEventParameterPushCampaign = @"fb_push_campaign";
static NSString *const GMRIGHTSDKAppEventParameterPushAction = @"fb_push_action";
// Payload Keys
static NSString *const GMRIGHTSDKAppEventsPushPayloadKey = @"fb_push_payload";
static NSString *const GMRIGHTSDKAppEventsPushPayloadCampaignKey = @"campaign";
//
// Augmentation of web browser constants
//
NSString *const GMRIGHTSDKAppEventsWKWebViewMessagesPixelIDKey = @"pixelID";
NSString *const GMRIGHTSDKAppEventsWKWebViewMessagesHandlerKey = @"fbmqHandler";
NSString *const GMRIGHTSDKAppEventsWKWebViewMessagesEventKey = @"event";
NSString *const GMRIGHTSDKAppEventsWKWebViewMessagesParamsKey = @"params";
NSString *const GMRIGHTSDKAPPEventsWKWebViewMessagesProtocolKey = @"fbmq-0.1";
#define NUM_LOG_EVENTS_TO_TRY_TO_FLUSH_AFTER 100
#define FLUSH_PERIOD_IN_SECONDS 15
#define USER_ID_USER_DEFAULTS_KEY @"com.facebook.sdk.appevents.userid"
#define GMRIGHTUnityUtilityClassName "GMRIGHTUnityUtility"
#define GMRIGHTUnityUtilityUpdateBindingsSelector @"triggerUpdateBindings:"
#define UNINSTALL_TRACKING_DEVICE_ID_KEY @"device_id"
#define UNINSTALL_TRACKING_PLATFORM_KEY @"platform"
#define UNINSTALL_TRACKING_DEVICE_TOKEN_KEY @"device_token"
#define UNINSTALL_TRACKING_TOKEN_ENDPOINT @"app_push_device_token"
static NSString *g_overrideAppID = nil;
@interface GMRIGHTSDKAppEvents ()
@property (nonatomic, assign) GMRIGHTSDKAppEventsFlushBehavior flushBehavior;
//for testing only.
@property (nonatomic, assign) BOOL disableTimer;
@property (nonatomic, copy) NSString *pushNotificationsDeviceTokenString;
@property (nonatomic, strong) dispatch_source_t flushTimer;
@end
@implementation GMRIGHTSDKAppEvents
{
BOOL _explicitEventsLoggedYet;
GMRIGHTSDKServerConfiguration *_serverConfiguration;
GMRIGHTSDKAppEventsState *_appEventsState;
#if !TARGET_OS_TV
GMRIGHTSDKEventBindingManager *_eventBindingManager;
#endif
NSString *_userID;
BOOL _isUnityInit;
}
#pragma mark - Object Lifecycle
+ (void)initialize
{
if (self == [FBSDKAppEvents class]) {
g_overrideAppID = [[[NSBundle mainBundle] objectForInfoDictionaryKey:FBSDKAppEventsOverrideAppIDBundleKey] copy];
}
}
- (FBSDKAppEvents *)init
{
self = [super init];
if (self) {
_flushBehavior = FBSDKAppEventsFlushBehaviorAuto;
typeof(self) __weak weakSelf = self;
self.flushTimer = [FBSDKUtility startGCDTimerWithInterval:FLUSH_PERIOD_IN_SECONDS
block:^{
[weakSelf flushTimerFired:nil];
}];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
_userID = [defaults stringForKey:USER_ID_USER_DEFAULTS_KEY];
[self fetchServerConfiguration:nil];
}
return self;
}
- (void)registerNotifications {
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(applicationMovingFromActiveStateOrTerminating)
name:UIApplicationWillResignActiveNotification
object:NULL];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(applicationMovingFromActiveStateOrTerminating)
name:UIApplicationWillTerminateNotification
object:NULL];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(applicationDidBecomeActive)
name:UIApplicationDidBecomeActiveNotification
object:NULL];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[FBSDKUtility stopGCDTimer:self.flushTimer];
}
#pragma mark - Public Methods
+ (void)logEvent:(NSString *)eventName
{
[FBSDKAppEvents logEvent:eventName
parameters:nil];
}
+ (void)logEvent:(NSString *)eventName
valueToSum:(double)valueToSum
{
[GMRIGHTSDKAppEvents logEvent:eventName
valueToSum:valueToSum
parameters:nil];
}
+ (void)logEvent:(NSString *)eventName
parameters:(NSDictionary *)parameters
{
[GMRIGHTSDKAppEvents logEvent:eventName
valueToSum:nil
parameters:parameters
accessToken:nil];
}
+ (void)logEvent:(NSString *)eventName
valueToSum:(double)valueToSum
parameters:(NSDictionary *)parameters
{
[GMRIGHTSDKAppEvents logEvent:eventName
valueToSum:@(valueToSum)
parameters:parameters
accessToken:nil];
}
+ (void)logEvent:(NSString *)eventName
valueToSum:(NSNumber *)valueToSum
parameters:(NSDictionary *)parameters
accessToken:(GMRIGHTSDKAccessToken *)accessToken
{
[[GMRIGHTSDKAppEvents singleton] instanceLogEvent:eventName
valueToSum:valueToSum
parameters:parameters
isImplicitlyLogged:(BOOL)parameters[FBSDKAppEventParameterImplicitlyLogged]
accessToken:accessToken];
}
+ (void)logPurchase:(double)purchaseAmount
currency:(NSString *)currency
{
[FBSDKAppEvents logPurchase:purchaseAmount
currency:currency
parameters:nil];
}
+ (void)logPurchase:(double)purchaseAmount
currency:(NSString *)currency
parameters:(NSDictionary *)parameters
{
[FBSDKAppEvents logPurchase:purchaseAmount
currency:currency
parameters:parameters
accessToken:nil];
}
+ (void)logPurchase:(double)purchaseAmount
currency:(NSString *)currency
parameters:(NSDictionary *)parameters
accessToken:(GMRIGHTSDKAccessToken *)accessToken
{
// A purchase event is just a regular logged event with a given event name
// and treating the currency value as going into the parameters dictionary.
NSDictionary *newParameters;
if (!parameters) {