@ohos-ports/react-native-fbsdk-next 13.4.3-beta.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 (284) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +943 -0
  3. package/android/build.gradle +57 -0
  4. package/android/src/main/AndroidManifest.xml +46 -0
  5. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBAccessTokenModule.java +151 -0
  6. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBActivityEventListener.java +40 -0
  7. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBAppEventsLoggerModule.java +414 -0
  8. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBAppLinkModule.java +86 -0
  9. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBGameRequestDialogModule.java +94 -0
  10. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBGraphRequestModule.java +283 -0
  11. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBLoginButtonManager.java +83 -0
  12. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBLoginManagerModule.java +171 -0
  13. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBMessageDialogModule.java +111 -0
  14. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBProfileModule.java +68 -0
  15. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBSDKCallbackManagerBaseJavaModule.java +41 -0
  16. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBSDKPackage.java +60 -0
  17. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBSendButtonManager.java +51 -0
  18. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBSettingsModule.java +95 -0
  19. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBShareButtonManager.java +53 -0
  20. package/android/src/main/java/com/facebook/reactnative/androidsdk/FBShareDialogModule.java +107 -0
  21. package/android/src/main/java/com/facebook/reactnative/androidsdk/RCTLoginButton.java +126 -0
  22. package/android/src/main/java/com/facebook/reactnative/androidsdk/RCTLoginButtonEvent.java +27 -0
  23. package/android/src/main/java/com/facebook/reactnative/androidsdk/ReactNativeFacebookSDKCallback.java +58 -0
  24. package/android/src/main/java/com/facebook/reactnative/androidsdk/Utility.java +283 -0
  25. package/app.plugin.js +1 -0
  26. package/expo-module.config.json +10 -0
  27. package/ios/ExpoAdapterFBSDKNext/FacebookAppDelegate.swift +21 -0
  28. package/ios/ExpoAdapterFBSDKNext.podspec +33 -0
  29. package/ios/RCTFBSDK/core/RCTConvert+FBSDKAccessToken.h +27 -0
  30. package/ios/RCTFBSDK/core/RCTConvert+FBSDKAccessToken.m +41 -0
  31. package/ios/RCTFBSDK/core/RCTFBSDKAEMReporter.m +30 -0
  32. package/ios/RCTFBSDK/core/RCTFBSDKAccessToken.h +24 -0
  33. package/ios/RCTFBSDK/core/RCTFBSDKAccessToken.m +115 -0
  34. package/ios/RCTFBSDK/core/RCTFBSDKAppEvents.h +24 -0
  35. package/ios/RCTFBSDK/core/RCTFBSDKAppEvents.m +251 -0
  36. package/ios/RCTFBSDK/core/RCTFBSDKAppLink.h +24 -0
  37. package/ios/RCTFBSDK/core/RCTFBSDKAppLink.m +52 -0
  38. package/ios/RCTFBSDK/core/RCTFBSDKAuthenticationToken.h +6 -0
  39. package/ios/RCTFBSDK/core/RCTFBSDKAuthenticationToken.m +35 -0
  40. package/ios/RCTFBSDK/core/RCTFBSDKGraphRequestConnectionContainer.h +50 -0
  41. package/ios/RCTFBSDK/core/RCTFBSDKGraphRequestConnectionContainer.m +124 -0
  42. package/ios/RCTFBSDK/core/RCTFBSDKGraphRequestManager.h +25 -0
  43. package/ios/RCTFBSDK/core/RCTFBSDKGraphRequestManager.m +43 -0
  44. package/ios/RCTFBSDK/core/RCTFBSDKProfile.h +6 -0
  45. package/ios/RCTFBSDK/core/RCTFBSDKProfile.m +58 -0
  46. package/ios/RCTFBSDK/core/RCTFBSDKSettings.h +14 -0
  47. package/ios/RCTFBSDK/core/RCTFBSDKSettings.m +80 -0
  48. package/ios/RCTFBSDK/login/RCTConvert+FBSDKLogin.h +28 -0
  49. package/ios/RCTFBSDK/login/RCTConvert+FBSDKLogin.m +35 -0
  50. package/ios/RCTFBSDK/login/RCTFBSDKLoginButtonManager.h +25 -0
  51. package/ios/RCTFBSDK/login/RCTFBSDKLoginButtonManager.m +73 -0
  52. package/ios/RCTFBSDK/login/RCTFBSDKLoginButtonView.h +12 -0
  53. package/ios/RCTFBSDK/login/RCTFBSDKLoginButtonView.m +57 -0
  54. package/ios/RCTFBSDK/login/RCTFBSDKLoginManager.h +22 -0
  55. package/ios/RCTFBSDK/login/RCTFBSDKLoginManager.m +154 -0
  56. package/ios/RCTFBSDK/share/RCTConvert+FBSDKSharingContent.h +29 -0
  57. package/ios/RCTFBSDK/share/RCTConvert+FBSDKSharingContent.m +111 -0
  58. package/ios/RCTFBSDK/share/RCTFBSDKGameRequestDialog.h +24 -0
  59. package/ios/RCTFBSDK/share/RCTFBSDKGameRequestDialog.m +134 -0
  60. package/ios/RCTFBSDK/share/RCTFBSDKMessageDialog.h +24 -0
  61. package/ios/RCTFBSDK/share/RCTFBSDKMessageDialog.m +116 -0
  62. package/ios/RCTFBSDK/share/RCTFBSDKSendButtonManager.h +25 -0
  63. package/ios/RCTFBSDK/share/RCTFBSDKSendButtonManager.m +39 -0
  64. package/ios/RCTFBSDK/share/RCTFBSDKShareButtonManager.h +23 -0
  65. package/ios/RCTFBSDK/share/RCTFBSDKShareButtonManager.m +39 -0
  66. package/ios/RCTFBSDK/share/RCTFBSDKShareDialog.h +24 -0
  67. package/ios/RCTFBSDK/share/RCTFBSDKShareDialog.m +134 -0
  68. package/ios/RCTFBSDK/share/RCTFBSDKShareHelper.h +21 -0
  69. package/ios/RCTFBSDK/share/RCTFBSDKShareHelper.m +32 -0
  70. package/ios/RCTFBSDK.xcodeproj/project.pbxproj +446 -0
  71. package/ios/RCTFBSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  72. package/ios/RCTFBSDK.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  73. package/jest/mocks/index.js +81 -0
  74. package/jest/setup.js +3 -0
  75. package/lib/commonjs/FBAEMReporter.js +39 -0
  76. package/lib/commonjs/FBAEMReporter.js.map +1 -0
  77. package/lib/commonjs/FBAccessToken.js +198 -0
  78. package/lib/commonjs/FBAccessToken.js.map +1 -0
  79. package/lib/commonjs/FBAppEventsLogger.js +221 -0
  80. package/lib/commonjs/FBAppEventsLogger.js.map +1 -0
  81. package/lib/commonjs/FBAppLink.js +36 -0
  82. package/lib/commonjs/FBAppLink.js.map +1 -0
  83. package/lib/commonjs/FBAuthenticationToken.js +55 -0
  84. package/lib/commonjs/FBAuthenticationToken.js.map +1 -0
  85. package/lib/commonjs/FBGameRequestDialog.js +45 -0
  86. package/lib/commonjs/FBGameRequestDialog.js.map +1 -0
  87. package/lib/commonjs/FBGraphRequest.js +66 -0
  88. package/lib/commonjs/FBGraphRequest.js.map +1 -0
  89. package/lib/commonjs/FBGraphRequestManager.js +96 -0
  90. package/lib/commonjs/FBGraphRequestManager.js.map +1 -0
  91. package/lib/commonjs/FBLoginButton.js +67 -0
  92. package/lib/commonjs/FBLoginButton.js.map +1 -0
  93. package/lib/commonjs/FBLoginManager.js +102 -0
  94. package/lib/commonjs/FBLoginManager.js.map +1 -0
  95. package/lib/commonjs/FBMessageDialog.js +51 -0
  96. package/lib/commonjs/FBMessageDialog.js.map +1 -0
  97. package/lib/commonjs/FBProfile.js +134 -0
  98. package/lib/commonjs/FBProfile.js.map +1 -0
  99. package/lib/commonjs/FBSendButton.js +48 -0
  100. package/lib/commonjs/FBSendButton.js.map +1 -0
  101. package/lib/commonjs/FBSettings.js +115 -0
  102. package/lib/commonjs/FBSettings.js.map +1 -0
  103. package/lib/commonjs/FBShareButton.js +48 -0
  104. package/lib/commonjs/FBShareButton.js.map +1 -0
  105. package/lib/commonjs/FBShareDialog.js +57 -0
  106. package/lib/commonjs/FBShareDialog.js.map +1 -0
  107. package/lib/commonjs/index.js +323 -0
  108. package/lib/commonjs/index.js.map +1 -0
  109. package/lib/commonjs/models/FBAppGroupCreationContent.js +2 -0
  110. package/lib/commonjs/models/FBAppGroupCreationContent.js.map +1 -0
  111. package/lib/commonjs/models/FBGameRequestContent.js +2 -0
  112. package/lib/commonjs/models/FBGameRequestContent.js.map +1 -0
  113. package/lib/commonjs/models/FBSDKCallback.js +2 -0
  114. package/lib/commonjs/models/FBSDKCallback.js.map +1 -0
  115. package/lib/commonjs/models/FBShareContent.js +6 -0
  116. package/lib/commonjs/models/FBShareContent.js.map +1 -0
  117. package/lib/commonjs/models/FBShareLinkContent.js +6 -0
  118. package/lib/commonjs/models/FBShareLinkContent.js.map +1 -0
  119. package/lib/commonjs/models/FBSharePhoto.js +2 -0
  120. package/lib/commonjs/models/FBSharePhoto.js.map +1 -0
  121. package/lib/commonjs/models/FBSharePhotoContent.js +6 -0
  122. package/lib/commonjs/models/FBSharePhotoContent.js.map +1 -0
  123. package/lib/commonjs/models/FBShareVideo.js +2 -0
  124. package/lib/commonjs/models/FBShareVideo.js.map +1 -0
  125. package/lib/commonjs/models/FBShareVideoContent.js +6 -0
  126. package/lib/commonjs/models/FBShareVideoContent.js.map +1 -0
  127. package/lib/commonjs/util/validate.js +180 -0
  128. package/lib/commonjs/util/validate.js.map +1 -0
  129. package/lib/commonjs/utils/index.js +2 -0
  130. package/lib/commonjs/utils/index.js.map +1 -0
  131. package/lib/module/FBAEMReporter.js +34 -0
  132. package/lib/module/FBAEMReporter.js.map +1 -0
  133. package/lib/module/FBAccessToken.js +191 -0
  134. package/lib/module/FBAccessToken.js.map +1 -0
  135. package/lib/module/FBAppEventsLogger.js +215 -0
  136. package/lib/module/FBAppEventsLogger.js.map +1 -0
  137. package/lib/module/FBAppLink.js +29 -0
  138. package/lib/module/FBAppLink.js.map +1 -0
  139. package/lib/module/FBAuthenticationToken.js +48 -0
  140. package/lib/module/FBAuthenticationToken.js.map +1 -0
  141. package/lib/module/FBGameRequestDialog.js +39 -0
  142. package/lib/module/FBGameRequestDialog.js.map +1 -0
  143. package/lib/module/FBGraphRequest.js +60 -0
  144. package/lib/module/FBGraphRequest.js.map +1 -0
  145. package/lib/module/FBGraphRequestManager.js +90 -0
  146. package/lib/module/FBGraphRequestManager.js.map +1 -0
  147. package/lib/module/FBLoginButton.js +62 -0
  148. package/lib/module/FBLoginButton.js.map +1 -0
  149. package/lib/module/FBLoginManager.js +97 -0
  150. package/lib/module/FBLoginManager.js.map +1 -0
  151. package/lib/module/FBMessageDialog.js +45 -0
  152. package/lib/module/FBMessageDialog.js.map +1 -0
  153. package/lib/module/FBProfile.js +127 -0
  154. package/lib/module/FBProfile.js.map +1 -0
  155. package/lib/module/FBSendButton.js +41 -0
  156. package/lib/module/FBSendButton.js.map +1 -0
  157. package/lib/module/FBSettings.js +108 -0
  158. package/lib/module/FBSettings.js.map +1 -0
  159. package/lib/module/FBShareButton.js +41 -0
  160. package/lib/module/FBShareButton.js.map +1 -0
  161. package/lib/module/FBShareDialog.js +51 -0
  162. package/lib/module/FBShareDialog.js.map +1 -0
  163. package/lib/module/index.js +44 -0
  164. package/lib/module/index.js.map +1 -0
  165. package/lib/module/models/FBAppGroupCreationContent.js +2 -0
  166. package/lib/module/models/FBAppGroupCreationContent.js.map +1 -0
  167. package/lib/module/models/FBGameRequestContent.js +2 -0
  168. package/lib/module/models/FBGameRequestContent.js.map +1 -0
  169. package/lib/module/models/FBSDKCallback.js +2 -0
  170. package/lib/module/models/FBSDKCallback.js.map +1 -0
  171. package/lib/module/models/FBShareContent.js +2 -0
  172. package/lib/module/models/FBShareContent.js.map +1 -0
  173. package/lib/module/models/FBShareLinkContent.js +2 -0
  174. package/lib/module/models/FBShareLinkContent.js.map +1 -0
  175. package/lib/module/models/FBSharePhoto.js +2 -0
  176. package/lib/module/models/FBSharePhoto.js.map +1 -0
  177. package/lib/module/models/FBSharePhotoContent.js +2 -0
  178. package/lib/module/models/FBSharePhotoContent.js.map +1 -0
  179. package/lib/module/models/FBShareVideo.js +2 -0
  180. package/lib/module/models/FBShareVideo.js.map +1 -0
  181. package/lib/module/models/FBShareVideoContent.js +2 -0
  182. package/lib/module/models/FBShareVideoContent.js.map +1 -0
  183. package/lib/module/util/validate.js +157 -0
  184. package/lib/module/util/validate.js.map +1 -0
  185. package/lib/module/utils/index.js +2 -0
  186. package/lib/module/utils/index.js.map +1 -0
  187. package/lib/typescript/FBAEMReporter.d.ts +21 -0
  188. package/lib/typescript/FBAEMReporter.d.ts.map +1 -0
  189. package/lib/typescript/FBAccessToken.d.ts +118 -0
  190. package/lib/typescript/FBAccessToken.d.ts.map +1 -0
  191. package/lib/typescript/FBAppEventsLogger.d.ts +201 -0
  192. package/lib/typescript/FBAppEventsLogger.d.ts.map +1 -0
  193. package/lib/typescript/FBAppLink.d.ts +5 -0
  194. package/lib/typescript/FBAppLink.d.ts.map +1 -0
  195. package/lib/typescript/FBAuthenticationToken.d.ts +29 -0
  196. package/lib/typescript/FBAuthenticationToken.d.ts.map +1 -0
  197. package/lib/typescript/FBGameRequestDialog.d.ts +39 -0
  198. package/lib/typescript/FBGameRequestDialog.d.ts.map +1 -0
  199. package/lib/typescript/FBGraphRequest.d.ts +70 -0
  200. package/lib/typescript/FBGraphRequest.d.ts.map +1 -0
  201. package/lib/typescript/FBGraphRequestManager.d.ts +51 -0
  202. package/lib/typescript/FBGraphRequestManager.d.ts.map +1 -0
  203. package/lib/typescript/FBLoginButton.d.ts +92 -0
  204. package/lib/typescript/FBLoginButton.d.ts.map +1 -0
  205. package/lib/typescript/FBLoginManager.d.ts +77 -0
  206. package/lib/typescript/FBLoginManager.d.ts.map +1 -0
  207. package/lib/typescript/FBMessageDialog.d.ts +42 -0
  208. package/lib/typescript/FBMessageDialog.d.ts.map +1 -0
  209. package/lib/typescript/FBProfile.d.ts +127 -0
  210. package/lib/typescript/FBProfile.d.ts.map +1 -0
  211. package/lib/typescript/FBSendButton.d.ts +42 -0
  212. package/lib/typescript/FBSendButton.d.ts.map +1 -0
  213. package/lib/typescript/FBSettings.d.ts +49 -0
  214. package/lib/typescript/FBSettings.d.ts.map +1 -0
  215. package/lib/typescript/FBShareButton.d.ts +42 -0
  216. package/lib/typescript/FBShareButton.d.ts.map +1 -0
  217. package/lib/typescript/FBShareDialog.d.ts +69 -0
  218. package/lib/typescript/FBShareDialog.d.ts.map +1 -0
  219. package/lib/typescript/index.d.ts +43 -0
  220. package/lib/typescript/index.d.ts.map +1 -0
  221. package/lib/typescript/models/FBAppGroupCreationContent.d.ts +43 -0
  222. package/lib/typescript/models/FBAppGroupCreationContent.d.ts.map +1 -0
  223. package/lib/typescript/models/FBGameRequestContent.d.ts +63 -0
  224. package/lib/typescript/models/FBGameRequestContent.d.ts.map +1 -0
  225. package/lib/typescript/models/FBSDKCallback.d.ts +4 -0
  226. package/lib/typescript/models/FBSDKCallback.d.ts.map +1 -0
  227. package/lib/typescript/models/FBShareContent.d.ts +48 -0
  228. package/lib/typescript/models/FBShareContent.d.ts.map +1 -0
  229. package/lib/typescript/models/FBShareLinkContent.d.ts +65 -0
  230. package/lib/typescript/models/FBShareLinkContent.d.ts.map +1 -0
  231. package/lib/typescript/models/FBSharePhoto.d.ts +43 -0
  232. package/lib/typescript/models/FBSharePhoto.d.ts.map +1 -0
  233. package/lib/typescript/models/FBSharePhotoContent.d.ts +45 -0
  234. package/lib/typescript/models/FBSharePhotoContent.d.ts.map +1 -0
  235. package/lib/typescript/models/FBShareVideo.d.ts +31 -0
  236. package/lib/typescript/models/FBShareVideo.d.ts.map +1 -0
  237. package/lib/typescript/models/FBShareVideoContent.d.ts +58 -0
  238. package/lib/typescript/models/FBShareVideoContent.d.ts.map +1 -0
  239. package/lib/typescript/util/validate.d.ts +62 -0
  240. package/lib/typescript/util/validate.d.ts.map +1 -0
  241. package/lib/typescript/utils/index.d.ts +2 -0
  242. package/lib/typescript/utils/index.d.ts.map +1 -0
  243. package/package.json +155 -0
  244. package/plugin/build/config.d.ts +53 -0
  245. package/plugin/build/config.js +46 -0
  246. package/plugin/build/withFacebook.d.ts +4 -0
  247. package/plugin/build/withFacebook.js +59 -0
  248. package/plugin/build/withFacebookAndroid.d.ts +6 -0
  249. package/plugin/build/withFacebookAndroid.js +197 -0
  250. package/plugin/build/withFacebookIOS.d.ts +15 -0
  251. package/plugin/build/withFacebookIOS.js +163 -0
  252. package/plugin/build/withSKAdNetworkIdentifiers.d.ts +9 -0
  253. package/plugin/build/withSKAdNetworkIdentifiers.js +36 -0
  254. package/plugin/tsconfig.json +9 -0
  255. package/react-native-fbsdk-next.podspec +34 -0
  256. package/src/FBAEMReporter.ts +44 -0
  257. package/src/FBAccessToken.ts +222 -0
  258. package/src/FBAppEventsLogger.ts +375 -0
  259. package/src/FBAppLink.ts +30 -0
  260. package/src/FBAuthenticationToken.ts +61 -0
  261. package/src/FBGameRequestDialog.ts +49 -0
  262. package/src/FBGraphRequest.ts +89 -0
  263. package/src/FBGraphRequestManager.ts +117 -0
  264. package/src/FBLoginButton.tsx +152 -0
  265. package/src/FBLoginManager.ts +133 -0
  266. package/src/FBMessageDialog.ts +53 -0
  267. package/src/FBProfile.ts +166 -0
  268. package/src/FBSendButton.tsx +61 -0
  269. package/src/FBSettings.ts +122 -0
  270. package/src/FBShareButton.tsx +61 -0
  271. package/src/FBShareDialog.ts +96 -0
  272. package/src/index.ts +85 -0
  273. package/src/models/FBAppGroupCreationContent.ts +48 -0
  274. package/src/models/FBGameRequestContent.ts +81 -0
  275. package/src/models/FBSDKCallback.ts +3 -0
  276. package/src/models/FBShareContent.ts +54 -0
  277. package/src/models/FBShareLinkContent.ts +71 -0
  278. package/src/models/FBSharePhoto.ts +45 -0
  279. package/src/models/FBSharePhotoContent.ts +48 -0
  280. package/src/models/FBShareVideo.ts +31 -0
  281. package/src/models/FBShareVideoContent.ts +64 -0
  282. package/src/util/validate.ts +167 -0
  283. package/src/utils/index.ts +1 -0
  284. package/tsconfig.json +103 -0
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isAlphaNumericUnderscore = isAlphaNumericUnderscore;
7
+ exports.isArray = isArray;
8
+ exports.isBoolean = isBoolean;
9
+ exports.isDate = isDate;
10
+ exports.isDefined = isDefined;
11
+ exports.isFinite = isFinite;
12
+ exports.isFunction = isFunction;
13
+ exports.isInteger = isInteger;
14
+ exports.isNull = isNull;
15
+ exports.isNumber = isNumber;
16
+ exports.isObject = isObject;
17
+ exports.isOneOf = isOneOf;
18
+ exports.isString = isString;
19
+ exports.isUndefined = isUndefined;
20
+ exports.isValidGraphAPIVersion = isValidGraphAPIVersion;
21
+ exports.isValidUrl = isValidUrl;
22
+ exports.noop = noop;
23
+ exports.objectKeyValuesAreStrings = objectKeyValuesAreStrings;
24
+ /**
25
+ * Copyright (c) 2016-present Invertase Limited & Contributors
26
+ *
27
+ * Licensed under the Apache License, Version 2.0 (the "License");
28
+ * you may not use this library except in compliance with the License.
29
+ * You may obtain a copy of the License at
30
+ *
31
+ * http://www.apache.org/licenses/LICENSE-2.0
32
+ *
33
+ * Unless required by applicable law or agreed to in writing, software
34
+ * distributed under the License is distributed on an "AS IS" BASIS,
35
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36
+ * See the License for the specific language governing permissions and
37
+ * limitations under the License.
38
+ *
39
+ * Taken from react-native-firebase: https://github.com/invertase/react-native-firebase/blob/master/packages/app/lib/common/validate.js
40
+ *
41
+ * @format
42
+ */
43
+ const AlphaNumericUnderscore = /^[a-zA-Z0-9_]+$/;
44
+ function objectKeyValuesAreStrings(object) {
45
+ if (!isObject(object)) {
46
+ return false;
47
+ }
48
+ const entries = Object.entries(object);
49
+ for (let i = 0; i < entries.length; i++) {
50
+ const [key, value] = entries[i];
51
+ if (!isString(key) || !isString(value)) {
52
+ return false;
53
+ }
54
+ }
55
+ return true;
56
+ }
57
+
58
+ /**
59
+ * Simple is null check.
60
+ */
61
+ function isNull(value) {
62
+ return value === null;
63
+ }
64
+
65
+ /**
66
+ * Simple is object check.
67
+ */
68
+ function isObject(value) {
69
+ return value ? typeof value === 'object' && !Array.isArray(value) && !isNull(value) : false;
70
+ }
71
+
72
+ /**
73
+ * Simple is date check
74
+ * https://stackoverflow.com/a/44198641
75
+ */
76
+ function isDate(value) {
77
+ // use the global isNaN() and not Number.isNaN() since it will validate an Invalid Date
78
+ return !!value && Object.prototype.toString.call(value) === '[object Date]' && !isNaN(Number(value));
79
+ }
80
+
81
+ /**
82
+ * Simple is function check
83
+ */
84
+ // eslint-disable-next-line @typescript-eslint/ban-types
85
+ function isFunction(value) {
86
+ return value ? typeof value === 'function' : false;
87
+ }
88
+
89
+ /**
90
+ * Simple is string check
91
+ */
92
+ function isString(value) {
93
+ return typeof value === 'string';
94
+ }
95
+
96
+ /**
97
+ * Simple is number check
98
+ */
99
+ function isNumber(value) {
100
+ return typeof value === 'number';
101
+ }
102
+
103
+ /**
104
+ * Simple finite check
105
+ */
106
+ function isFinite(value) {
107
+ return Number.isFinite(value);
108
+ }
109
+
110
+ /**
111
+ * Simple integer check
112
+ */
113
+ function isInteger(value) {
114
+ return Number.isInteger(value);
115
+ }
116
+
117
+ /**
118
+ * Simple is boolean check
119
+ */
120
+ function isBoolean(value) {
121
+ return typeof value === 'boolean';
122
+ }
123
+
124
+ /**
125
+ * Simple is array check
126
+ */
127
+ function isArray(value) {
128
+ return Array.isArray(value);
129
+ }
130
+
131
+ /**
132
+ * Simple is undefined check
133
+ */
134
+ function isUndefined(value) {
135
+ return typeof value === 'undefined';
136
+ }
137
+
138
+ /**
139
+ * Simple is not null nor undefined check
140
+ */
141
+ function isDefined(value) {
142
+ return !isNull(value) && !isUndefined(value);
143
+ }
144
+
145
+ /**
146
+ * /^[a-zA-Z0-9_]+$/
147
+ */
148
+ function isAlphaNumericUnderscore(value) {
149
+ return AlphaNumericUnderscore.test(value);
150
+ }
151
+
152
+ /**
153
+ * URL test
154
+ */
155
+ const IS_VALID_URL_REGEX = /^(http|https):\/\/[^ "]+$/;
156
+ function isValidUrl(url) {
157
+ return IS_VALID_URL_REGEX.test(url);
158
+ }
159
+
160
+ /**
161
+ * Matches Graph API versions of the form v2.7
162
+ */
163
+ const IS_VALID_GRAPH_API_VERSION = /^(v([0-9]+).([0-9]+))/;
164
+ function isValidGraphAPIVersion(version) {
165
+ return IS_VALID_GRAPH_API_VERSION.test(version);
166
+ }
167
+
168
+ /**
169
+ * Array includes
170
+ */
171
+ function isOneOf(value, oneOf = []) {
172
+ if (!isArray(oneOf)) {
173
+ return false;
174
+ }
175
+ return oneOf.includes(value);
176
+ }
177
+ function noop() {
178
+ // noop-🐈
179
+ }
180
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AlphaNumericUnderscore","objectKeyValuesAreStrings","object","isObject","entries","Object","i","length","key","value","isString","isNull","Array","isArray","isDate","prototype","toString","call","isNaN","Number","isFunction","isNumber","isFinite","isInteger","isBoolean","isUndefined","isDefined","isAlphaNumericUnderscore","test","IS_VALID_URL_REGEX","isValidUrl","url","IS_VALID_GRAPH_API_VERSION","isValidGraphAPIVersion","version","isOneOf","oneOf","includes","noop"],"sourceRoot":"../../../src","sources":["util/validate.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,sBAAsB,GAAG,iBAAiB;AAEzC,SAASC,yBAAyBA,CAACC,MAAc,EAAE;EACxD,IAAI,CAACC,QAAQ,CAACD,MAAM,CAAC,EAAE;IACrB,OAAO,KAAK;EACd;EAEA,MAAME,OAAO,GAAGC,MAAM,CAACD,OAAO,CAACF,MAAM,CAAC;EAEtC,KAAK,IAAII,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,OAAO,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;IACvC,MAAM,CAACE,GAAG,EAAEC,KAAK,CAAC,GA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,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * This source code is licensed under the license found in the
3
+ * LICENSE file in the root directory of this source tree.
4
+ *
5
+ * @format
6
+ */
7
+ import { NativeModules, Platform } from 'react-native';
8
+
9
+ /**
10
+ * Aggregated Event Measurement (AEM) for iOS apps allows for the measurement of app events
11
+ * from iOS 14.5+ users who have opted out of app tracking.
12
+ *
13
+ * @ref https://developers.facebook.com/docs/app-events/guides/aggregated-event-measurement/
14
+ */
15
+ export default {
16
+ /**
17
+ * Log AEM event, event names for AEM must match event names you used in app event logging.
18
+ *
19
+ * *This method will bypass if platform isn't iOS*
20
+ *
21
+ * **Make sure you also handle the DeepLink URL with AEM**
22
+ *
23
+ * @ref https://developers.facebook.com/docs/app-events/guides/aggregated-event-measurement/
24
+ * @platform iOS
25
+ */
26
+ logAEMEvent: (eventName, value, currency, otherParameters) => {
27
+ // AEM is currently only for iOS
28
+ if (Platform.OS !== 'ios') {
29
+ return;
30
+ }
31
+ NativeModules.FBSDKAEMReporter.recordAndUpdateEvent(eventName, value, currency, otherParameters);
32
+ }
33
+ };
34
+ //# sourceMappingURL=FBAEMReporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","Platform","logAEMEvent","eventName","value","currency","otherParameters","OS","FBSDKAEMReporter","recordAndUpdateEvent"],"sourceRoot":"../../src","sources":["FBAEMReporter.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQA,aAAa,EAAEC,QAAQ,QAAO,cAAc;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;EACb;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAW,EAAEA,CACXC,SAAiB,EACjBC,KAAa,EACbC,QAAiB,EACjBC,eAAiD,KAC9C;IACH;IACA,IAAIL,QAAQ,CAACM,EAAE,KAAK,KAAK,EAAE;MACzB;IACF;IAEAP,aAAa,CAACQ,gBAAgB,CAACC,oBAAoB,CACjDN,SAAS,EACTC,KAAK,EACLC,QAAQ,EACRC,eACF,CAAC;EACH;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
3
+ *
4
+ * You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
5
+ * copy, modify, and distribute this software in source code or binary form for use
6
+ * in connection with the web services and APIs provided by Facebook.
7
+ *
8
+ * As with any software that integrates with the Facebook platform, your use of
9
+ * this software is subject to the Facebook Developer Principles and Policies
10
+ * [http://developers.facebook.com/policy/]. This copyright notice shall be
11
+ * included in all copies or substantial portions of the software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
+ *
20
+ * @format
21
+ */
22
+ import { NativeModules, NativeEventEmitter } from 'react-native';
23
+ const AccessToken = NativeModules.FBAccessToken;
24
+ const eventEmitter = new NativeEventEmitter(AccessToken);
25
+ /**
26
+ * Represents an immutable access token for using Facebook services.
27
+ */
28
+ class FBAccessToken {
29
+ /**
30
+ * The access token string.
31
+ */
32
+
33
+ /**
34
+ * The known granted permissions.
35
+ */
36
+
37
+ /**
38
+ * The known declined permissions.
39
+ */
40
+
41
+ /**
42
+ * The known expired permissions.
43
+ */
44
+
45
+ /**
46
+ * The app ID.
47
+ */
48
+
49
+ /**
50
+ * The user ID.
51
+ */
52
+
53
+ /**
54
+ * The expiration time of the access token.
55
+ * The value is the number of milliseconds since Jan. 1, 1970, midnight GMT.
56
+ */
57
+
58
+ /**
59
+ * The last refresh time of the access token.
60
+ * The value is the number of milliseconds since Jan. 1, 1970, midnight GMT.
61
+ */
62
+
63
+ /**
64
+ * The data access expiration time of the access token.
65
+ * The value is the number of milliseconds since Jan. 1, 1970, midnight GMT.
66
+ */
67
+
68
+ /**
69
+ * The source of access token.
70
+ * @platform android
71
+ */
72
+
73
+ constructor(tokenMap) {
74
+ this.accessToken = tokenMap.accessToken;
75
+ this.permissions = tokenMap.permissions;
76
+ this.declinedPermissions = tokenMap.declinedPermissions;
77
+ this.expiredPermissions = tokenMap.expiredPermissions;
78
+ this.applicationID = tokenMap.applicationID;
79
+ this.userID = tokenMap.userID;
80
+ this.expirationTime = tokenMap.expirationTime;
81
+ this.lastRefreshTime = tokenMap.lastRefreshTime;
82
+ this.dataAccessExpirationTime = tokenMap.dataAccessExpirationTime;
83
+ this.accessTokenSource = tokenMap.accessTokenSource;
84
+ Object.freeze(this);
85
+ }
86
+
87
+ /**
88
+ * Getter for the access token that is current for the application.
89
+ */
90
+ static getCurrentAccessToken() {
91
+ return new Promise(resolve => {
92
+ AccessToken.getCurrentAccessToken(tokenMap => {
93
+ if (tokenMap) {
94
+ resolve(new FBAccessToken(tokenMap));
95
+ } else {
96
+ resolve(null);
97
+ }
98
+ });
99
+ });
100
+ }
101
+
102
+ /**
103
+ * Setter for the access token that is current for the application.
104
+ */
105
+ static setCurrentAccessToken(accessToken) {
106
+ AccessToken.setCurrentAccessToken(accessToken);
107
+ }
108
+
109
+ /**
110
+ * Updates the current access token with up to date permissions,
111
+ * and extends the expiration date, if extension is possible.
112
+ */
113
+ static refreshCurrentAccessTokenAsync() {
114
+ return AccessToken.refreshCurrentAccessTokenAsync();
115
+ }
116
+
117
+ /**
118
+ * Adds a listener for when the access token changes. Returns a functions which removes the
119
+ * listener when called.
120
+ */
121
+ static addListener(listener) {
122
+ const subscription = eventEmitter.addListener('fbsdk.accessTokenDidChange', tokenMap => {
123
+ if (tokenMap) {
124
+ listener(new FBAccessToken(tokenMap));
125
+ } else {
126
+ listener(null);
127
+ }
128
+ });
129
+ return () => subscription.remove();
130
+ }
131
+
132
+ /**
133
+ * Gets the date at which the access token expires. The value is the number of
134
+ * milliseconds since Jan. 1, 1970, midnight GMT.
135
+ */
136
+ getExpires() {
137
+ return this.expirationTime;
138
+ }
139
+
140
+ /**
141
+ * Get the list of permissions associated with this access token. Note that the most up-to-date
142
+ * list of permissions is maintained by Facebook, so this list may be outdated if permissions
143
+ * have been added or removed since the time the AccessToken object was created. See
144
+ * https://developers.facebook.com/docs/reference/login/#permissions for details.
145
+ */
146
+ getPermissions() {
147
+ return this.permissions;
148
+ }
149
+
150
+ /**
151
+ * Gets the list of permissions declined by the user with this access token. It represents the
152
+ * entire set of permissions that have been requested and declined. Note that the most
153
+ * up-to-date list of permissions is maintained by Facebook, so this list may be outdated if
154
+ * permissions have been granted or declined since the last time an AccessToken object was
155
+ * created. See https://developers.facebook.com/docs/reference/login/#permissions for details.
156
+ */
157
+ getDeclinedPermissions() {
158
+ return this.declinedPermissions;
159
+ }
160
+ getExpiredPermissions() {
161
+ return this.expiredPermissions;
162
+ }
163
+
164
+ /**
165
+ * Gets the date at which the token was last refreshed. Since tokens expire, the Facebook SDK
166
+ * will attempt to renew them periodically. The value is the number of milliseconds since
167
+ * Jan. 1, 1970, midnight GMT.
168
+ */
169
+ getLastRefresh() {
170
+ return this.lastRefreshTime;
171
+ }
172
+ getDataAccessExpiration() {
173
+ return this.dataAccessExpirationTime;
174
+ }
175
+
176
+ /**
177
+ * Gets the ID of the Facebook Application associated with this access token.
178
+ */
179
+ getApplicationId() {
180
+ return this.applicationID;
181
+ }
182
+
183
+ /**
184
+ * Gets user ID associated with this access token.
185
+ */
186
+ getUserId() {
187
+ return this.userID;
188
+ }
189
+ }
190
+ export default FBAccessToken;
191
+ //# sourceMappingURL=FBAccessToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","NativeEventEmitter","AccessToken","FBAccessToken","eventEmitter","constructor","tokenMap","accessToken","permissions","declinedPermissions","expiredPermissions","applicationID","userID","expirationTime","lastRefreshTime","dataAccessExpirationTime","accessTokenSource","Object","freeze","getCurrentAccessToken","Promise","resolve","setCurrentAccessToken","refreshCurrentAccessTokenAsync","addListener","listener","subscription","remove","getExpires","getPermissions","getDeclinedPermissions","getExpiredPermissions","getLastRefresh","getDataAccessExpiration","getApplicationId","getUserId"],"sourceRoot":"../../src","sources":["FBAccessToken.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQA,aAAa,EAAEC,kBAAkB,QAAO,cAAc;AAE9D,MAAMC,WAAW,GAAGF,aAAa,CAACG,aAAa;AAE/C,MAAMC,YAAY,GAAG,IAAIH,kBAAkB,CAACC,WAAW,CAAC;AAexD;AACA;AACA;AACA,MAAMC,aAAa,CAAC;EAClB;AACF;AACA;;EAGE;AACF;AACA;;EAGE;AACF;AACA;;EAGE;AACF;AACA;;EAGE;AACF;AACA;;EAGE;AACF;AACA;;EAGE;AACF;AACA;AACA;;EAGE;AACF;AACA;AACA;;EAGE;AACF;AACA;AACA;;EAGE;AACF;AACA;AACA;;EAGEE,WAAWA,CAACC,QAAwB,EAAE;IACpC,IAAI,CAACC,WAAW,GAAGD,QAAQ,CAACC,WAAW;IACvC,IAAI,CAACC,WAAW,GAAGF,QAAQ,CAACE,WAAW;IACvC,IAAI,CAACC,mBAAmB,GAAGH,QAAQ,CAACG,mBAAmB;IACvD,IAAI,CAACC,kBAAkB,GAAGJ,QAAQ,CAACI,kBAAkB;IACrD,IAAI,CAACC,aAAa,GAAGL,QAAQ,CAACK,aAAa;IAC3C,IAAI,CAACC,MAAM,GAAGN,Q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A,EAAG;IACX,OAAO,IAAI,CAACf,cAAc;EAC5B;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEgB,cAAcA,CAAA,EAAG;IACf,OAAO,IAAI,CAACrB,WAAW;EACzB;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEsB,sBAAsBA,CAAA,EAAG;IACvB,OAAO,IAAI,CAACrB,mBAAmB;EACjC;EAEAsB,qBAAqBA,CAAA,EAAG;IACtB,OAAO,IAAI,CAACrB,kBAAkB;EAChC;;EAEA;AACF;AACA;AACA;AACA;EACEsB,cAAcA,CAAA,EAAG;IACf,OAAO,IAAI,CAAClB,eAAe;EAC7B;EAEAmB,uBAAuBA,CAAA,EAAG;IACxB,OAAO,IAAI,CAAClB,wBAAwB;EACtC;;EAEA;AACF;AACA;EACEmB,gBAAgBA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACvB,aAAa;EAC3B;;EAEA;AACF;AACA;EACEwB,SAASA,CAAA,EAAG;IACV,OAAO,IAAI,CAACvB,MAAM;EACpB;AACF;AAEA,eAAeT,aAAa","ignoreList":[]}
@@ -0,0 +1,215 @@
1
+ /**
2
+ * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
3
+ *
4
+ * You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
5
+ * copy, modify, and distribute this software in source code or binary form for use
6
+ * in connection with the web services and APIs provided by Facebook.
7
+ *
8
+ * As with any software that integrates with the Facebook platform, your use of
9
+ * this software is subject to the Facebook Developer Principles and Policies
10
+ * [http://developers.facebook.com/policy/]. This copyright notice shall be
11
+ * included in all copies or substantial portions of the software.
12
+ *
13
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
+ *
20
+ * @format
21
+ */
22
+ import { isDefined, isNumber, isOneOf, isString } from './util/validate';
23
+ import { NativeModules } from 'react-native';
24
+ import { Platform } from 'react-native';
25
+ const AppEventsLogger = NativeModules.FBAppEventsLogger;
26
+
27
+ /**
28
+ * Controls when an AppEventsLogger sends log events to the server
29
+ */
30
+
31
+ /**
32
+ * Specifies product availability for Product Catalog product item update
33
+ */
34
+
35
+ /**
36
+ * Specifies product condition for Product Catalog product item update
37
+ */
38
+
39
+ /**
40
+ * Info about a user to increase chances of matching a Facebook user.
41
+ * See https://developers.facebook.com/docs/app-events/advanced-matching for
42
+ * more info about the expected format of each field.
43
+ */
44
+
45
+ const {
46
+ AppEvents,
47
+ AppEventParams
48
+ } = AppEventsLogger?.getConstants() || {};
49
+ export default {
50
+ /**
51
+ * Sets the current event flushing behavior specifying when events
52
+ * are sent back to Facebook servers.
53
+ */
54
+ setFlushBehavior(flushBehavior) {
55
+ AppEventsLogger.setFlushBehavior(flushBehavior);
56
+ },
57
+ /**
58
+ * Logs an event with eventName and optional arguments.
59
+ * This function supports the following usage:
60
+ * logEvent(eventName: string);
61
+ * logEvent(eventName: string, valueToSum: number);
62
+ * logEvent(eventName: string, parameters: {[key:string]:string|number});
63
+ * logEvent(eventName: string, valueToSum: number, parameters: {[key:string]:string|number});
64
+ * See https://developers.facebook.com/docs/app-events/android for detail.
65
+ */
66
+ logEvent(eventName, ...args) {
67
+ let valueToSum = 0;
68
+ if (typeof args[0] === 'number') {
69
+ valueToSum = Number(args.shift());
70
+ }
71
+ let parameters = null;
72
+ if (typeof args[0] === 'object') {
73
+ parameters = args[0];
74
+ }
75
+ AppEventsLogger.logEvent(eventName, valueToSum, parameters);
76
+ },
77
+ /**
78
+ * Logs a purchase. See http://en.wikipedia.org/wiki/ISO_4217 for currencyCode.
79
+ */
80
+ logPurchase(purchaseAmount, currencyCode, parameters) {
81
+ AppEventsLogger.logPurchase(purchaseAmount, currencyCode, parameters);
82
+ },
83
+ /**
84
+ * Logs an app event that tracks that the application was open via Push Notification.
85
+ */
86
+ logPushNotificationOpen(payload) {
87
+ AppEventsLogger.logPushNotificationOpen(payload);
88
+ },
89
+ /**
90
+ * Uploads product catalog product item as an app event
91
+ * @param itemID – Unique ID for the item. Can be a variant for a product. Max size is 100.
92
+ * @param availability – If item is in stock. Accepted values are: in stock - Item ships immediately out of stock - No plan to restock preorder - Available in future available for order - Ships in 1-2 weeks discontinued - Discontinued
93
+ * @param condition – Product condition: new, refurbished or used.
94
+ * @param description – Short text describing product. Max size is 5000.
95
+ * @param imageLink – Link to item image used in ad.
96
+ * @param link – Link to merchant's site where someone can buy the item.
97
+ * @param title – Title of item.
98
+ * @param priceAmount – Amount of purchase, in the currency specified by the 'currency' parameter. This value will be rounded to the thousandths place (e.g., 12.34567 becomes 12.346).
99
+ * @param currency – Currency used to specify the amount.
100
+ * @param gtin – Global Trade Item Number including UPC, EAN, JAN and ISBN
101
+ * @param mpn – Unique manufacture ID for product
102
+ * @param brand – Name of the brand Note: Either gtin, mpn or brand is required.
103
+ * @param parameters – Optional fields for deep link specification.
104
+ */
105
+ logProductItem(itemID, availability, condition, description, imageLink, link, title, priceAmount, currency, gtin, mpn, brand, parameters) {
106
+ if (!isDefined(itemID) || !isString(itemID)) {
107
+ throw new Error("logProductItem expected 'itemID' to be a string");
108
+ }
109
+ if (!isDefined(availability) || !isOneOf(availability, ['in_stock', 'out_of_stock', 'preorder', 'avaliable_for_order', 'discontinued'])) {
110
+ throw new Error("logProductItem expected 'availability' to be one of 'in_stock' | 'out_of_stock' | 'preorder' | 'avaliable_for_order' | 'discontinued'");
111
+ }
112
+ if (!isDefined(condition) || !isOneOf(condition, ['new', 'refurbished', 'used'])) {
113
+ throw new Error("logProductItem expected 'condition' to be one of 'new' | 'refurbished' | 'used'");
114
+ }
115
+ if (!isDefined(description) || !isString(description)) {
116
+ throw new Error("logProductItem expected 'description' to be a string");
117
+ }
118
+ if (!isDefined(imageLink) || !isString(imageLink)) {
119
+ throw new Error("logProductItem expected 'imageLink' to be a string");
120
+ }
121
+ if (!isDefined(link) || !isString(link)) {
122
+ throw new Error("logProductItem expected 'link' to be a string");
123
+ }
124
+ if (!isDefined(title) || !isString(title)) {
125
+ throw new Error("logProductItem expected 'title' to be a string");
126
+ }
127
+ if (!isDefined(priceAmount) || !isNumber(priceAmount)) {
128
+ throw new Error("logProductItem expected 'priceAmount' to be a number");
129
+ }
130
+ if (!isDefined(currency) || !isString(currency)) {
131
+ throw new Error("logProductItem expected 'currency' to be a string");
132
+ }
133
+ if (!isDefined(gtin) && !isDefined(mpn) && !isDefined(brand)) {
134
+ throw new Error('logProductItem expected either gtin, mpn or brand to be defined');
135
+ }
136
+ AppEventsLogger.logProductItem(itemID, availability, condition, description, imageLink, link, title, priceAmount, currency, gtin, mpn, brand, parameters);
137
+ },
138
+ /**
139
+ * Explicitly kicks off flushing of events to Facebook.
140
+ */
141
+ flush() {
142
+ AppEventsLogger.flush();
143
+ },
144
+ /**
145
+ * Sets a custom user ID to associate with all app events.
146
+ * The userID is persisted until this method is called again with a null userId
147
+ */
148
+ setUserID(userID) {
149
+ AppEventsLogger.setUserID(userID);
150
+ },
151
+ /**
152
+ * Clears the currently set user id.
153
+ * @deprecated use setUserID(null) instead
154
+ */
155
+ clearUserID() {
156
+ AppEventsLogger.clearUserID();
157
+ },
158
+ /**
159
+ * Returns user id or null if not set
160
+ */
161
+ async getUserID() {
162
+ return await AppEventsLogger.getUserID();
163
+ },
164
+ /**
165
+ * Returns anonymous id or null if not set
166
+ */
167
+ async getAnonymousID() {
168
+ return await AppEventsLogger.getAnonymousID();
169
+ },
170
+ /**
171
+ * Returns advertiser id or null if not set
172
+ */
173
+ async getAdvertiserID() {
174
+ return await AppEventsLogger.getAdvertiserID();
175
+ },
176
+ /**
177
+ * Returns advertiser id or null if not set.
178
+ * @platform android
179
+ */
180
+ async getAttributionID() {
181
+ if (Platform.OS === 'ios') {
182
+ return null;
183
+ }
184
+ return await AppEventsLogger.getAttributionID();
185
+ },
186
+ /**
187
+ * Set additional data about the user to increase chances of matching a Facebook user.
188
+ */
189
+ setUserData(userData) {
190
+ AppEventsLogger.setUserData(userData);
191
+ },
192
+ /**
193
+ * For iOS only, sets and sends device token to register the current application for push notifications.
194
+ * @platform ios
195
+ */
196
+ setPushNotificationsDeviceToken(deviceToken) {
197
+ AppEventsLogger.setPushNotificationsDeviceToken(deviceToken);
198
+ },
199
+ /**
200
+ * For Android only, sets and sends registration id to register the current app for push notifications.
201
+ * @platform Android
202
+ */
203
+ setPushNotificationsRegistrationId(registrationId) {
204
+ AppEventsLogger.setPushNotificationsRegistrationId(registrationId);
205
+ },
206
+ /**
207
+ * Predefined event names for logging events common to many apps.
208
+ */
209
+ AppEvents,
210
+ /**
211
+ * Predefined event name parameters for common additional information to accompany events logged through the `logEvent`.
212
+ */
213
+ AppEventParams
214
+ };
215
+ //# sourceMappingURL=FBAppEventsLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isDefined","isNumber","isOneOf","isString","NativeModules","Platform","AppEventsLogger","FBAppEventsLogger","AppEvents","AppEventParams","getConstants","setFlushBehavior","flushBehavior","logEvent","eventName","args","valueToSum","Number","shift","parameters","logPurchase","purchaseAmount","currencyCode","logPushNotificationOpen","payload","logProductItem","itemID","availability","condition","description","imageLink","link","title","priceAmount","currency","gtin","mpn","brand","Error","flush","setUserID","userID","clearUserID","getUserID","getAnonymousID","getAdvertiserID","getAttributionID","OS","setUserData","userData","setPushNotificationsDeviceToken","deviceToken","setPushNotificationsRegistrationId","registrationId"],"sourceRoot":"../../src","sources":["FBAppEventsLogger.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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