react-native-mparticle 2.7.13 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/SECURITY.md +9 -0
  2. package/android/build.gradle +65 -10
  3. package/android/src/main/AndroidManifestNew.xml +3 -0
  4. package/android/src/main/java/com/mparticle/react/MParticleModule.kt +976 -0
  5. package/android/src/main/java/com/mparticle/react/MParticlePackage.kt +68 -0
  6. package/android/src/main/java/com/mparticle/react/rokt/MPRoktModuleImpl.kt +251 -0
  7. package/android/src/main/java/com/mparticle/react/rokt/RoktLayoutViewManagerImpl.kt +79 -0
  8. package/android/src/newarch/java/com/mparticle/react/rokt/MPRoktModule.kt +130 -0
  9. package/android/src/newarch/java/com/mparticle/react/rokt/RoktLayoutViewManager.kt +22 -0
  10. package/android/src/oldarch/java/com/mparticle/react/NativeMPRoktSpec.kt +29 -0
  11. package/android/src/oldarch/java/com/mparticle/react/NativeMParticleSpec.kt +153 -0
  12. package/android/src/oldarch/java/com/mparticle/react/rokt/MPRoktModule.kt +79 -0
  13. package/android/src/oldarch/java/com/mparticle/react/rokt/RoktLayoutViewManager.kt +34 -0
  14. package/ios/RNMParticle/RNMPRokt.h +15 -0
  15. package/ios/RNMParticle/RNMPRokt.mm +247 -0
  16. package/ios/RNMParticle/RNMParticle.h +6 -1
  17. package/ios/RNMParticle/RNMParticle.mm +1199 -0
  18. package/ios/RNMParticle/RoktEventManager.h +16 -0
  19. package/ios/RNMParticle/RoktEventManager.m +174 -0
  20. package/ios/RNMParticle/RoktLayoutManager.m +22 -0
  21. package/ios/RNMParticle/RoktNativeLayoutComponentView.h +18 -0
  22. package/ios/RNMParticle/RoktNativeLayoutComponentView.mm +50 -0
  23. package/ios/RNMParticle.xcodeproj/project.pbxproj +29 -6
  24. package/js/codegenSpecs/NativeMParticle.ts +214 -0
  25. package/js/codegenSpecs/rokt/NativeMPRokt.ts +32 -0
  26. package/js/codegenSpecs/rokt/RoktLayoutNativeComponent.ts +29 -0
  27. package/js/index.tsx +940 -0
  28. package/js/rokt/rokt-layout-view.android.tsx +133 -0
  29. package/js/rokt/rokt-layout-view.ios.tsx +121 -0
  30. package/js/rokt/rokt-layout-view.tsx +15 -0
  31. package/js/rokt/rokt.ts +87 -0
  32. package/js/utils/architecture.ts +22 -0
  33. package/lib/codegenSpecs/NativeMParticle.d.ts +148 -0
  34. package/lib/codegenSpecs/NativeMParticle.js +5 -0
  35. package/lib/codegenSpecs/NativeMParticle.js.map +1 -0
  36. package/lib/codegenSpecs/rokt/NativeMPRokt.d.ts +24 -0
  37. package/lib/codegenSpecs/rokt/NativeMPRokt.js +5 -0
  38. package/lib/codegenSpecs/rokt/NativeMPRokt.js.map +1 -0
  39. package/lib/codegenSpecs/rokt/RoktLayoutNativeComponent.d.ts +18 -0
  40. package/lib/codegenSpecs/rokt/RoktLayoutNativeComponent.js +8 -0
  41. package/lib/codegenSpecs/rokt/RoktLayoutNativeComponent.js.map +1 -0
  42. package/lib/index.d.ts +410 -0
  43. package/lib/index.js +645 -0
  44. package/lib/index.js.map +1 -0
  45. package/lib/rokt/rokt-layout-view.android.d.ts +39 -0
  46. package/lib/rokt/rokt-layout-view.android.js +109 -0
  47. package/lib/rokt/rokt-layout-view.android.js.map +1 -0
  48. package/lib/rokt/rokt-layout-view.d.ts +5 -0
  49. package/lib/rokt/rokt-layout-view.ios.d.ts +32 -0
  50. package/lib/rokt/rokt-layout-view.ios.js +84 -0
  51. package/lib/rokt/rokt-layout-view.ios.js.map +1 -0
  52. package/lib/rokt/rokt-layout-view.js +12 -0
  53. package/lib/rokt/rokt-layout-view.js.map +1 -0
  54. package/lib/rokt/rokt.d.ts +40 -0
  55. package/lib/rokt/rokt.js +54 -0
  56. package/lib/rokt/rokt.js.map +1 -0
  57. package/lib/utils/architecture.d.ts +9 -0
  58. package/lib/utils/architecture.js +19 -0
  59. package/lib/utils/architecture.js.map +1 -0
  60. package/package.json +32 -10
  61. package/react-native-mparticle.podspec +7 -6
  62. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  63. package/.github/dependabot.yml +0 -12
  64. package/.github/workflows/daily.yml +0 -19
  65. package/.github/workflows/dependabot-automerge.yml +0 -12
  66. package/.github/workflows/pull-request.yml +0 -60
  67. package/.github/workflows/release.yml +0 -60
  68. package/.github/workflows/sonarcloud.yml +0 -16
  69. package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
  70. package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
  71. package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
  72. package/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  73. package/android/.gradle/7.5.1/dependencies-accessors/gc.properties +0 -0
  74. package/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
  75. package/android/.gradle/7.5.1/fileChanges/last-build.bin +0 -0
  76. package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
  77. package/android/.gradle/7.5.1/gc.properties +0 -0
  78. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  79. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  80. package/android/.gradle/vcs-1/gc.properties +0 -0
  81. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  82. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  83. package/android/gradle.properties +0 -53
  84. package/android/gradlew +0 -160
  85. package/android/gradlew.bat +0 -90
  86. package/android/libs/java-json.jar +0 -0
  87. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar +0 -0
  88. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.md5 +0 -1
  89. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.sha1 +0 -1
  90. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.sha256 +0 -1
  91. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug-sources.jar.sha512 +0 -1
  92. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar +0 -0
  93. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.md5 +0 -1
  94. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.sha1 +0 -1
  95. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.sha256 +0 -1
  96. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-debug.aar.sha512 +0 -1
  97. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar +0 -0
  98. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.md5 +0 -1
  99. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.sha1 +0 -1
  100. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.sha256 +0 -1
  101. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release-sources.jar.sha512 +0 -1
  102. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar +0 -0
  103. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.md5 +0 -1
  104. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.sha1 +0 -1
  105. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.sha256 +0 -1
  106. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5-release.aar.sha512 +0 -1
  107. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module +0 -204
  108. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.md5 +0 -1
  109. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.sha1 +0 -1
  110. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.sha256 +0 -1
  111. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.module.sha512 +0 -1
  112. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom +0 -44
  113. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.md5 +0 -1
  114. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.sha1 +0 -1
  115. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.sha256 +0 -1
  116. package/android/libs/react-native-android/com/facebook/react/hermes-engine/0.70.5/hermes-engine-0.70.5.pom.sha512 +0 -1
  117. package/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml +0 -13
  118. package/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.md5 +0 -1
  119. package/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.sha1 +0 -1
  120. package/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.sha256 +0 -1
  121. package/android/libs/react-native-android/com/facebook/react/hermes-engine/maven-metadata.xml.sha512 +0 -1
  122. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar +0 -0
  123. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.md5 +0 -1
  124. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.sha1 +0 -1
  125. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.sha256 +0 -1
  126. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug-sources.jar.sha512 +0 -1
  127. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar +0 -0
  128. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.md5 +0 -1
  129. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.sha1 +0 -1
  130. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.sha256 +0 -1
  131. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-debug.aar.sha512 +0 -1
  132. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar +0 -0
  133. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.md5 +0 -1
  134. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.sha1 +0 -1
  135. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.sha256 +0 -1
  136. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release-sources.jar.sha512 +0 -1
  137. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar +0 -0
  138. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.md5 +0 -1
  139. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.sha1 +0 -1
  140. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.sha256 +0 -1
  141. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5-release.aar.sha512 +0 -1
  142. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module +0 -628
  143. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.md5 +0 -1
  144. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.sha1 +0 -1
  145. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.sha256 +0 -1
  146. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.module.sha512 +0 -1
  147. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom +0 -156
  148. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.md5 +0 -1
  149. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.sha1 +0 -1
  150. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.sha256 +0 -1
  151. package/android/libs/react-native-android/com/facebook/react/react-native/0.70.5/react-native-0.70.5.pom.sha512 +0 -1
  152. package/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml +0 -13
  153. package/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.md5 +0 -1
  154. package/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.sha1 +0 -1
  155. package/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.sha256 +0 -1
  156. package/android/libs/react-native-android/com/facebook/react/react-native/maven-metadata.xml.sha512 +0 -1
  157. package/android/src/main/java/com/mparticle/react/MParticleModule.java +0 -987
  158. package/android/src/main/java/com/mparticle/react/MParticlePackage.java +0 -34
  159. package/android/src/test/java/com/mparticle/react/IdentityApiTest.java +0 -230
  160. package/android/src/test/java/com/mparticle/react/MParticleUserTest.java +0 -233
  161. package/android/src/test/java/com/mparticle/react/testutils/MockMParticleUser.java +0 -103
  162. package/android/src/test/java/com/mparticle/react/testutils/MockMap.java +0 -169
  163. package/android/src/test/java/com/mparticle/react/testutils/MockReadableArray.java +0 -53
  164. package/android/src/test/java/com/mparticle/react/testutils/MockWritableMap.java +0 -4
  165. package/android/src/test/java/com/mparticle/react/testutils/Mutable.java +0 -13
  166. package/ios/RNMParticle/RNMParticle.m +0 -678
  167. package/ios/RNMParticle.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  168. package/ios/RNMParticle.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  169. package/ios/RNMParticle.xcodeproj/project.xcworkspace/xcuserdata/bstalnaker.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  170. package/ios/RNMParticle.xcodeproj/xcuserdata/bstalnaker.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  171. package/js/index.js +0 -697
  172. package/release.sh +0 -6
