@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,166 @@
1
+ /**
2
+ * @format
3
+ */
4
+ import {Platform, NativeModules} from 'react-native';
5
+
6
+ const Profile = NativeModules.FBProfile;
7
+
8
+ export type ProfileMap = {
9
+ firstName?: string | null;
10
+ lastName?: string | null;
11
+ middleName?: string | null;
12
+ imageURL?: string | null;
13
+ linkURL?: string | null;
14
+ userID?: string | null;
15
+ email?: string | null;
16
+ name?: string | null;
17
+ refreshDate?: number | null;
18
+ friendIDs?: Array<string> | null;
19
+ birthday?: number | null;
20
+ ageRange?: {min: number; max: number} | null;
21
+ hometown?: {id: string; name: string} | null;
22
+ location?: {id: string; name: string} | null;
23
+ gender?: string | null;
24
+ permissions?: Array<string> | null;
25
+ };
26
+
27
+ /**
28
+ * Represents an immutable Facebook profile
29
+ * This class provides a global "currentProfile" instance to more easily add social context to your application.
30
+ */
31
+ class FBProfile {
32
+ /**
33
+ * The user id
34
+ */
35
+ userID?: string | null;
36
+
37
+ /**
38
+ * The user's email.
39
+ * IMPORTANT: This field will only be populated if your user has granted your application the 'email' permission.
40
+ */
41
+ email?: string | null;
42
+
43
+ /**
44
+ * The user's complete name
45
+ */
46
+ name?: string | null;
47
+
48
+ /**
49
+ * The user's first name
50
+ */
51
+ firstName?: string | null;
52
+
53
+ /**
54
+ * The user's last name
55
+ */
56
+ lastName?: string | null;
57
+
58
+ /**
59
+ * The user's middle name
60
+ */
61
+ middleName?: string | null;
62
+
63
+ /**
64
+ * A URL to the user's profile.
65
+ * IMPORTANT: This field will only be populated if your user has granted your application the 'user_link' permission
66
+ */
67
+ linkURL?: string | null;
68
+
69
+ /**
70
+ * A URL to use for fetching a user's profile image.
71
+ */
72
+ imageURL?: string | null;
73
+
74
+ /**
75
+ * The last time the profile data was fetched.
76
+ */
77
+ refreshDate?: Date | null;
78
+
79
+ /**
80
+ * A list of identifiers of the user’s friends.
81
+ * IMPORTANT: This field will only be populated if your user has granted your application the 'user_friends' permission and
82
+ * limited login flow is used on iOS
83
+ */
84
+ friendIDs?: Array<string> | null;
85
+
86
+ /**
87
+ * The user’s birthday.
88
+ * IMPORTANT: This field will only be populated if your user has granted your application the 'user_birthday' permission and
89
+ * limited login flow is used on iOS
90
+ */
91
+ birthday?: Date | null;
92
+
93
+ /**
94
+ * The user’s age range.
95
+ * IMPORTANT: This field will only be populated if your user has granted your application the 'user_age_range' permission and
96
+ * limited login flow is used on iOS
97
+ */
98
+ ageRange?: {min: number; max: number} | null;
99
+
100
+ /**
101
+ * The user’s hometown.
102
+ * IMPORTANT: This field will only be populated if your user has granted your application the 'user_hometown' permission and
103
+ * limited login flow is used on iOS
104
+ */
105
+ hometown?: {id: string; name: string} | null;
106
+
107
+ /**
108
+ * The user’s location.
109
+ * IMPORTANT: This field will only be populated if your user has granted your application the 'user_location' permission and
110
+ * limited login flow is used on iOS
111
+ */
112
+ location?: {id: string; name: string} | null;
113
+
114
+ /**
115
+ * The user’s gender.
116
+ * IMPORTANT: This field will only be populated if your user has granted your application the 'user_gender' permission and
117
+ * limited login flow is used on iOS
118
+ */
119
+ gender?: string | null;
120
+
121
+ /**
122
+ * The user’s granted permissions.
123
+ */
124
+ permissions?: Array<string> | null;
125
+
126
+ constructor(profileMap: ProfileMap) {
127
+ this.firstName = profileMap.firstName;
128
+ this.lastName = profileMap.lastName;
129
+ this.middleName = profileMap.middleName;
130
+ this.linkURL = profileMap.linkURL;
131
+ this.imageURL = profileMap.imageURL;
132
+ this.userID = profileMap.userID;
133
+ if (Platform.OS !== 'android') {
134
+ this.email = profileMap.email;
135
+ }
136
+ this.name = profileMap.name;
137
+ this.refreshDate = profileMap.refreshDate
138
+ ? new Date(profileMap.refreshDate)
139
+ : null;
140
+ this.friendIDs = profileMap.friendIDs;
141
+ this.birthday = profileMap.birthday ? new Date(profileMap.birthday) : null;
142
+ this.ageRange = profileMap.ageRange;
143
+ this.hometown = profileMap.hometown;
144
+ this.location = profileMap.location;
145
+ this.gender = profileMap.gender;
146
+ this.permissions = profileMap.permissions;
147
+ Object.freeze(this);
148
+ }
149
+
150
+ /**
151
+ * Getter the current logged profile
152
+ */
153
+ static getCurrentProfile(): Promise<FBProfile | null> {
154
+ return new Promise((resolve) => {
155
+ Profile.getCurrentProfile((profileMap: ProfileMap) => {
156
+ if (profileMap) {
157
+ resolve(new FBProfile(profileMap));
158
+ } else {
159
+ resolve(null);
160
+ }
161
+ });
162
+ });
163
+ }
164
+ }
165
+
166
+ export default FBProfile;
@@ -0,0 +1,61 @@
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 {ShareContent} from './models/FBShareContent';
23
+ import {PropsOf} from './utils';
24
+ import * as React from 'react';
25
+ import {requireNativeComponent, StyleSheet, ViewStyle} from 'react-native';
26
+
27
+ class SendButton extends React.Component<{
28
+ /**
29
+ * Content to be shared.
30
+ */
31
+ shareContent: ShareContent;
32
+
33
+ /**
34
+ * View style, if any.
35
+ */
36
+ style?: ViewStyle;
37
+ }> {
38
+ static defaultProps: {
39
+ style: typeof styles.defaultButtonStyle;
40
+ };
41
+
42
+ render() {
43
+ return <RCTFBSendButton {...this.props} />;
44
+ }
45
+ }
46
+
47
+ const styles = StyleSheet.create({
48
+ defaultButtonStyle: {
49
+ height: 30,
50
+ width: 80,
51
+ },
52
+ });
53
+
54
+ SendButton.defaultProps = {
55
+ style: styles.defaultButtonStyle,
56
+ };
57
+
58
+ const RCTFBSendButton =
59
+ requireNativeComponent<PropsOf<SendButton>>('RCTFBSendButton');
60
+
61
+ export default SendButton;
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ * @format
9
+ */
10
+ import {isDefined, isString, isValidGraphAPIVersion} from './util/validate';
11
+ import {Platform, NativeModules} from 'react-native';
12
+
13
+ const Settings = NativeModules.FBSettings;
14
+
15
+ export default {
16
+ /**
17
+ * For iOS only, get AdvertiserTrackingEnabled status.
18
+ * @platform ios
19
+ */
20
+ getAdvertiserTrackingEnabled(): Promise<boolean> {
21
+ if (Platform.OS === 'ios') {
22
+ return Settings.getAdvertiserTrackingEnabled();
23
+ } else {
24
+ return Promise.resolve(true);
25
+ }
26
+ },
27
+ /**
28
+ * For iOS only, set AdvertiserTrackingEnabled status, only works in iOS 14 and above.
29
+ * @platform ios
30
+ */
31
+ setAdvertiserTrackingEnabled(ATE: boolean): Promise<boolean> {
32
+ if (Platform.OS === 'ios') {
33
+ return Settings.setAdvertiserTrackingEnabled(ATE);
34
+ } else {
35
+ return Promise.resolve(false);
36
+ }
37
+ },
38
+ /**
39
+ * Set data processing options
40
+ */
41
+ setDataProcessingOptions(options: Array<string>, ...args: Array<number>) {
42
+ let country = 0;
43
+ if (typeof args[0] === 'number') {
44
+ country = args[0];
45
+ }
46
+ let state = 0;
47
+ if (typeof args[1] === 'number') {
48
+ state = args[1];
49
+ }
50
+ Settings.setDataProcessingOptions(options, country, state);
51
+ },
52
+ /**
53
+ * Initialize the sdk
54
+ */
55
+ initializeSDK() {
56
+ Settings.initializeSDK();
57
+ },
58
+ /**
59
+ * Set app id
60
+ */
61
+ setAppID(appID: string) {
62
+ if (!isDefined(appID) || !isString(appID) || appID.length === 0) {
63
+ throw new Error("setAppID expected 'appID' to be a non empty string");
64
+ }
65
+ Settings.setAppID(appID);
66
+ },
67
+ /**
68
+ * Set clientToken
69
+ */
70
+ setClientToken(clientToken: string) {
71
+ if (
72
+ !isDefined(clientToken) ||
73
+ !isString(clientToken) ||
74
+ clientToken.length === 0
75
+ ) {
76
+ throw new Error(
77
+ "setClientToken expected 'clientToken' to be a non empty string",
78
+ );
79
+ }
80
+ Settings.setClientToken(clientToken);
81
+ },
82
+ /**
83
+ * Sets the Facebook application name for the current app.
84
+ */
85
+ setAppName(appName: string) {
86
+ if (!isDefined(appName) || !isString(appName) || appName.length === 0) {
87
+ throw new Error("setAppName expected 'appName' to be a non empty string");
88
+ }
89
+ Settings.setAppName(appName);
90
+ },
91
+ /**
92
+ * Sets the Graph API version to use when making Graph requests.
93
+ */
94
+ setGraphAPIVersion(version: string) {
95
+ if (
96
+ !isDefined(version) ||
97
+ !isString(version) ||
98
+ version.length === 0 ||
99
+ !isValidGraphAPIVersion(version)
100
+ ) {
101
+ throw new Error(
102
+ "setGraphAPIVersion expected 'version' to be a non empty string",
103
+ );
104
+ }
105
+ Settings.setGraphAPIVersion(version);
106
+ },
107
+ /**
108
+ * Sets whether Facebook SDK should log app events. App events involve eg. app installs,
109
+ * app launches etc.
110
+ */
111
+ setAutoLogAppEventsEnabled(enabled: boolean) {
112
+ Settings.setAutoLogAppEventsEnabled(enabled);
113
+ },
114
+ /**
115
+ * Whether the Facebook SDK should collect advertiser ID properties, like the Apple IDFA
116
+ * and Android Advertising ID, automatically. Advertiser IDs let you identify and target
117
+ * specific customers.
118
+ */
119
+ setAdvertiserIDCollectionEnabled(enabled: boolean) {
120
+ Settings.setAdvertiserIDCollectionEnabled(enabled);
121
+ },
122
+ };
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Copyright (c) 2015-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 {ShareContent} from './models/FBShareContent';
23
+ import {PropsOf} from './utils';
24
+ import * as React from 'react';
25
+ import {requireNativeComponent, StyleSheet, ViewStyle} from 'react-native';
26
+
27
+ class ShareButton extends React.Component<{
28
+ /**
29
+ * Content to be shared.
30
+ */
31
+ shareContent: ShareContent;
32
+
33
+ /**
34
+ * View style, if any.
35
+ */
36
+ style?: ViewStyle;
37
+ }> {
38
+ static defaultProps: {
39
+ style: typeof styles.defaultButtonStyle;
40
+ };
41
+
42
+ render() {
43
+ return <RCTFBShareButton {...this.props} />;
44
+ }
45
+ }
46
+
47
+ const styles = StyleSheet.create({
48
+ defaultButtonStyle: {
49
+ height: 30,
50
+ width: 80,
51
+ },
52
+ });
53
+
54
+ ShareButton.defaultProps = {
55
+ style: styles.defaultButtonStyle,
56
+ };
57
+
58
+ const RCTFBShareButton =
59
+ requireNativeComponent<PropsOf<ShareButton>>('RCTFBShareButton');
60
+
61
+ export default ShareButton;
@@ -0,0 +1,96 @@
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 {RNFBSDKCallback} from './models/FBSDKCallback';
23
+ import {ShareContent} from './models/FBShareContent';
24
+ import {NativeModules} from 'react-native';
25
+
26
+ const ShareDialog = NativeModules.FBShareDialog;
27
+
28
+ export type ShareDialogMode = ShareDialogModeIOS | ShareDialogModeAndroid;
29
+ export type ShareDialogModeAndroid =
30
+ /**
31
+ * The mode is determined automatically.
32
+ */
33
+ | 'automatic'
34
+ /**
35
+ * The native dialog is used.
36
+ */
37
+ | 'native'
38
+ /**
39
+ * The web dialog is used.
40
+ */
41
+ | 'web'
42
+ /**
43
+ * The feed dialog is used.
44
+ */
45
+ | 'feed';
46
+ export type ShareDialogModeIOS =
47
+ /*
48
+ * Acts with the most appropriate mode that is available.
49
+ */
50
+ | 'automatic'
51
+ /*
52
+ * Displays the dialog in Safari.
53
+ */
54
+ | 'browser'
55
+ /*
56
+ * Displays the dialog in a UIWebView within the app.
57
+ */
58
+ | 'webview'
59
+ /**
60
+ * The native dialog is used.
61
+ */
62
+ | 'native';
63
+
64
+ export type ShareDialogResult = RNFBSDKCallback & {
65
+ postId: string;
66
+ };
67
+
68
+ export default {
69
+ /**
70
+ * Check if the dialog can be shown.
71
+ */
72
+ canShow(shareContent: ShareContent): Promise<boolean> {
73
+ return ShareDialog.canShow(shareContent);
74
+ },
75
+
76
+ /**
77
+ * Shows the dialog using the specified content.
78
+ */
79
+ show(shareContent: ShareContent): Promise<ShareDialogResult> {
80
+ return ShareDialog.show(shareContent);
81
+ },
82
+
83
+ /**
84
+ * Sets the mode for the share dialog.
85
+ */
86
+ setMode(mode: ShareDialogMode) {
87
+ ShareDialog.setMode(mode);
88
+ },
89
+
90
+ /**
91
+ * Sets whether or not the native share dialog should fail when it encounters a data error.
92
+ */
93
+ setShouldFailOnDataError(shouldFailOnDataError: boolean) {
94
+ ShareDialog.setShouldFailOnDataError(shouldFailOnDataError);
95
+ },
96
+ };
package/src/index.ts ADDED
@@ -0,0 +1,85 @@
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
+
23
+ export {default as AccessToken, AccessTokenMap} from './FBAccessToken';
24
+ export {
25
+ default as AuthenticationToken,
26
+ AuthenticationTokenMap,
27
+ } from './FBAuthenticationToken';
28
+ export {
29
+ default as AppEventsLogger,
30
+ AppEventsFlushBehavior,
31
+ ProductAvailability,
32
+ ProductCondition,
33
+ Params,
34
+ UserData,
35
+ AppEvent,
36
+ AppEventParam,
37
+ } from './FBAppEventsLogger';
38
+ export {default as AppLink} from './FBAppLink';
39
+ export {
40
+ default as GameRequestDialog,
41
+ GameRequestDialogResult,
42
+ } from './FBGameRequestDialog';
43
+ export {
44
+ default as GraphRequest,
45
+ GraphRequestCallback,
46
+ GraphRequestConfig,
47
+ GraphRequestParameters,
48
+ } from './FBGraphRequest';
49
+ export {default as GraphRequestManager} from './FBGraphRequestManager';
50
+ export {
51
+ default as LoginManager,
52
+ DefaultAudience,
53
+ LoginBehavior,
54
+ LoginBehaviorAndroid,
55
+ LoginBehaviorIOS,
56
+ LoginResult,
57
+ LoginTracking,
58
+ } from './FBLoginManager';
59
+ export {default as MessageDialog, MessageDialogResult} from './FBMessageDialog';
60
+ export {default as Profile, ProfileMap} from './FBProfile';
61
+ export {default as Settings} from './FBSettings';
62
+ export {
63
+ default as ShareDialog,
64
+ ShareDialogMode,
65
+ ShareDialogModeAndroid,
66
+ ShareDialogModeIOS,
67
+ ShareDialogResult,
68
+ } from './FBShareDialog';
69
+ export {
70
+ default as LoginButton,
71
+ Event,
72
+ TooltipBehaviorIOS,
73
+ } from './FBLoginButton';
74
+ export {default as SendButton} from './FBSendButton';
75
+ export {default as ShareButton} from './FBShareButton';
76
+ export {default as AEMReporterIOS} from './FBAEMReporter';
77
+
78
+ export {RNFBSDKCallback} from './models/FBSDKCallback';
79
+ export {
80
+ ShareContent,
81
+ ShareContentCommonParameters,
82
+ } from './models/FBShareContent';
83
+ export {ShareLinkContent} from './models/FBShareLinkContent';
84
+ export {SharePhotoContent} from './models/FBSharePhotoContent';
85
+ export {ShareVideoContent} from './models/FBShareVideoContent';
@@ -0,0 +1,48 @@
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
+
23
+ /**
24
+ * Specifies the privacy of a group.
25
+ */
26
+ export type AppGroupPrivacy =
27
+ // Anyone can see the group, who's in in and what members post.
28
+ | 'Open'
29
+ // Anyone can see the group and who's in it, but only members can see posts.
30
+ | 'Closed';
31
+
32
+ /**
33
+ * A model for app invites.
34
+ */
35
+ export type AppGroupCreationContent = {
36
+ /**
37
+ * The description of the group.
38
+ */
39
+ description: string;
40
+ /**
41
+ * The name of the group.
42
+ */
43
+ name: string;
44
+ /**
45
+ * The privacy for the group.
46
+ */
47
+ privacy: AppGroupPrivacy;
48
+ };