diff --git a/examples/client/Locomotion/ios/Podfile.lock b/examples/client/Locomotion/ios/Podfile.lock index abe752b0e..343f89091 100644 --- a/examples/client/Locomotion/ios/Podfile.lock +++ b/examples/client/Locomotion/ios/Podfile.lock @@ -1,4 +1,7 @@ PODS: + - AppsFlyerFramework (6.13.1): + - AppsFlyerFramework/Main (= 6.13.1) + - AppsFlyerFramework/Main (6.13.1) - boost (1.76.0) - BVLinearGradient (2.6.2): - React-Core @@ -318,6 +321,9 @@ PODS: - React-jsinspector (0.68.5) - React-logger (0.68.5): - glog + - react-native-appsflyer (6.13.1): + - AppsFlyerFramework (= 6.13.1) + - React - react-native-background-timer (2.4.1): - React-Core - react-native-carrier-info (1.1.2): @@ -537,6 +543,7 @@ DEPENDENCIES: - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) - React-logger (from `../node_modules/react-native/ReactCommon/logger`) + - react-native-appsflyer (from `../node_modules/react-native-appsflyer`) - react-native-background-timer (from `../node_modules/react-native-background-timer`) - react-native-carrier-info (from `../node_modules/react-native-carrier-info`) - react-native-config (from `../node_modules/react-native-config`) @@ -584,6 +591,7 @@ DEPENDENCIES: SPEC REPOS: trunk: + - AppsFlyerFramework - Firebase - FirebaseCore - FirebaseCoreDiagnostics @@ -652,6 +660,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/jsinspector" React-logger: :path: "../node_modules/react-native/ReactCommon/logger" + react-native-appsflyer: + :path: "../node_modules/react-native-appsflyer" react-native-background-timer: :path: "../node_modules/react-native-background-timer" react-native-carrier-info: @@ -742,6 +752,7 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: + AppsFlyerFramework: 971521cf5b890c2afeab2f2c91734547b8b169ca boost: a7c83b31436843459a1961bfd74b96033dc77234 BVLinearGradient: 34a999fda29036898a09c6a6b728b0b4189e1a44 DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 @@ -779,6 +790,7 @@ SPEC CHECKSUMS: React-jsiexecutor: 45c0496ca8cef6b02d9fa0274c25cf458fe91a56 React-jsinspector: eb202e43b3879aba9a14f3f65788aec85d4e1ea9 React-logger: 98f663b292a60967ebbc6d803ae96c1381183b6d + react-native-appsflyer: 7cf84f144123de4dd2c772d0be8e16ea6a66f681 react-native-background-timer: 117fffdc9b0d6f144444bb49029f94275a45fdb5 react-native-carrier-info: 1e6299256bd7ceaa36f851b30e071b2b4fc406ad react-native-config: bcafda5b4c51491ee1b0e1d0c4e3905bc7b56c1b @@ -831,6 +843,6 @@ SPEC CHECKSUMS: StripeUICore: 08c1efbd7e3c54ee7fa74334a37a1d4c08ba944d Yoga: c4d61225a466f250c35c1ee78d2d0b3d41fe661c -PODFILE CHECKSUM: 42909390370d7a65830c84fab99e66e070f1b4f9 +PODFILE CHECKSUM: 3d1a03e0b2517741427327a9545b9919923582eb -COCOAPODS: 1.12.1 +COCOAPODS: 1.12.0 diff --git a/examples/client/Locomotion/package-lock.json b/examples/client/Locomotion/package-lock.json index 6cfec6e09..fa42973f2 100644 --- a/examples/client/Locomotion/package-lock.json +++ b/examples/client/Locomotion/package-lock.json @@ -7190,7 +7190,7 @@ "decamelize-keys": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "integrity": "sha512-ocLWuYzRPoS9bfiSdDd3cxvrzovVMZnRDVEzAs+hWIVXGDbHxWMECij2OBuyB/An0FFW/nLuq6Kv1i/YC5Qfzg==", "requires": { "decamelize": "^1.1.0", "map-obj": "^1.0.0" @@ -7199,7 +7199,7 @@ "map-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==" } } }, @@ -7212,7 +7212,7 @@ "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + "integrity": "sha512-hjf+xovcEn31w/EUYdTXQh/8smFL/dzYjohQGEIgjyNavaJfBY2p5F527Bo1VPATxv0VYTUC2bOcXvqFwk78Og==" }, "dedent": { "version": "0.6.0", @@ -8425,7 +8425,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" } } }, @@ -14460,6 +14460,11 @@ "prop-types": "^15.7.2" } }, + "react-native-appsflyer": { + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/react-native-appsflyer/-/react-native-appsflyer-6.13.1.tgz", + "integrity": "sha512-isJHrClob2IKGkhHWDagW5YrYWcoFRRD8+2mc/i1mLVFUtRFE4p6mx1I/z86JH9dq7xdiKZaD2mQXx60A6ruEQ==" + }, "react-native-background-timer": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/react-native-background-timer/-/react-native-background-timer-2.4.1.tgz", @@ -15701,7 +15706,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" } } }, @@ -16831,7 +16836,7 @@ "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==" }, "word-wrap": { "version": "1.2.3", diff --git a/examples/client/Locomotion/package.json b/examples/client/Locomotion/package.json index 7fa9978a6..85f765e9c 100644 --- a/examples/client/Locomotion/package.json +++ b/examples/client/Locomotion/package.json @@ -56,6 +56,7 @@ "react": "17.0.2", "react-i18next": "^11.7.2", "react-native": "^0.68.5", + "react-native-appsflyer": "^6.13.1", "react-native-background-timer": "^2.4.1", "react-native-carrier-info": "^1.1.2", "react-native-config": "^1.4.5", diff --git a/examples/client/Locomotion/src/LocomotionRouter.js b/examples/client/Locomotion/src/LocomotionRouter.js index ef527a10f..aa684562a 100644 --- a/examples/client/Locomotion/src/LocomotionRouter.js +++ b/examples/client/Locomotion/src/LocomotionRouter.js @@ -17,6 +17,7 @@ import MessagesProvider from './context/messages'; import CancellationReasonsProvider from './context/cancellation-reasons'; import VirtualStationsProvider from './context/virtualStationsContext'; import Mixpanel from './services/Mixpanel'; +import initAppsFlyer from './services/appsflyer'; LogBox.ignoreAllLogs(); @@ -49,6 +50,7 @@ export default (props) => { useEffect(() => { sendAppLaunchEvent(); crashlytics().log('App mounted.'); + initAppsFlyer(); enableScreens(false); const listener = registerAppStateListener(); return () => { diff --git a/examples/client/Locomotion/src/services/appsflyer.ts b/examples/client/Locomotion/src/services/appsflyer.ts new file mode 100644 index 000000000..5d13574f5 --- /dev/null +++ b/examples/client/Locomotion/src/services/appsflyer.ts @@ -0,0 +1,36 @@ +import { Platform } from 'react-native'; +import appsFlyer from 'react-native-appsflyer'; +import Config from 'react-native-config'; + +const LOG_PREFIX = 'APPSFLYER INTEG'; +const { ANDROID_APPSFLYER_DEV_KEY, IOS_APPSFLYER_DEV_KEY, IOS_APP_ID } = Config; +const PLATFORM_CONFIG: any = { + android: { + devKey: ANDROID_APPSFLYER_DEV_KEY, + }, + ios: { + devKey: IOS_APPSFLYER_DEV_KEY, + appId: IOS_APP_ID, + timeToWaitForATTUserAuthorization: 10, // for iOS 14.5 + }, +}; + +export default () => { + const config = PLATFORM_CONFIG[Platform.OS]; + if (config?.devKey) { + appsFlyer.initSdk( + { + ...config, + isDebug: false, + onInstallConversionDataListener: true, // Optional + onDeepLinkListener: true, // Optional + }, + (result) => { + console.log(`${LOG_PREFIX} SUCCESS`, result); + }, + (error) => { + console.error(`${LOG_PREFIX} ERROR`, error); + }, + ); + } +};