@@ -1,678 +0,0 @@
1
- #import "RNMParticle.h"
2
- #if defined(__has_include) && __has_include(<mParticle_Apple_SDK/mParticle.h>)
3
- #import <mParticle_Apple_SDK/mParticle.h>
4
- #elif defined(__has_include) && __has_include(<mParticle_Apple_SDK_NoLocation/mParticle.h>)
5
- #import <mParticle_Apple_SDK_NoLocation/mParticle.h>
6
- #else
7
- #import "mParticle.h"
8
- #endif
9
- #if defined(__has_include) && __has_include(<mParticle_Apple_SDK/mParticle_Apple_SDK-Swift.h>)
10
- #import <mParticle_Apple_SDK/mParticle_Apple_SDK-Swift.h>
11
- #elif defined(__has_include) && __has_include(<mParticle_Apple_SDK_NoLocation/mParticle_Apple_SDK-Swift.h>)
12
- #import <mParticle_Apple_SDK_NoLocation/mParticle_Apple_SDK-Swift.h>
13
- #else
14
- #import "mParticle_Apple_SDK-Swift.h"
15
- #endif
16
- #import <React/RCTConvert.h>
17
-
18
- @interface MParticleUser ()
19
-
20
- - (void)setUserId:(NSNumber *)userId;
21
- @end
22
-
23
- @implementation RNMParticle
24
-
25
- RCT_EXTERN void RCTRegisterModule(Class);
26
-
27
- + (NSString *)moduleName {
28
- return @"MParticle";
29
- }
30
-
31
- + (void)load {
32
- RCTRegisterModule(self);
33
- }
34
-
35
- RCT_EXPORT_METHOD(upload)
36
- {
37
- [[MParticle sharedInstance] upload];
38
- }
39
-
40
- RCT_EXPORT_METHOD(setLocation:(double)latitude longitude:(double)longitude)
41
- {
42
- CLLocation *newLocation = [[CLLocation alloc] initWithLatitude:latitude longitude:longitude];
43
- [MParticle sharedInstance].location = newLocation;
44
- }
45
-
46
- RCT_EXPORT_METHOD(setUploadInterval:(NSInteger)uploadInterval)
47
- {
48
- [[MParticle sharedInstance] setUploadInterval:uploadInterval];
49
- }
50
-
51
- RCT_EXPORT_METHOD(logEvent:(NSString *)eventName type:(NSInteger)type attributes:(NSDictionary *)attributes)
52
- {
53
- [[MParticle sharedInstance] logEvent:eventName eventType:type eventInfo:attributes];
54
- }
55
-
56
- RCT_EXPORT_METHOD(logMPEvent:(MPEvent *)event)
57
- {
58
- [[MParticle sharedInstance] logEvent:event];
59
- }
60
-
61
- RCT_EXPORT_METHOD(logCommerceEvent:(MPCommerceEvent *)commerceEvent)
62
- {
63
- [[MParticle sharedInstance] logCommerceEvent:commerceEvent];
64
- }
65
-
66
- RCT_EXPORT_METHOD(logScreenEvent:(NSString *)screenName attributes:(NSDictionary *)attributes shouldUploadEvent:(BOOL)shouldUploadEvent)
67
- {
68
- [[MParticle sharedInstance] logScreen:screenName eventInfo:attributes shouldUploadEvent:shouldUploadEvent];
69
- }
70
-
71
- RCT_EXPORT_METHOD(setATTStatus:(NSInteger)status withATTStatusTimestampMillis:(nonnull NSNumber *)timestamp)
72
- {
73
- [[MParticle sharedInstance] setATTStatus:status withATTStatusTimestampMillis:timestamp];
74
- }
75
-
76
- RCT_EXPORT_METHOD(setATTStatus:(NSInteger)status)
77
- {
78
- [[MParticle sharedInstance] setATTStatus:status withATTStatusTimestampMillis:nil];
79
- }
80
-
81
- RCT_EXPORT_METHOD(setOptOut:(BOOL)optOut)
82
- {
83
- [[MParticle sharedInstance] setOptOut:optOut];
84
- }
85
-
86
- RCT_EXPORT_METHOD(getOptOut:(RCTResponseSenderBlock)completion)
87
- {
88
- BOOL optedOut = [[MParticle sharedInstance] optOut];
89
- completion(@[[NSNumber numberWithBool:optedOut]]);
90
- }
91
-
92
- RCT_EXPORT_METHOD(addGDPRConsentState:(MPGDPRConsent *)gdprConsentState purpose:(NSString *)purpose)
93
- {
94
- MParticleUser *user = [MParticle sharedInstance].identity.currentUser;
95
-
96
- MPConsentState *consentState = user.consentState ? user.consentState : [[MPConsentState alloc] init];
97
- [consentState addGDPRConsentState:gdprConsentState purpose:purpose];
98
- user.consentState = consentState;
99
- }
100
-
101
- RCT_EXPORT_METHOD(removeGDPRConsentStateWithPurpose:(NSString *)purpose)
102
- {
103
- MParticleUser *user = [MParticle sharedInstance].identity.currentUser;
104
-
105
- MPConsentState *consentState = user.consentState ? user.consentState : [[MPConsentState alloc] init];
106
- [consentState removeGDPRConsentStateWithPurpose:purpose];
107
- user.consentState = consentState;
108
- }
109
-
110
- RCT_EXPORT_METHOD(setCCPAConsentState:(MPCCPAConsent *)consent)
111
- {
112
- MParticleUser *user = [MParticle sharedInstance].identity.currentUser;
113
-
114
- MPConsentState *consentState = user.consentState ? user.consentState : [[MPConsentState alloc] init];
115
- [consentState setCCPAConsentState:consent];
116
- user.consentState = consentState;
117
- }
118
-
119
- RCT_EXPORT_METHOD(removeCCPAConsentState)
120
- {
121
- MParticleUser *user = [MParticle sharedInstance].identity.currentUser;
122
-
123
- MPConsentState *consentState = user.consentState ? user.consentState : [[MPConsentState alloc] init];
124
- [consentState removeCCPAConsentState];
125
- user.consentState = consentState;
126
- }
127
-
128
- #if TARGET_OS_IOS == 1
129
- RCT_EXPORT_METHOD(logPushRegistration:(NSString *)iosToken androidField:(NSString *)androidField)
130
- {
131
- if (iosToken != nil) {
132
- NSData* pushTokenData = [iosToken dataUsingEncoding:NSUTF8StringEncoding];
133
- MParticle* instance = [MParticle sharedInstance];
134
- instance.pushNotificationToken = pushTokenData;
135
- }
136
- }
137
- #endif
138
-
139
- RCT_EXPORT_METHOD(isKitActive:(nonnull NSNumber*)kitId completion:(RCTResponseSenderBlock)completion)
140
- {
141
- BOOL active = [[MParticle sharedInstance] isKitActive:kitId];
142
- completion(@[[NSNumber numberWithBool:active]]);
143
- }
144
-
145
- RCT_EXPORT_METHOD(getAttributions:(RCTResponseSenderBlock)completion)
146
- {
147
- NSDictionary<NSNumber *, MPAttributionResult *> *attributions = [[MParticle sharedInstance]attributionInfo];
148
- NSMutableDictionary*dictionary = [[NSMutableDictionary alloc]init];
149
- for (NSNumber *kitId in attributions) {
150
- MPAttributionResult *attributionResult = attributions[kitId];
151
- NSMutableDictionary *attributionDict = [[NSMutableDictionary alloc]initWithCapacity:2];
152
- if (attributionResult.linkInfo != nil) {
153
- attributionDict[@"linkParameters"] = attributionResult.linkInfo;
154
- }
155
- if (attributionResult.kitCode != nil) {
156
- attributionDict[@"kitId"] = attributionResult.kitCode;
157
- }
158
- dictionary[[kitId stringValue]] = attributionDict;
159
- }
160
- completion(@[dictionary]);
161
- }
162
-
163
- RCT_EXPORT_METHOD(setUserAttribute:(NSString *)userId key:(NSString *)key value:(NSString *)value)
164
- {
165
- MParticleUser *selectedUser = [[MParticleUser alloc] init];
166
- selectedUser.userId = [NSNumber numberWithLong:userId.longLongValue];
167
- [selectedUser setUserAttribute:key
168
- value:value];
169
- }
170
-
171
- RCT_EXPORT_METHOD(setUserAttributeArray:(NSString *)userId key:(NSString *)key values:(NSArray *)values)
172
- {
173
- MParticleUser *selectedUser = [[MParticleUser alloc] init];
174
- selectedUser.userId = [NSNumber numberWithLong:userId.longLongValue];
175
- [selectedUser setUserAttributeList:key
176
- values:values];
177
- }
178
-
179
- RCT_EXPORT_METHOD(getUserAttributes:(NSString *)userId completion:(RCTResponseSenderBlock)completion)
180
- {
181
- MParticleUser *selectedUser = [[MParticleUser alloc] init];
182
- selectedUser.userId = [NSNumber numberWithLong:userId.longLongValue];
183
- completion(@[[NSNull null], [selectedUser userAttributes]]);
184
- }
185
-
186
- RCT_EXPORT_METHOD(setUserTag:(NSString *)userId tag:(NSString *)tag)
187
- {
188
- MParticleUser *selectedUser = [[MParticleUser alloc] init];
189
- selectedUser.userId = [NSNumber numberWithLong:userId.longLongValue];
190
- [selectedUser setUserTag:tag];
191
- }
192
-
193
- RCT_EXPORT_METHOD(removeUserAttribute:(NSString *)userId key:(NSString *)key)
194
- {
195
- MParticleUser *selectedUser = [[MParticleUser alloc] init];
196
- selectedUser.userId = [NSNumber numberWithLong:userId.longLongValue];
197
- [selectedUser removeUserAttribute:key];
198
- }
199
-
200
- RCT_EXPORT_METHOD(incrementUserAttribute:(NSString *)userId key:(NSString *)key value:(NSNumber * _Nonnull)value)
201
- {
202
- MParticleUser *selectedUser = [[MParticleUser alloc] init];
203
- selectedUser.userId = [NSNumber numberWithLong:userId.longLongValue];
204
- [selectedUser incrementUserAttribute:key
205
- byValue:value];
206
- }
207
-
208
- RCT_EXPORT_METHOD(identify:(MPIdentityApiRequest *)identityRequest completion:(RCTResponseSenderBlock)completion)
209
- {
210
- [[[MParticle sharedInstance] identity] identify:identityRequest completion:^(MPIdentityApiResult * _Nullable apiResult, NSError * _Nullable error) {
211
- NSMutableDictionary *reactError;
212
- if (error) {
213
- reactError = [[NSMutableDictionary alloc] initWithCapacity:4];
214
- MPIdentityHTTPErrorResponse *response = error.userInfo[mParticleIdentityErrorKey];
215
-
216
- if ([response isKindOfClass:[NSString class]]) {
217
- [reactError setObject:response forKey:@"message"];
218
- } else {
219
- if ([NSNumber numberWithLong:response.httpCode] != nil) {
220
- [reactError setObject:[NSNumber numberWithLong:response.httpCode] forKey:@"httpCode"];
221
- }
222
-
223
- if ([NSNumber numberWithInt:response.code] != nil) {
224
- [reactError setObject:[NSNumber numberWithInt:response.code] forKey:@"responseCode"];
225
- }
226
-
227
- if (response.message != nil) {
228
- [reactError setObject:response.message forKey:@"message"];
229
- }
230
- }
231
- if (apiResult != nil) {
232
- completion(@[reactError, apiResult.user.userId.stringValue, apiResult.previousUser.userId.stringValue]);
233
- } else {
234
- completion(@[reactError, @0]);
235
- }
236
- } else {
237
- completion(@[[NSNull null], apiResult.user.userId.stringValue, apiResult.previousUser.userId.stringValue]);
238
- }
239
- }];
240
- }
241
-
242
- RCT_EXPORT_METHOD(login:(MPIdentityApiRequest *)identityRequest completion:(RCTResponseSenderBlock)completion)
243
- {
244
- [[[MParticle sharedInstance] identity] login:identityRequest completion:^(MPIdentityApiResult * _Nullable apiResult, NSError * _Nullable error) {
245
- NSMutableDictionary *reactError;
246
- if (error) {
247
- reactError = [[NSMutableDictionary alloc] initWithCapacity:4];
248
- MPIdentityHTTPErrorResponse *response = error.userInfo[mParticleIdentityErrorKey];
249
-
250
- if ([response isKindOfClass:[NSString class]]) {
251
- [reactError setObject:response forKey:@"message"];
252
- } else {
253
- if ([NSNumber numberWithLong:response.httpCode] != nil) {
254
- [reactError setObject:[NSNumber numberWithLong:response.httpCode] forKey:@"httpCode"];
255
- }
256
-
257
- if ([NSNumber numberWithInt:response.code] != nil) {
258
- [reactError setObject:[NSNumber numberWithInt:response.code] forKey:@"responseCode"];
259
- }
260
-
261
- if (response.message != nil) {
262
- [reactError setObject:response.message forKey:@"message"];
263
- }
264
- }
265
- if (apiResult != nil) {
266
- completion(@[reactError, apiResult.user.userId.stringValue, apiResult.previousUser.userId.stringValue]);
267
- } else {
268
- completion(@[reactError, @0]);
269
- }
270
- } else {
271
- completion(@[[NSNull null], apiResult.user.userId.stringValue, apiResult.previousUser.userId.stringValue]);
272
- }
273
- }];
274
- }
275
-
276
- RCT_EXPORT_METHOD(logout:(MPIdentityApiRequest *)identityRequest completion:(RCTResponseSenderBlock)completion)
277
- {
278
- [[[MParticle sharedInstance] identity] logout:identityRequest completion:^(MPIdentityApiResult * _Nullable apiResult, NSError * _Nullable error) {
279
- NSMutableDictionary *reactError;
280
- if (error) {
281
- reactError = [[NSMutableDictionary alloc] initWithCapacity:4];
282
- MPIdentityHTTPErrorResponse *response = error.userInfo[mParticleIdentityErrorKey];
283
-
284
- if ([response isKindOfClass:[NSString class]]) {
285
- [reactError setObject:response forKey:@"message"];
286
- } else {
287
- if ([NSNumber numberWithLong:response.httpCode] != nil) {
288
- [reactError setObject:[NSNumber numberWithLong:response.httpCode] forKey:@"httpCode"];
289
- }
290
-
291
- if ([NSNumber numberWithInt:response.code] != nil) {
292
- [reactError setObject:[NSNumber numberWithInt:response.code] forKey:@"responseCode"];
293
- }
294
-
295
- if (response.message != nil) {
296
- [reactError setObject:response.message forKey:@"message"];
297
- }
298
- }
299
- if (apiResult != nil) {
300
- completion(@[reactError, apiResult.user.userId.stringValue, apiResult.previousUser.userId.stringValue]);
301
- } else {
302
- completion(@[reactError, @0]);
303
- }
304
- } else {
305
- completion(@[[NSNull null], apiResult.user.userId.stringValue, apiResult.previousUser.userId.stringValue]);
306
- }
307
- }];
308
- }
309
-
310
- RCT_EXPORT_METHOD(modify:(MPIdentityApiRequest *)identityRequest completion:(RCTResponseSenderBlock)completion)
311
- {
312
- [[[MParticle sharedInstance] identity] modify:identityRequest completion:^(MPIdentityApiResult * _Nullable apiResult, NSError * _Nullable error) {
313
- NSMutableDictionary *reactError;
314
- if (error) {
315
- reactError = [[NSMutableDictionary alloc] initWithCapacity:4];
316
- MPIdentityHTTPErrorResponse *response = error.userInfo[mParticleIdentityErrorKey];
317
-
318
- if ([response isKindOfClass:[NSString class]]) {
319
- [reactError setObject:response forKey:@"message"];
320
- } else {
321
- if ([NSNumber numberWithLong:response.httpCode] != nil) {
322
- [reactError setObject:[NSNumber numberWithLong:response.httpCode] forKey:@"httpCode"];
323
- }
324
-
325
- if ([NSNumber numberWithInt:response.code] != nil) {
326
- [reactError setObject:[NSNumber numberWithInt:response.code] forKey:@"responseCode"];
327
- }
328
-
329
- if (response.message != nil) {
330
- [reactError setObject:response.message forKey:@"message"];
331
- }
332
- }
333
- if (apiResult != nil) {
334
- completion(@[reactError, apiResult.user.userId.stringValue, [NSNull null]]);
335
- } else {
336
- completion(@[reactError, @0]);
337
- }
338
- } else {
339
- completion(@[[NSNull null], apiResult.user.userId.stringValue, [NSNull null]]);
340
- }
341
- }];
342
- }
343
-
344
- RCT_EXPORT_METHOD(aliasUsers:(MPAliasRequest *) aliasRequest completion:(RCTResponseSenderBlock)completion)
345
- {
346
- BOOL success = [[[MParticle sharedInstance] identity] aliasUsers:aliasRequest];
347
- completion(@[[NSNull null], success ? @"true" : @"false"]);
348
- }
349
-
350
- RCT_EXPORT_METHOD(getCurrentUserWithCompletion:(RCTResponseSenderBlock)completion)
351
- {
352
- completion(@[[NSNull null], [[[MParticle sharedInstance] identity] currentUser].userId.stringValue]);
353
- }
354
-
355
- RCT_EXPORT_METHOD(getUserIdentities:(NSString *)userId completion:(RCTResponseSenderBlock)completion)
356
- {
357
- MParticleUser *selectedUser = [[MParticleUser alloc] init];
358
- selectedUser.userId = [NSNumber numberWithLong:userId.longLongValue];
359
- completion(@[[NSNull null], [selectedUser identities]]);
360
- }
361
-
362
- RCT_EXPORT_METHOD(getFirstSeen:(NSString *)userId completion:(RCTResponseSenderBlock)completion)
363
- {
364
- MParticleUser *selectedUser = [[MParticleUser alloc] init];
365
- selectedUser.userId = [NSNumber numberWithLong:userId.longLongValue];
366
- completion(@[[NSNull null], [selectedUser firstSeen]]);
367
- }
368
-
369
- RCT_EXPORT_METHOD(getLastSeen:(NSString *)userId completion:(RCTResponseSenderBlock)completion)
370
- {
371
- MParticleUser *selectedUser = [[MParticleUser alloc] init];
372
- selectedUser.userId = [NSNumber numberWithLong:userId.longLongValue];
373
- completion(@[[NSNull null], [selectedUser lastSeen]]);
374
- }
375
-
376
- RCT_EXPORT_METHOD(getSession:(RCTResponseSenderBlock)completion)
377
- {
378
- MParticleSession *session = [MParticle sharedInstance].currentSession;
379
- if (session && session.UUID) {
380
- completion(@[session.UUID]);
381
- } else {
382
- completion(@[[NSNull null]]);
383
- }
384
- }
385
-
386
- @end
387
-
388
- typedef NS_ENUM(NSUInteger, MPReactCommerceEventAction) {
389
- MPReactCommerceEventActionAddToCart = 1,
390
- MPReactCommerceEventActionRemoveFromCart,
391
- MPReactCommerceEventActionCheckout,
392
- MPReactCommerceEventActionCheckoutOptions,
393
- MPReactCommerceEventActionClick,
394
- MPReactCommerceEventActionViewDetail,
395
- MPReactCommerceEventActionPurchase,
396
- MPReactCommerceEventActionRefund,
397
- MPReactCommerceEventActionAddToWishList,
398
- MPReactCommerceEventActionRemoveFromWishlist
399
- };
400
-
401
- @interface RCTConvert (MPCommerceEvent)
402
-
403
- + (MPCommerceEvent *)MPCommerceEvent:(id)json;
404
- + (MPPromotionContainer *)MPPromotionContainer:(id)json;
405
- + (MPPromotion *)MPPromotion:(id)json;
406
- + (MPTransactionAttributes *)MPTransactionAttributes:(id)json;
407
- + (MPProduct *)MPProduct:(id)json;
408
- + (MPCommerceEventAction)MPCommerceEventAction:(id)json;
409
- + (MPIdentityApiRequest *)MPIdentityApiRequest:(id)json;
410
- + (MPIdentityApiResult *)MPIdentityApiResult:(id)json;
411
- + (MPAliasRequest *)MPAliasRequest:(id)json;
412
- + (MParticleUser *)MParticleUser:(id)json;
413
- + (MPEvent *)MPEvent:(id)json;
414
- + (MPGDPRConsent *)MPGDPRConsent:(id)json;
415
- + (MPCCPAConsent *)MPCCPAConsent:(id)json;
416
-
417
- @end
418
-
419
- @implementation RCTConvert (MPCommerceEvent)
420
-
421
- + (MPCommerceEvent *)MPCommerceEvent:(id)json {
422
- BOOL isProductAction = json[@"productActionType"] != nil;
423
- BOOL isPromotion = json[@"promotionActionType"] != nil;
424
- BOOL isImpression = json[@"impressions"] != nil;
425
-
426
- NSAssert(isProductAction || isPromotion || isImpression, @"Invalid commerce event");
427
-
428
- MPCommerceEvent *commerceEvent = nil;
429
- if (isProductAction) {
430
- MPCommerceEventAction action = [RCTConvert MPCommerceEventAction:json[@"productActionType"]];
431
- commerceEvent = [[MPCommerceEvent alloc] initWithAction:action];
432
- }
433
- else if (isPromotion) {
434
- MPPromotionContainer *promotionContainer = [RCTConvert MPPromotionContainer:json];
435
- commerceEvent = [[MPCommerceEvent alloc] initWithPromotionContainer:promotionContainer];
436
- }
437
- else {
438
- commerceEvent = [[MPCommerceEvent alloc] initWithImpressionName:nil product:nil];
439
- }
440
-
441
- commerceEvent.checkoutOptions = json[@"checkoutOptions"];
442
- commerceEvent.currency = json[@"currency"];
443
- commerceEvent.productListName = json[@"productActionListName"];
444
- commerceEvent.productListSource = json[@"productActionListSource"];
445
- commerceEvent.screenName = json[@"screenName"];
446
- commerceEvent.transactionAttributes = [RCTConvert MPTransactionAttributes:json[@"transactionAttributes"]];
447
- commerceEvent.checkoutStep = [json[@"checkoutStep"] intValue];
448
- commerceEvent.nonInteractive = [json[@"nonInteractive"] boolValue];
449
- if (json[@"shouldUploadEvent"] != nil) {
450
- commerceEvent.shouldUploadEvent = [json[@"shouldUploadEvent"] boolValue];
451
- }
452
- if (json[@"customAttributes"] != nil) {
453
- commerceEvent.customAttributes = json[@"customAttributes"];
454
- }
455
-
456
- NSMutableArray *products = [NSMutableArray array];
457
- NSArray *jsonProducts = json[@"products"];
458
- [jsonProducts enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
459
- MPProduct *product = [RCTConvert MPProduct:obj];
460
- [products addObject:product];
461
- }];
462
- [commerceEvent addProducts:products];
463
-
464
- NSArray *jsonImpressions = json[@"impressions"];
465
- [jsonImpressions enumerateObjectsUsingBlock:^(NSDictionary *jsonImpression, NSUInteger idx, BOOL * _Nonnull stop) {
466
- NSString *listName = jsonImpression[@"impressionListName"];
467
- NSArray *jsonProducts = jsonImpression[@"products"];
468
- [jsonProducts enumerateObjectsUsingBlock:^(id _Nonnull jsonProduct, NSUInteger idx, BOOL * _Nonnull stop) {
469
- MPProduct *product = [RCTConvert MPProduct:jsonProduct];
470
- [commerceEvent addImpression:product listName:listName];
471
- }];
472
- }];
473
-
474
- return commerceEvent;
475
- }
476
-
477
- + (MPPromotionContainer *)MPPromotionContainer:(id)json {
478
- MPPromotionAction promotionAction = [json[@"promotionActionType"] intValue];
479
- MPPromotionContainer *promotionContainer = [[MPPromotionContainer alloc] initWithAction:promotionAction promotion:nil];
480
- NSArray *jsonPromotions = json[@"promotions"];
481
- [jsonPromotions enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
482
- MPPromotion *promotion = [RCTConvert MPPromotion:obj];
483
- [promotionContainer addPromotion:promotion];
484
- }];
485
-
486
- return promotionContainer;
487
- }
488
-
489
- + (MPPromotion *)MPPromotion:(id)json {
490
- MPPromotion *promotion = [[MPPromotion alloc] init];
491
- promotion.creative = json[@"creative"];
492
- promotion.name = json[@"name"];
493
- promotion.position = json[@"position"];
494
- promotion.promotionId = json[@"id"];
495
- return promotion;
496
- }
497
-
498
- + (MPTransactionAttributes *)MPTransactionAttributes:(id)json {
499
- MPTransactionAttributes *transactionAttributes = [[MPTransactionAttributes alloc] init];
500
- transactionAttributes.affiliation = json[@"affiliation"];
501
- transactionAttributes.couponCode = json[@"couponCode"];
502
- transactionAttributes.shipping = json[@"shipping"];
503
- transactionAttributes.tax = json[@"tax"];
504
- transactionAttributes.revenue = json[@"revenue"];
505
- transactionAttributes.transactionId = json[@"transactionId"];
506
- return transactionAttributes;
507
- }
508
-
509
- + (MPProduct *)MPProduct:(id)json {
510
- MPProduct *product = [[MPProduct alloc] init];
511
- product.brand = json[@"brand"];
512
- product.category = json[@"category"];
513
- product.couponCode = json[@"couponCode"];
514
- product.name = json[@"name"];
515
- product.price = json[@"price"];
516
- product.sku = json[@"sku"];
517
- product.variant = json[@"variant"];
518
- product.position = [json[@"position"] intValue];
519
- product.quantity = @([json[@"quantity"] intValue]);
520
- NSDictionary *jsonAttributes = json[@"customAttributes"];
521
- for (NSString *key in jsonAttributes) {
522
- NSString *value = jsonAttributes[key];
523
- [product setObject:value forKeyedSubscript:key];
524
- }
525
- return product;
526
- }
527
-
528
- + (MPCommerceEventAction)MPCommerceEventAction:(NSNumber *)json {
529
- int actionInt = [json intValue];
530
- MPCommerceEventAction action;
531
- switch (actionInt) {
532
- case MPReactCommerceEventActionAddToCart:
533
- action = MPCommerceEventActionAddToCart;
534
- break;
535
-
536
- case MPReactCommerceEventActionRemoveFromCart:
537
- action = MPCommerceEventActionRemoveFromCart;
538
- break;
539
-
540
- case MPReactCommerceEventActionCheckout:
541
- action = MPCommerceEventActionCheckout;
542
- break;
543
-
544
- case MPReactCommerceEventActionCheckoutOptions:
545
- action = MPCommerceEventActionCheckoutOptions;
546
- break;
547
-
548
- case MPReactCommerceEventActionClick:
549
- action = MPCommerceEventActionClick;
550
- break;
551
-
552
- case MPReactCommerceEventActionViewDetail:
553
- action = MPCommerceEventActionViewDetail;
554
- break;
555
-
556
- case MPReactCommerceEventActionPurchase:
557
- action = MPCommerceEventActionPurchase;
558
- break;
559
-
560
- case MPReactCommerceEventActionRefund:
561
- action = MPCommerceEventActionRefund;
562
- break;
563
-
564
- case MPReactCommerceEventActionAddToWishList:
565
- action = MPCommerceEventActionAddToWishList;
566
- break;
567
-
568
- case MPReactCommerceEventActionRemoveFromWishlist:
569
- action = MPCommerceEventActionRemoveFromWishlist;
570
- break;
571
-
572
- default:
573
- action = MPCommerceEventActionAddToCart;
574
- NSAssert(NO, @"Invalid commerce event action");
575
- break;
576
- }
577
- return action;
578
- }
579
-
580
- + (MPIdentityApiRequest *)MPIdentityApiRequest:(id)json {
581
- MPIdentityApiRequest *request = [MPIdentityApiRequest requestWithEmptyUser];
582
- for (NSString *key in json) {
583
- if ([key isEqualToString:@"email"]) {
584
- request.email = json[@"email"];
585
- } else if ([key isEqualToString:@"customerId"]) {
586
- request.customerId = json[@"customerId"];
587
- } else if ((key.intValue <= MPIdentityDeviceApplicationStamp) && (MPIdentityOther <= key.intValue)) {
588
- NSString *value = json[key];
589
- MPIdentity identityType = (MPIdentity)key.intValue;
590
- [request setIdentity:value identityType:identityType];
591
- } else {
592
- NSAssert(NO, @"Invalid identity request - Please only use MPIdentity keys");
593
- }
594
- }
595
- return request;
596
- }
597
-
598
- + (MPIdentityApiResult *)MPIdentityApiResult:(id)json {
599
- MPIdentityApiResult *result = [[MPIdentityApiResult alloc] init];
600
- id obj = json[@"user"];
601
- result.user = [RCTConvert MParticleUser:obj];
602
-
603
- return result;
604
- }
605
-
606
- + (MPAliasRequest *)MPAliasRequest:(id)json {
607
- NSString *destinationMpidString = json[@"destinationMpid"];
608
- NSString *sourceMpidString = json[@"sourceMpid"];
609
- NSString *startTime = json[@"startTime"];
610
- NSString *endTime = json[@"endTime"];
611
- NSNumber *destinationMpid = [NSNumber numberWithLong:destinationMpidString.longLongValue];
612
- NSNumber *sourceMpid = [NSNumber numberWithLong:sourceMpidString.longLongValue];
613
- if (startTime != nil || endTime != nil) {
614
- MParticleUser *destinationUser = [[MParticleUser alloc] init];
615
- MParticleUser *sourceUser = [[MParticleUser alloc] init];
616
- destinationUser.userId = destinationMpid;
617
- sourceUser.userId = sourceMpid;
618
- return [MPAliasRequest requestWithSourceUser:sourceUser destinationUser: destinationUser];
619
- } else {
620
- return [MPAliasRequest requestWithSourceMPID:sourceMpid destinationMPID:destinationMpid startTime:[NSDate dateWithTimeIntervalSince1970:startTime.longLongValue] endTime:[NSDate dateWithTimeIntervalSince1970:endTime.longLongValue]];
621
- }
622
- }
623
-
624
- + (MParticleUser *)MParticleUser:(id)json {
625
- MParticleUser *user = [[MParticleUser alloc] init];
626
- user.userId = json[@"userId"];
627
-
628
- return user;
629
- }
630
-
631
- + (MPEvent *)MPEvent:(id)json {
632
- MPEvent *event = [[MPEvent alloc] init];
633
-
634
- event.category = json[@"category"];
635
- event.duration = json[@"duration"];
636
- event.endTime = json[@"endTime"];
637
- event.info = json[@"info"];
638
- event.name = json[@"name"];
639
- event.startTime = json[@"startTime"];
640
- event.type = [json[@"type"] intValue];
641
- if (json[@"shouldUploadEvent"] != nil) {
642
- event.shouldUploadEvent = [json[@"shouldUploadEvent"] boolValue];
643
- }
644
-
645
- NSDictionary *jsonFlags = json[@"customFlags"];
646
- for (NSString *key in jsonFlags) {
647
- NSString *value = jsonFlags[key];
648
- [event addCustomFlag:value withKey:key];
649
- }
650
-
651
- return event;
652
- }
653
-
654
- + (MPGDPRConsent *)MPGDPRConsent:(id)json {
655
- MPGDPRConsent *mpConsent = [[MPGDPRConsent alloc] init];
656
-
657
- mpConsent.consented = [RCTConvert BOOL:json[@"consented"]];
658
- mpConsent.document = json[@"document"];
659
- mpConsent.timestamp = [RCTConvert NSDate:json[@"timestamp"]];
660
- mpConsent.location = json[@"location"];
661
- mpConsent.hardwareId = json[@"hardwareId"];
662
-
663
- return mpConsent;
664
- }
665
-
666
- + (MPCCPAConsent *)MPCCPAConsent:(id)json {
667
- MPCCPAConsent *mpConsent = [[MPCCPAConsent alloc] init];
668
-
669
- mpConsent.consented = [RCTConvert BOOL:json[@"consented"]];
670
- mpConsent.document = json[@"document"];
671
- mpConsent.timestamp = [RCTConvert NSDate:json[@"timestamp"]];
672
- mpConsent.location = json[@"location"];
673
- mpConsent.hardwareId = json[@"hardwareId"];
674
-
675
- return mpConsent;
676
- }
677
-
678
- @end
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Workspace
3
- version = "1.0">
4
- <FileRef
5
- location = "self:">
6
- </FileRef>
7
- </Workspace>
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>IDEDidComputeMac32BitWarning</key>
6
- <true/>
7
- </dict>
8
- </plist>