@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.
- package/LICENSE +21 -0
- package/README.md +943 -0
- package/android/build.gradle +57 -0
- package/android/src/main/AndroidManifest.xml +46 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBAccessTokenModule.java +151 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBActivityEventListener.java +40 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBAppEventsLoggerModule.java +414 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBAppLinkModule.java +86 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBGameRequestDialogModule.java +94 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBGraphRequestModule.java +283 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBLoginButtonManager.java +83 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBLoginManagerModule.java +171 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBMessageDialogModule.java +111 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBProfileModule.java +68 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBSDKCallbackManagerBaseJavaModule.java +41 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBSDKPackage.java +60 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBSendButtonManager.java +51 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBSettingsModule.java +95 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBShareButtonManager.java +53 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/FBShareDialogModule.java +107 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/RCTLoginButton.java +126 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/RCTLoginButtonEvent.java +27 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/ReactNativeFacebookSDKCallback.java +58 -0
- package/android/src/main/java/com/facebook/reactnative/androidsdk/Utility.java +283 -0
- package/app.plugin.js +1 -0
- package/expo-module.config.json +10 -0
- package/ios/ExpoAdapterFBSDKNext/FacebookAppDelegate.swift +21 -0
- package/ios/ExpoAdapterFBSDKNext.podspec +33 -0
- package/ios/RCTFBSDK/core/RCTConvert+FBSDKAccessToken.h +27 -0
- package/ios/RCTFBSDK/core/RCTConvert+FBSDKAccessToken.m +41 -0
- package/ios/RCTFBSDK/core/RCTFBSDKAEMReporter.m +30 -0
- package/ios/RCTFBSDK/core/RCTFBSDKAccessToken.h +24 -0
- package/ios/RCTFBSDK/core/RCTFBSDKAccessToken.m +115 -0
- package/ios/RCTFBSDK/core/RCTFBSDKAppEvents.h +24 -0
- package/ios/RCTFBSDK/core/RCTFBSDKAppEvents.m +251 -0
- package/ios/RCTFBSDK/core/RCTFBSDKAppLink.h +24 -0
- package/ios/RCTFBSDK/core/RCTFBSDKAppLink.m +52 -0
- package/ios/RCTFBSDK/core/RCTFBSDKAuthenticationToken.h +6 -0
- package/ios/RCTFBSDK/core/RCTFBSDKAuthenticationToken.m +35 -0
- package/ios/RCTFBSDK/core/RCTFBSDKGraphRequestConnectionContainer.h +50 -0
- package/ios/RCTFBSDK/core/RCTFBSDKGraphRequestConnectionContainer.m +124 -0
- package/ios/RCTFBSDK/core/RCTFBSDKGraphRequestManager.h +25 -0
- package/ios/RCTFBSDK/core/RCTFBSDKGraphRequestManager.m +43 -0
- package/ios/RCTFBSDK/core/RCTFBSDKProfile.h +6 -0
- package/ios/RCTFBSDK/core/RCTFBSDKProfile.m +58 -0
- package/ios/RCTFBSDK/core/RCTFBSDKSettings.h +14 -0
- package/ios/RCTFBSDK/core/RCTFBSDKSettings.m +80 -0
- package/ios/RCTFBSDK/login/RCTConvert+FBSDKLogin.h +28 -0
- package/ios/RCTFBSDK/login/RCTConvert+FBSDKLogin.m +35 -0
- package/ios/RCTFBSDK/login/RCTFBSDKLoginButtonManager.h +25 -0
- package/ios/RCTFBSDK/login/RCTFBSDKLoginButtonManager.m +73 -0
- package/ios/RCTFBSDK/login/RCTFBSDKLoginButtonView.h +12 -0
- package/ios/RCTFBSDK/login/RCTFBSDKLoginButtonView.m +57 -0
- package/ios/RCTFBSDK/login/RCTFBSDKLoginManager.h +22 -0
- package/ios/RCTFBSDK/login/RCTFBSDKLoginManager.m +154 -0
- package/ios/RCTFBSDK/share/RCTConvert+FBSDKSharingContent.h +29 -0
- package/ios/RCTFBSDK/share/RCTConvert+FBSDKSharingContent.m +111 -0
- package/ios/RCTFBSDK/share/RCTFBSDKGameRequestDialog.h +24 -0
- package/ios/RCTFBSDK/share/RCTFBSDKGameRequestDialog.m +134 -0
- package/ios/RCTFBSDK/share/RCTFBSDKMessageDialog.h +24 -0
- package/ios/RCTFBSDK/share/RCTFBSDKMessageDialog.m +116 -0
- package/ios/RCTFBSDK/share/RCTFBSDKSendButtonManager.h +25 -0
- package/ios/RCTFBSDK/share/RCTFBSDKSendButtonManager.m +39 -0
- package/ios/RCTFBSDK/share/RCTFBSDKShareButtonManager.h +23 -0
- package/ios/RCTFBSDK/share/RCTFBSDKShareButtonManager.m +39 -0
- package/ios/RCTFBSDK/share/RCTFBSDKShareDialog.h +24 -0
- package/ios/RCTFBSDK/share/RCTFBSDKShareDialog.m +134 -0
- package/ios/RCTFBSDK/share/RCTFBSDKShareHelper.h +21 -0
- package/ios/RCTFBSDK/share/RCTFBSDKShareHelper.m +32 -0
- package/ios/RCTFBSDK.xcodeproj/project.pbxproj +446 -0
- package/ios/RCTFBSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RCTFBSDK.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/jest/mocks/index.js +81 -0
- package/jest/setup.js +3 -0
- package/lib/commonjs/FBAEMReporter.js +39 -0
- package/lib/commonjs/FBAEMReporter.js.map +1 -0
- package/lib/commonjs/FBAccessToken.js +198 -0
- package/lib/commonjs/FBAccessToken.js.map +1 -0
- package/lib/commonjs/FBAppEventsLogger.js +221 -0
- package/lib/commonjs/FBAppEventsLogger.js.map +1 -0
- package/lib/commonjs/FBAppLink.js +36 -0
- package/lib/commonjs/FBAppLink.js.map +1 -0
- package/lib/commonjs/FBAuthenticationToken.js +55 -0
- package/lib/commonjs/FBAuthenticationToken.js.map +1 -0
- package/lib/commonjs/FBGameRequestDialog.js +45 -0
- package/lib/commonjs/FBGameRequestDialog.js.map +1 -0
- package/lib/commonjs/FBGraphRequest.js +66 -0
- package/lib/commonjs/FBGraphRequest.js.map +1 -0
- package/lib/commonjs/FBGraphRequestManager.js +96 -0
- package/lib/commonjs/FBGraphRequestManager.js.map +1 -0
- package/lib/commonjs/FBLoginButton.js +67 -0
- package/lib/commonjs/FBLoginButton.js.map +1 -0
- package/lib/commonjs/FBLoginManager.js +102 -0
- package/lib/commonjs/FBLoginManager.js.map +1 -0
- package/lib/commonjs/FBMessageDialog.js +51 -0
- package/lib/commonjs/FBMessageDialog.js.map +1 -0
- package/lib/commonjs/FBProfile.js +134 -0
- package/lib/commonjs/FBProfile.js.map +1 -0
- package/lib/commonjs/FBSendButton.js +48 -0
- package/lib/commonjs/FBSendButton.js.map +1 -0
- package/lib/commonjs/FBSettings.js +115 -0
- package/lib/commonjs/FBSettings.js.map +1 -0
- package/lib/commonjs/FBShareButton.js +48 -0
- package/lib/commonjs/FBShareButton.js.map +1 -0
- package/lib/commonjs/FBShareDialog.js +57 -0
- package/lib/commonjs/FBShareDialog.js.map +1 -0
- package/lib/commonjs/index.js +323 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/models/FBAppGroupCreationContent.js +2 -0
- package/lib/commonjs/models/FBAppGroupCreationContent.js.map +1 -0
- package/lib/commonjs/models/FBGameRequestContent.js +2 -0
- package/lib/commonjs/models/FBGameRequestContent.js.map +1 -0
- package/lib/commonjs/models/FBSDKCallback.js +2 -0
- package/lib/commonjs/models/FBSDKCallback.js.map +1 -0
- package/lib/commonjs/models/FBShareContent.js +6 -0
- package/lib/commonjs/models/FBShareContent.js.map +1 -0
- package/lib/commonjs/models/FBShareLinkContent.js +6 -0
- package/lib/commonjs/models/FBShareLinkContent.js.map +1 -0
- package/lib/commonjs/models/FBSharePhoto.js +2 -0
- package/lib/commonjs/models/FBSharePhoto.js.map +1 -0
- package/lib/commonjs/models/FBSharePhotoContent.js +6 -0
- package/lib/commonjs/models/FBSharePhotoContent.js.map +1 -0
- package/lib/commonjs/models/FBShareVideo.js +2 -0
- package/lib/commonjs/models/FBShareVideo.js.map +1 -0
- package/lib/commonjs/models/FBShareVideoContent.js +6 -0
- package/lib/commonjs/models/FBShareVideoContent.js.map +1 -0
- package/lib/commonjs/util/validate.js +180 -0
- package/lib/commonjs/util/validate.js.map +1 -0
- package/lib/commonjs/utils/index.js +2 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/module/FBAEMReporter.js +34 -0
- package/lib/module/FBAEMReporter.js.map +1 -0
- package/lib/module/FBAccessToken.js +191 -0
- package/lib/module/FBAccessToken.js.map +1 -0
- package/lib/module/FBAppEventsLogger.js +215 -0
- package/lib/module/FBAppEventsLogger.js.map +1 -0
- package/lib/module/FBAppLink.js +29 -0
- package/lib/module/FBAppLink.js.map +1 -0
- package/lib/module/FBAuthenticationToken.js +48 -0
- package/lib/module/FBAuthenticationToken.js.map +1 -0
- package/lib/module/FBGameRequestDialog.js +39 -0
- package/lib/module/FBGameRequestDialog.js.map +1 -0
- package/lib/module/FBGraphRequest.js +60 -0
- package/lib/module/FBGraphRequest.js.map +1 -0
- package/lib/module/FBGraphRequestManager.js +90 -0
- package/lib/module/FBGraphRequestManager.js.map +1 -0
- package/lib/module/FBLoginButton.js +62 -0
- package/lib/module/FBLoginButton.js.map +1 -0
- package/lib/module/FBLoginManager.js +97 -0
- package/lib/module/FBLoginManager.js.map +1 -0
- package/lib/module/FBMessageDialog.js +45 -0
- package/lib/module/FBMessageDialog.js.map +1 -0
- package/lib/module/FBProfile.js +127 -0
- package/lib/module/FBProfile.js.map +1 -0
- package/lib/module/FBSendButton.js +41 -0
- package/lib/module/FBSendButton.js.map +1 -0
- package/lib/module/FBSettings.js +108 -0
- package/lib/module/FBSettings.js.map +1 -0
- package/lib/module/FBShareButton.js +41 -0
- package/lib/module/FBShareButton.js.map +1 -0
- package/lib/module/FBShareDialog.js +51 -0
- package/lib/module/FBShareDialog.js.map +1 -0
- package/lib/module/index.js +44 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/models/FBAppGroupCreationContent.js +2 -0
- package/lib/module/models/FBAppGroupCreationContent.js.map +1 -0
- package/lib/module/models/FBGameRequestContent.js +2 -0
- package/lib/module/models/FBGameRequestContent.js.map +1 -0
- package/lib/module/models/FBSDKCallback.js +2 -0
- package/lib/module/models/FBSDKCallback.js.map +1 -0
- package/lib/module/models/FBShareContent.js +2 -0
- package/lib/module/models/FBShareContent.js.map +1 -0
- package/lib/module/models/FBShareLinkContent.js +2 -0
- package/lib/module/models/FBShareLinkContent.js.map +1 -0
- package/lib/module/models/FBSharePhoto.js +2 -0
- package/lib/module/models/FBSharePhoto.js.map +1 -0
- package/lib/module/models/FBSharePhotoContent.js +2 -0
- package/lib/module/models/FBSharePhotoContent.js.map +1 -0
- package/lib/module/models/FBShareVideo.js +2 -0
- package/lib/module/models/FBShareVideo.js.map +1 -0
- package/lib/module/models/FBShareVideoContent.js +2 -0
- package/lib/module/models/FBShareVideoContent.js.map +1 -0
- package/lib/module/util/validate.js +157 -0
- package/lib/module/util/validate.js.map +1 -0
- package/lib/module/utils/index.js +2 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/FBAEMReporter.d.ts +21 -0
- package/lib/typescript/FBAEMReporter.d.ts.map +1 -0
- package/lib/typescript/FBAccessToken.d.ts +118 -0
- package/lib/typescript/FBAccessToken.d.ts.map +1 -0
- package/lib/typescript/FBAppEventsLogger.d.ts +201 -0
- package/lib/typescript/FBAppEventsLogger.d.ts.map +1 -0
- package/lib/typescript/FBAppLink.d.ts +5 -0
- package/lib/typescript/FBAppLink.d.ts.map +1 -0
- package/lib/typescript/FBAuthenticationToken.d.ts +29 -0
- package/lib/typescript/FBAuthenticationToken.d.ts.map +1 -0
- package/lib/typescript/FBGameRequestDialog.d.ts +39 -0
- package/lib/typescript/FBGameRequestDialog.d.ts.map +1 -0
- package/lib/typescript/FBGraphRequest.d.ts +70 -0
- package/lib/typescript/FBGraphRequest.d.ts.map +1 -0
- package/lib/typescript/FBGraphRequestManager.d.ts +51 -0
- package/lib/typescript/FBGraphRequestManager.d.ts.map +1 -0
- package/lib/typescript/FBLoginButton.d.ts +92 -0
- package/lib/typescript/FBLoginButton.d.ts.map +1 -0
- package/lib/typescript/FBLoginManager.d.ts +77 -0
- package/lib/typescript/FBLoginManager.d.ts.map +1 -0
- package/lib/typescript/FBMessageDialog.d.ts +42 -0
- package/lib/typescript/FBMessageDialog.d.ts.map +1 -0
- package/lib/typescript/FBProfile.d.ts +127 -0
- package/lib/typescript/FBProfile.d.ts.map +1 -0
- package/lib/typescript/FBSendButton.d.ts +42 -0
- package/lib/typescript/FBSendButton.d.ts.map +1 -0
- package/lib/typescript/FBSettings.d.ts +49 -0
- package/lib/typescript/FBSettings.d.ts.map +1 -0
- package/lib/typescript/FBShareButton.d.ts +42 -0
- package/lib/typescript/FBShareButton.d.ts.map +1 -0
- package/lib/typescript/FBShareDialog.d.ts +69 -0
- package/lib/typescript/FBShareDialog.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +43 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/models/FBAppGroupCreationContent.d.ts +43 -0
- package/lib/typescript/models/FBAppGroupCreationContent.d.ts.map +1 -0
- package/lib/typescript/models/FBGameRequestContent.d.ts +63 -0
- package/lib/typescript/models/FBGameRequestContent.d.ts.map +1 -0
- package/lib/typescript/models/FBSDKCallback.d.ts +4 -0
- package/lib/typescript/models/FBSDKCallback.d.ts.map +1 -0
- package/lib/typescript/models/FBShareContent.d.ts +48 -0
- package/lib/typescript/models/FBShareContent.d.ts.map +1 -0
- package/lib/typescript/models/FBShareLinkContent.d.ts +65 -0
- package/lib/typescript/models/FBShareLinkContent.d.ts.map +1 -0
- package/lib/typescript/models/FBSharePhoto.d.ts +43 -0
- package/lib/typescript/models/FBSharePhoto.d.ts.map +1 -0
- package/lib/typescript/models/FBSharePhotoContent.d.ts +45 -0
- package/lib/typescript/models/FBSharePhotoContent.d.ts.map +1 -0
- package/lib/typescript/models/FBShareVideo.d.ts +31 -0
- package/lib/typescript/models/FBShareVideo.d.ts.map +1 -0
- package/lib/typescript/models/FBShareVideoContent.d.ts +58 -0
- package/lib/typescript/models/FBShareVideoContent.d.ts.map +1 -0
- package/lib/typescript/util/validate.d.ts +62 -0
- package/lib/typescript/util/validate.d.ts.map +1 -0
- package/lib/typescript/utils/index.d.ts +2 -0
- package/lib/typescript/utils/index.d.ts.map +1 -0
- package/package.json +155 -0
- package/plugin/build/config.d.ts +53 -0
- package/plugin/build/config.js +46 -0
- package/plugin/build/withFacebook.d.ts +4 -0
- package/plugin/build/withFacebook.js +59 -0
- package/plugin/build/withFacebookAndroid.d.ts +6 -0
- package/plugin/build/withFacebookAndroid.js +197 -0
- package/plugin/build/withFacebookIOS.d.ts +15 -0
- package/plugin/build/withFacebookIOS.js +163 -0
- package/plugin/build/withSKAdNetworkIdentifiers.d.ts +9 -0
- package/plugin/build/withSKAdNetworkIdentifiers.js +36 -0
- package/plugin/tsconfig.json +9 -0
- package/react-native-fbsdk-next.podspec +34 -0
- package/src/FBAEMReporter.ts +44 -0
- package/src/FBAccessToken.ts +222 -0
- package/src/FBAppEventsLogger.ts +375 -0
- package/src/FBAppLink.ts +30 -0
- package/src/FBAuthenticationToken.ts +61 -0
- package/src/FBGameRequestDialog.ts +49 -0
- package/src/FBGraphRequest.ts +89 -0
- package/src/FBGraphRequestManager.ts +117 -0
- package/src/FBLoginButton.tsx +152 -0
- package/src/FBLoginManager.ts +133 -0
- package/src/FBMessageDialog.ts +53 -0
- package/src/FBProfile.ts +166 -0
- package/src/FBSendButton.tsx +61 -0
- package/src/FBSettings.ts +122 -0
- package/src/FBShareButton.tsx +61 -0
- package/src/FBShareDialog.ts +96 -0
- package/src/index.ts +85 -0
- package/src/models/FBAppGroupCreationContent.ts +48 -0
- package/src/models/FBGameRequestContent.ts +81 -0
- package/src/models/FBSDKCallback.ts +3 -0
- package/src/models/FBShareContent.ts +54 -0
- package/src/models/FBShareLinkContent.ts +71 -0
- package/src/models/FBSharePhoto.ts +45 -0
- package/src/models/FBSharePhotoContent.ts +48 -0
- package/src/models/FBShareVideo.ts +31 -0
- package/src/models/FBShareVideoContent.ts +64 -0
- package/src/util/validate.ts +167 -0
- package/src/utils/index.ts +1 -0
- package/tsconfig.json +103 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* eslint-env jest */
|
|
2
|
+
const LoginButton = require('../../lib/commonjs/FBLoginButton').default;
|
|
3
|
+
|
|
4
|
+
export const mockAppEvents = {
|
|
5
|
+
AchievedLevel: 'fb_mobile_level_achieved',
|
|
6
|
+
AdClick: 'AdClick',
|
|
7
|
+
AdImpression: 'AdImpression',
|
|
8
|
+
AddedPaymentInfo: 'fb_mobile_add_payment_info',
|
|
9
|
+
AddedToCart: 'fb_mobile_add_to_cart',
|
|
10
|
+
AddedToWishlist: 'fb_mobile_add_to_wishlist',
|
|
11
|
+
CompletedRegistration: 'fb_mobile_complete_registration',
|
|
12
|
+
CompletedTutorial: 'fb_mobile_tutorial_completion',
|
|
13
|
+
Contact: 'Contact',
|
|
14
|
+
CustomizeProduct: 'CustomizeProduct',
|
|
15
|
+
Donate: 'Donate',
|
|
16
|
+
FindLocation: 'FindLocation',
|
|
17
|
+
InitiatedCheckout: 'fb_mobile_initiated_checkout',
|
|
18
|
+
Purchased: 'fb_mobile_purchase',
|
|
19
|
+
Rated: 'fb_mobile_rate',
|
|
20
|
+
Schedule: 'Schedule',
|
|
21
|
+
Searched: 'fb_mobile_search',
|
|
22
|
+
SpentCredits: 'fb_mobile_spent_credits',
|
|
23
|
+
StartTrial: 'StartTrial',
|
|
24
|
+
SubmitApplication: 'SubmitApplication',
|
|
25
|
+
Subscribe: 'Subscribe',
|
|
26
|
+
UnlockedAchievement: 'fb_mobile_achievement_unlocked',
|
|
27
|
+
ViewedContent: 'fb_mobile_content_view',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const mockAppEventParams = {
|
|
31
|
+
AddType: 'ad_type',
|
|
32
|
+
Content: 'fb_content',
|
|
33
|
+
ContentID: 'fb_content_id',
|
|
34
|
+
ContentType: 'fb_content_type',
|
|
35
|
+
Currency: 'fb_currency',
|
|
36
|
+
Description: 'fb_description',
|
|
37
|
+
Level: 'fb_level',
|
|
38
|
+
MaxRatingValue: 'fb_max_rating_value',
|
|
39
|
+
NumItems: 'fb_num_items',
|
|
40
|
+
OrderId: 'fb_order_id',
|
|
41
|
+
PaymentInfoAvailable: 'fb_payment_info_available',
|
|
42
|
+
RegistrationMethod: 'fb_registration_method',
|
|
43
|
+
SearchString: 'fb_search_string',
|
|
44
|
+
Success: 'fb_success',
|
|
45
|
+
ValueNo: '0',
|
|
46
|
+
ValueYes: '1',
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
AccessToken: {
|
|
51
|
+
refreshCurrentAccessTokenAsync: jest.fn(),
|
|
52
|
+
getCurrentAccessToken: jest.fn(),
|
|
53
|
+
},
|
|
54
|
+
AppEventsLogger: {
|
|
55
|
+
logEvent: jest.fn(),
|
|
56
|
+
logProductItem: jest.fn(),
|
|
57
|
+
logPushNotificationOpen: jest.fn(),
|
|
58
|
+
logPurchase: jest.fn(),
|
|
59
|
+
setFlushBehavior: jest.fn(),
|
|
60
|
+
setPushNotificationsDeviceToken: jest.fn(),
|
|
61
|
+
setPushNotificationsRegistrationId: jest.fn(),
|
|
62
|
+
setUserData: jest.fn(),
|
|
63
|
+
setUserID: jest.fn(),
|
|
64
|
+
clearUserID: jest.fn(),
|
|
65
|
+
flush: jest.fn(),
|
|
66
|
+
getAdvertiserID: jest.fn(),
|
|
67
|
+
getAnonymousID: jest.fn(),
|
|
68
|
+
getAttributionID: jest.fn(),
|
|
69
|
+
getUserID: jest.fn(),
|
|
70
|
+
AppEventParams: mockAppEventParams,
|
|
71
|
+
AppEvents: mockAppEvents,
|
|
72
|
+
},
|
|
73
|
+
LoginManager: {
|
|
74
|
+
logInWithPermissions: jest.fn(),
|
|
75
|
+
logOut: jest.fn(),
|
|
76
|
+
},
|
|
77
|
+
Settings: {
|
|
78
|
+
initializeSDK: jest.fn(),
|
|
79
|
+
},
|
|
80
|
+
LoginButton,
|
|
81
|
+
};
|
package/jest/setup.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
/**
|
|
9
|
+
* This source code is licensed under the license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*
|
|
12
|
+
* @format
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Aggregated Event Measurement (AEM) for iOS apps allows for the measurement of app events
|
|
16
|
+
* from iOS 14.5+ users who have opted out of app tracking.
|
|
17
|
+
*
|
|
18
|
+
* @ref https://developers.facebook.com/docs/app-events/guides/aggregated-event-measurement/
|
|
19
|
+
*/
|
|
20
|
+
var _default = exports.default = {
|
|
21
|
+
/**
|
|
22
|
+
* Log AEM event, event names for AEM must match event names you used in app event logging.
|
|
23
|
+
*
|
|
24
|
+
* *This method will bypass if platform isn't iOS*
|
|
25
|
+
*
|
|
26
|
+
* **Make sure you also handle the DeepLink URL with AEM**
|
|
27
|
+
*
|
|
28
|
+
* @ref https://developers.facebook.com/docs/app-events/guides/aggregated-event-measurement/
|
|
29
|
+
* @platform iOS
|
|
30
|
+
*/
|
|
31
|
+
logAEMEvent: (eventName, value, currency, otherParameters) => {
|
|
32
|
+
// AEM is currently only for iOS
|
|
33
|
+
if (_reactNative.Platform.OS !== 'ios') {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
_reactNative.NativeModules.FBSDKAEMReporter.recordAndUpdateEvent(eventName, value, currency, otherParameters);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=FBAEMReporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","logAEMEvent","eventName","value","currency","otherParameters","Platform","OS","NativeModules","FBSDKAEMReporter","recordAndUpdateEvent"],"sourceRoot":"../../src","sources":["FBAEMReporter.ts"],"mappings":";;;;;;AAMA,IAAAA,YAAA,GAAAC,OAAA;AANA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AALA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMe;EACb;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,WAAW,EAAEA,CACXC,SAAiB,EACjBC,KAAa,EACbC,QAAiB,EACjBC,eAAiD,KAC9C;IACH;IACA,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzB;IACF;IAEAC,0BAAa,CAACC,gBAAgB,CAACC,oBAAoB,CACjDR,SAAS,EACTC,KAAK,EACLC,QAAQ,EACRC,eACF,CAAC;EACH;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
/**
|
|
9
|
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
|
10
|
+
*
|
|
11
|
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
|
|
12
|
+
* copy, modify, and distribute this software in source code or binary form for use
|
|
13
|
+
* in connection with the web services and APIs provided by Facebook.
|
|
14
|
+
*
|
|
15
|
+
* As with any software that integrates with the Facebook platform, your use of
|
|
16
|
+
* this software is subject to the Facebook Developer Principles and Policies
|
|
17
|
+
* [http://developers.facebook.com/policy/]. This copyright notice shall be
|
|
18
|
+
* included in all copies or substantial portions of the software.
|
|
19
|
+
*
|
|
20
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
22
|
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
23
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
24
|
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
25
|
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
+
*
|
|
27
|
+
* @format
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
const AccessToken = _reactNative.NativeModules.FBAccessToken;
|
|
31
|
+
const eventEmitter = new _reactNative.NativeEventEmitter(AccessToken);
|
|
32
|
+
/**
|
|
33
|
+
* Represents an immutable access token for using Facebook services.
|
|
34
|
+
*/
|
|
35
|
+
class FBAccessToken {
|
|
36
|
+
/**
|
|
37
|
+
* The access token string.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The known granted permissions.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The known declined permissions.
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The known expired permissions.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The app ID.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The user ID.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The expiration time of the access token.
|
|
62
|
+
* The value is the number of milliseconds since Jan. 1, 1970, midnight GMT.
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The last refresh time of the access token.
|
|
67
|
+
* The value is the number of milliseconds since Jan. 1, 1970, midnight GMT.
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The data access expiration time of the access token.
|
|
72
|
+
* The value is the number of milliseconds since Jan. 1, 1970, midnight GMT.
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The source of access token.
|
|
77
|
+
* @platform android
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
constructor(tokenMap) {
|
|
81
|
+
this.accessToken = tokenMap.accessToken;
|
|
82
|
+
this.permissions = tokenMap.permissions;
|
|
83
|
+
this.declinedPermissions = tokenMap.declinedPermissions;
|
|
84
|
+
this.expiredPermissions = tokenMap.expiredPermissions;
|
|
85
|
+
this.applicationID = tokenMap.applicationID;
|
|
86
|
+
this.userID = tokenMap.userID;
|
|
87
|
+
this.expirationTime = tokenMap.expirationTime;
|
|
88
|
+
this.lastRefreshTime = tokenMap.lastRefreshTime;
|
|
89
|
+
this.dataAccessExpirationTime = tokenMap.dataAccessExpirationTime;
|
|
90
|
+
this.accessTokenSource = tokenMap.accessTokenSource;
|
|
91
|
+
Object.freeze(this);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Getter for the access token that is current for the application.
|
|
96
|
+
*/
|
|
97
|
+
static getCurrentAccessToken() {
|
|
98
|
+
return new Promise(resolve => {
|
|
99
|
+
AccessToken.getCurrentAccessToken(tokenMap => {
|
|
100
|
+
if (tokenMap) {
|
|
101
|
+
resolve(new FBAccessToken(tokenMap));
|
|
102
|
+
} else {
|
|
103
|
+
resolve(null);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Setter for the access token that is current for the application.
|
|
111
|
+
*/
|
|
112
|
+
static setCurrentAccessToken(accessToken) {
|
|
113
|
+
AccessToken.setCurrentAccessToken(accessToken);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Updates the current access token with up to date permissions,
|
|
118
|
+
* and extends the expiration date, if extension is possible.
|
|
119
|
+
*/
|
|
120
|
+
static refreshCurrentAccessTokenAsync() {
|
|
121
|
+
return AccessToken.refreshCurrentAccessTokenAsync();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Adds a listener for when the access token changes. Returns a functions which removes the
|
|
126
|
+
* listener when called.
|
|
127
|
+
*/
|
|
128
|
+
static addListener(listener) {
|
|
129
|
+
const subscription = eventEmitter.addListener('fbsdk.accessTokenDidChange', tokenMap => {
|
|
130
|
+
if (tokenMap) {
|
|
131
|
+
listener(new FBAccessToken(tokenMap));
|
|
132
|
+
} else {
|
|
133
|
+
listener(null);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return () => subscription.remove();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Gets the date at which the access token expires. The value is the number of
|
|
141
|
+
* milliseconds since Jan. 1, 1970, midnight GMT.
|
|
142
|
+
*/
|
|
143
|
+
getExpires() {
|
|
144
|
+
return this.expirationTime;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Get the list of permissions associated with this access token. Note that the most up-to-date
|
|
149
|
+
* list of permissions is maintained by Facebook, so this list may be outdated if permissions
|
|
150
|
+
* have been added or removed since the time the AccessToken object was created. See
|
|
151
|
+
* https://developers.facebook.com/docs/reference/login/#permissions for details.
|
|
152
|
+
*/
|
|
153
|
+
getPermissions() {
|
|
154
|
+
return this.permissions;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Gets the list of permissions declined by the user with this access token. It represents the
|
|
159
|
+
* entire set of permissions that have been requested and declined. Note that the most
|
|
160
|
+
* up-to-date list of permissions is maintained by Facebook, so this list may be outdated if
|
|
161
|
+
* permissions have been granted or declined since the last time an AccessToken object was
|
|
162
|
+
* created. See https://developers.facebook.com/docs/reference/login/#permissions for details.
|
|
163
|
+
*/
|
|
164
|
+
getDeclinedPermissions() {
|
|
165
|
+
return this.declinedPermissions;
|
|
166
|
+
}
|
|
167
|
+
getExpiredPermissions() {
|
|
168
|
+
return this.expiredPermissions;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Gets the date at which the token was last refreshed. Since tokens expire, the Facebook SDK
|
|
173
|
+
* will attempt to renew them periodically. The value is the number of milliseconds since
|
|
174
|
+
* Jan. 1, 1970, midnight GMT.
|
|
175
|
+
*/
|
|
176
|
+
getLastRefresh() {
|
|
177
|
+
return this.lastRefreshTime;
|
|
178
|
+
}
|
|
179
|
+
getDataAccessExpiration() {
|
|
180
|
+
return this.dataAccessExpirationTime;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Gets the ID of the Facebook Application associated with this access token.
|
|
185
|
+
*/
|
|
186
|
+
getApplicationId() {
|
|
187
|
+
return this.applicationID;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Gets user ID associated with this access token.
|
|
192
|
+
*/
|
|
193
|
+
getUserId() {
|
|
194
|
+
return this.userID;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
var _default = exports.default = FBAccessToken;
|
|
198
|
+
//# sourceMappingURL=FBAccessToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","AccessToken","NativeModules","FBAccessToken","eventEmitter","NativeEventEmitter","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","_default","exports","default"],"sourceRoot":"../../src","sources":["FBAccessToken.ts"],"mappings":";;;;;;AAqBA,IAAAA,YAAA,GAAAC,OAAA;AArBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,MAAMC,WAAW,GAAGC,0BAAa,CAACC,aAAa;AAE/C,MAAMC,YAAY,GAAG,IAAIC,+BAAkB,CAACJ,WAAW,CAAC;AAexD;AACA;AACA;AACA,MAAME,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;;EAGEG,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,QAAQ,CAACM,MAAM;IAC7B,IAAI,CAACC,cAAc,GAAGP,QAAQ,CAACO,c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;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;AAAC,IAAAwB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcpC,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _validate = require("./util/validate");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
|
11
|
+
*
|
|
12
|
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
|
|
13
|
+
* copy, modify, and distribute this software in source code or binary form for use
|
|
14
|
+
* in connection with the web services and APIs provided by Facebook.
|
|
15
|
+
*
|
|
16
|
+
* As with any software that integrates with the Facebook platform, your use of
|
|
17
|
+
* this software is subject to the Facebook Developer Principles and Policies
|
|
18
|
+
* [http://developers.facebook.com/policy/]. This copyright notice shall be
|
|
19
|
+
* included in all copies or substantial portions of the software.
|
|
20
|
+
*
|
|
21
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
23
|
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
24
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
25
|
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
26
|
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
27
|
+
*
|
|
28
|
+
* @format
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
const AppEventsLogger = _reactNative.NativeModules.FBAppEventsLogger;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Controls when an AppEventsLogger sends log events to the server
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Specifies product availability for Product Catalog product item update
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Specifies product condition for Product Catalog product item update
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Info about a user to increase chances of matching a Facebook user.
|
|
47
|
+
* See https://developers.facebook.com/docs/app-events/advanced-matching for
|
|
48
|
+
* more info about the expected format of each field.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
const {
|
|
52
|
+
AppEvents,
|
|
53
|
+
AppEventParams
|
|
54
|
+
} = AppEventsLogger?.getConstants() || {};
|
|
55
|
+
var _default = exports.default = {
|
|
56
|
+
/**
|
|
57
|
+
* Sets the current event flushing behavior specifying when events
|
|
58
|
+
* are sent back to Facebook servers.
|
|
59
|
+
*/
|
|
60
|
+
setFlushBehavior(flushBehavior) {
|
|
61
|
+
AppEventsLogger.setFlushBehavior(flushBehavior);
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* Logs an event with eventName and optional arguments.
|
|
65
|
+
* This function supports the following usage:
|
|
66
|
+
* logEvent(eventName: string);
|
|
67
|
+
* logEvent(eventName: string, valueToSum: number);
|
|
68
|
+
* logEvent(eventName: string, parameters: {[key:string]:string|number});
|
|
69
|
+
* logEvent(eventName: string, valueToSum: number, parameters: {[key:string]:string|number});
|
|
70
|
+
* See https://developers.facebook.com/docs/app-events/android for detail.
|
|
71
|
+
*/
|
|
72
|
+
logEvent(eventName, ...args) {
|
|
73
|
+
let valueToSum = 0;
|
|
74
|
+
if (typeof args[0] === 'number') {
|
|
75
|
+
valueToSum = Number(args.shift());
|
|
76
|
+
}
|
|
77
|
+
let parameters = null;
|
|
78
|
+
if (typeof args[0] === 'object') {
|
|
79
|
+
parameters = args[0];
|
|
80
|
+
}
|
|
81
|
+
AppEventsLogger.logEvent(eventName, valueToSum, parameters);
|
|
82
|
+
},
|
|
83
|
+
/**
|
|
84
|
+
* Logs a purchase. See http://en.wikipedia.org/wiki/ISO_4217 for currencyCode.
|
|
85
|
+
*/
|
|
86
|
+
logPurchase(purchaseAmount, currencyCode, parameters) {
|
|
87
|
+
AppEventsLogger.logPurchase(purchaseAmount, currencyCode, parameters);
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* Logs an app event that tracks that the application was open via Push Notification.
|
|
91
|
+
*/
|
|
92
|
+
logPushNotificationOpen(payload) {
|
|
93
|
+
AppEventsLogger.logPushNotificationOpen(payload);
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* Uploads product catalog product item as an app event
|
|
97
|
+
* @param itemID – Unique ID for the item. Can be a variant for a product. Max size is 100.
|
|
98
|
+
* @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
|
|
99
|
+
* @param condition – Product condition: new, refurbished or used.
|
|
100
|
+
* @param description – Short text describing product. Max size is 5000.
|
|
101
|
+
* @param imageLink – Link to item image used in ad.
|
|
102
|
+
* @param link – Link to merchant's site where someone can buy the item.
|
|
103
|
+
* @param title – Title of item.
|
|
104
|
+
* @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).
|
|
105
|
+
* @param currency – Currency used to specify the amount.
|
|
106
|
+
* @param gtin – Global Trade Item Number including UPC, EAN, JAN and ISBN
|
|
107
|
+
* @param mpn – Unique manufacture ID for product
|
|
108
|
+
* @param brand – Name of the brand Note: Either gtin, mpn or brand is required.
|
|
109
|
+
* @param parameters – Optional fields for deep link specification.
|
|
110
|
+
*/
|
|
111
|
+
logProductItem(itemID, availability, condition, description, imageLink, link, title, priceAmount, currency, gtin, mpn, brand, parameters) {
|
|
112
|
+
if (!(0, _validate.isDefined)(itemID) || !(0, _validate.isString)(itemID)) {
|
|
113
|
+
throw new Error("logProductItem expected 'itemID' to be a string");
|
|
114
|
+
}
|
|
115
|
+
if (!(0, _validate.isDefined)(availability) || !(0, _validate.isOneOf)(availability, ['in_stock', 'out_of_stock', 'preorder', 'avaliable_for_order', 'discontinued'])) {
|
|
116
|
+
throw new Error("logProductItem expected 'availability' to be one of 'in_stock' | 'out_of_stock' | 'preorder' | 'avaliable_for_order' | 'discontinued'");
|
|
117
|
+
}
|
|
118
|
+
if (!(0, _validate.isDefined)(condition) || !(0, _validate.isOneOf)(condition, ['new', 'refurbished', 'used'])) {
|
|
119
|
+
throw new Error("logProductItem expected 'condition' to be one of 'new' | 'refurbished' | 'used'");
|
|
120
|
+
}
|
|
121
|
+
if (!(0, _validate.isDefined)(description) || !(0, _validate.isString)(description)) {
|
|
122
|
+
throw new Error("logProductItem expected 'description' to be a string");
|
|
123
|
+
}
|
|
124
|
+
if (!(0, _validate.isDefined)(imageLink) || !(0, _validate.isString)(imageLink)) {
|
|
125
|
+
throw new Error("logProductItem expected 'imageLink' to be a string");
|
|
126
|
+
}
|
|
127
|
+
if (!(0, _validate.isDefined)(link) || !(0, _validate.isString)(link)) {
|
|
128
|
+
throw new Error("logProductItem expected 'link' to be a string");
|
|
129
|
+
}
|
|
130
|
+
if (!(0, _validate.isDefined)(title) || !(0, _validate.isString)(title)) {
|
|
131
|
+
throw new Error("logProductItem expected 'title' to be a string");
|
|
132
|
+
}
|
|
133
|
+
if (!(0, _validate.isDefined)(priceAmount) || !(0, _validate.isNumber)(priceAmount)) {
|
|
134
|
+
throw new Error("logProductItem expected 'priceAmount' to be a number");
|
|
135
|
+
}
|
|
136
|
+
if (!(0, _validate.isDefined)(currency) || !(0, _validate.isString)(currency)) {
|
|
137
|
+
throw new Error("logProductItem expected 'currency' to be a string");
|
|
138
|
+
}
|
|
139
|
+
if (!(0, _validate.isDefined)(gtin) && !(0, _validate.isDefined)(mpn) && !(0, _validate.isDefined)(brand)) {
|
|
140
|
+
throw new Error('logProductItem expected either gtin, mpn or brand to be defined');
|
|
141
|
+
}
|
|
142
|
+
AppEventsLogger.logProductItem(itemID, availability, condition, description, imageLink, link, title, priceAmount, currency, gtin, mpn, brand, parameters);
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* Explicitly kicks off flushing of events to Facebook.
|
|
146
|
+
*/
|
|
147
|
+
flush() {
|
|
148
|
+
AppEventsLogger.flush();
|
|
149
|
+
},
|
|
150
|
+
/**
|
|
151
|
+
* Sets a custom user ID to associate with all app events.
|
|
152
|
+
* The userID is persisted until this method is called again with a null userId
|
|
153
|
+
*/
|
|
154
|
+
setUserID(userID) {
|
|
155
|
+
AppEventsLogger.setUserID(userID);
|
|
156
|
+
},
|
|
157
|
+
/**
|
|
158
|
+
* Clears the currently set user id.
|
|
159
|
+
* @deprecated use setUserID(null) instead
|
|
160
|
+
*/
|
|
161
|
+
clearUserID() {
|
|
162
|
+
AppEventsLogger.clearUserID();
|
|
163
|
+
},
|
|
164
|
+
/**
|
|
165
|
+
* Returns user id or null if not set
|
|
166
|
+
*/
|
|
167
|
+
async getUserID() {
|
|
168
|
+
return await AppEventsLogger.getUserID();
|
|
169
|
+
},
|
|
170
|
+
/**
|
|
171
|
+
* Returns anonymous id or null if not set
|
|
172
|
+
*/
|
|
173
|
+
async getAnonymousID() {
|
|
174
|
+
return await AppEventsLogger.getAnonymousID();
|
|
175
|
+
},
|
|
176
|
+
/**
|
|
177
|
+
* Returns advertiser id or null if not set
|
|
178
|
+
*/
|
|
179
|
+
async getAdvertiserID() {
|
|
180
|
+
return await AppEventsLogger.getAdvertiserID();
|
|
181
|
+
},
|
|
182
|
+
/**
|
|
183
|
+
* Returns advertiser id or null if not set.
|
|
184
|
+
* @platform android
|
|
185
|
+
*/
|
|
186
|
+
async getAttributionID() {
|
|
187
|
+
if (_reactNative.Platform.OS === 'ios') {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
return await AppEventsLogger.getAttributionID();
|
|
191
|
+
},
|
|
192
|
+
/**
|
|
193
|
+
* Set additional data about the user to increase chances of matching a Facebook user.
|
|
194
|
+
*/
|
|
195
|
+
setUserData(userData) {
|
|
196
|
+
AppEventsLogger.setUserData(userData);
|
|
197
|
+
},
|
|
198
|
+
/**
|
|
199
|
+
* For iOS only, sets and sends device token to register the current application for push notifications.
|
|
200
|
+
* @platform ios
|
|
201
|
+
*/
|
|
202
|
+
setPushNotificationsDeviceToken(deviceToken) {
|
|
203
|
+
AppEventsLogger.setPushNotificationsDeviceToken(deviceToken);
|
|
204
|
+
},
|
|
205
|
+
/**
|
|
206
|
+
* For Android only, sets and sends registration id to register the current app for push notifications.
|
|
207
|
+
* @platform Android
|
|
208
|
+
*/
|
|
209
|
+
setPushNotificationsRegistrationId(registrationId) {
|
|
210
|
+
AppEventsLogger.setPushNotificationsRegistrationId(registrationId);
|
|
211
|
+
},
|
|
212
|
+
/**
|
|
213
|
+
* Predefined event names for logging events common to many apps.
|
|
214
|
+
*/
|
|
215
|
+
AppEvents,
|
|
216
|
+
/**
|
|
217
|
+
* Predefined event name parameters for common additional information to accompany events logged through the `logEvent`.
|
|
218
|
+
*/
|
|
219
|
+
AppEventParams
|
|
220
|
+
};
|
|
221
|
+
//# sourceMappingURL=FBAppEventsLogger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_validate","require","_reactNative","AppEventsLogger","NativeModules","FBAppEventsLogger","AppEvents","AppEventParams","getConstants","_default","exports","default","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","isDefined","isString","Error","isOneOf","isNumber","flush","setUserID","userID","clearUserID","getUserID","getAnonymousID","getAdvertiserID","getAttributionID","Platform","OS","setUserData","userData","setPushNotificationsDeviceToken","deviceToken","setPushNotificationsRegistrationId","registrationId"],"sourceRoot":"../../src","sources":["FBAppEventsLogger.ts"],"mappings":";;;;;;AAqBA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,MAAME,eAAe,GAAGC,0BAAa,CAACC,iBAAiB;;AAEvD;AACA;AACA;;AAYA;AACA;AACA;;AAuBA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AA2DA,MAAM;EACJC,SAAS;EACTC;AACoD,CAAC,GACrDJ,eAAe,EAAEK,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzB;EACb;AACF;AACA;AACA;EACEC,gBAAgBA,CAACC,aAAqC,EAAE;IACtDV,eAAe,CAACS,gBAAgB,CAACC,aAAa,CAAC;EACjD,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA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C,CAAC;EACjD,CAAC;EAED;AACF;AACA;EACEG,WAAWA,CAACC,QAAkB,EAAE;IAC9BpD,eAAe,CAACmD,WAAW,CAACC,QAAQ,CAAC;EACvC,CAAC;EAED;AACF;AACA;AACA;EACEC,+BAA+BA,CAACC,WAAmB,EAAE;IACnDtD,eAAe,CAACqD,+BAA+B,CAACC,WAAW,CAAC;EAC9D,CAAC;EAED;AACF;AACA;AACA;EACEC,kCAAkCA,CAACC,cAAsB,EAAE;IACzDxD,eAAe,CAACuD,kCAAkC,CAACC,cAAc,CAAC;EACpE,CAAC;EAED;AACF;AACA;EACErD,SAAS;EAET;AACF;AACA;EACEC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
/**
|
|
9
|
+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
|
10
|
+
*
|
|
11
|
+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
|
|
12
|
+
* copy, modify, and distribute this software in source code or binary form for use
|
|
13
|
+
* in connection with the web services and APIs provided by Facebook.
|
|
14
|
+
*
|
|
15
|
+
* As with any software that integrates with the Facebook platform, your use of
|
|
16
|
+
* this software is subject to the Facebook Developer Principles and Policies
|
|
17
|
+
* [http://developers.facebook.com/policy/]. This copyright notice shall be
|
|
18
|
+
* included in all copies or substantial portions of the software.
|
|
19
|
+
*
|
|
20
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
22
|
+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
23
|
+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
24
|
+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
25
|
+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
+
*
|
|
27
|
+
* @format
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
const AppLink = _reactNative.NativeModules.FBAppLink;
|
|
31
|
+
var _default = exports.default = {
|
|
32
|
+
fetchDeferredAppLink() {
|
|
33
|
+
return AppLink.fetchDeferredAppLink();
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=FBAppLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","AppLink","NativeModules","FBAppLink","_default","exports","default","fetchDeferredAppLink"],"sourceRoot":"../../src","sources":["FBAppLink.ts"],"mappings":";;;;;;AAqBA,IAAAA,YAAA,GAAAC,OAAA;AArBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,MAAMC,OAAO,GAAGC,0BAAa,CAACC,SAAS;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzB;EACbC,oBAAoBA,CAAA,EAA2B;IAC7C,OAAON,OAAO,CAACM,oBAAoB,CAAC,CAAC;EACvC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
/**
|
|
9
|
+
* @format
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const AuthenticationToken = _reactNative.NativeModules.FBAuthenticationToken;
|
|
13
|
+
/**
|
|
14
|
+
* Represents an immutable access token for using Facebook services.
|
|
15
|
+
*/
|
|
16
|
+
class FBAuthenticationToken {
|
|
17
|
+
/**
|
|
18
|
+
The raw token string from the authentication response
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
The nonce from the decoded authentication response
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
The graph domain where the user is authenticated.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
constructor(tokenMap) {
|
|
30
|
+
this.authenticationToken = tokenMap.authenticationToken;
|
|
31
|
+
this.nonce = tokenMap.nonce;
|
|
32
|
+
this.graphDomain = tokenMap.graphDomain;
|
|
33
|
+
Object.freeze(this);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Getter for the authentication token
|
|
38
|
+
*/
|
|
39
|
+
static getAuthenticationTokenIOS() {
|
|
40
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
41
|
+
return Promise.resolve(null);
|
|
42
|
+
}
|
|
43
|
+
return new Promise(resolve => {
|
|
44
|
+
AuthenticationToken.getAuthenticationToken(tokenMap => {
|
|
45
|
+
if (tokenMap) {
|
|
46
|
+
resolve(new FBAuthenticationToken(tokenMap));
|
|
47
|
+
} else {
|
|
48
|
+
resolve(null);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
var _default = exports.default = FBAuthenticationToken;
|
|
55
|
+
//# sourceMappingURL=FBAuthenticationToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","AuthenticationToken","NativeModules","FBAuthenticationToken","constructor","tokenMap","authenticationToken","nonce","graphDomain","Object","freeze","getAuthenticationTokenIOS","Platform","OS","Promise","resolve","getAuthenticationToken","_default","exports","default"],"sourceRoot":"../../src","sources":["FBAuthenticationToken.ts"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,mBAAmB,GAAGC,0BAAa,CAACC,qBAAqB;AAQ/D;AACA;AACA;AACA,MAAMA,qBAAqB,CAAC;EAC1B;AACF;AACA;;EAGE;AACF;AACA;;EAGE;AACF;AACA;;EAGEC,WAAWA,CAACC,QAAgC,EAAE;IAC5C,IAAI,CAACC,mBAAmB,GAAGD,QAAQ,CAACC,mBAAmB;IACvD,IAAI,CAACC,KAAK,GAAGF,QAAQ,CAACE,KAAK;IAC3B,IAAI,CAACC,WAAW,GAAGH,QAAQ,CAACG,WAAW;IACvCC,MAAM,CAACC,MAAM,CAAC,IAAI,CAAC;EACrB;;EAEA;AACF;AACA;EACE,OAAOC,yBAAyBA,CAAA,EAAG;IACjC,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;MAC7B,OAAOC,OAAO,CAACC,OAAO,CAAC,IAAI,CAAC;IAC9B;IACA,OAAO,IAAID,OAAO,CAAgCC,OAAO,IAAK;MAC5Dd,mBAAmB,CAACe,sBAAsB,CACvCX,QAAgC,IAAK;QACpC,IAAIA,QAAQ,EAAE;UACZU,OAAO,CAAC,IAAIZ,qBAAqB,CAACE,QAAQ,CAAC,CAAC;QAC9C,CAAC,MAAM;UACLU,OAAO,CAAC,IAAI,CAAC;QACf;MACF,CACF,CAAC;IACH,CAAC,CAAC;EACJ;AACF;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEchB,qBAAqB","ignoreList":[]}
|