Skip to content

Commit 45367f7

Browse files
authored
[Wallet] Adjust integration (#125)
### Description This PR adds the Adjust SDK via Segment for tracking install attributions from ad campaigns. ### Other changes - Upgraded all analytics dependencies. - Clean-up the `secrets.json` file to avoid duplicating configs between networks. - Specifically all alfajores builds now use a different `SEGMENT_API_KEY` than mainnet. Up until now that wasn't the case. All analytics were going to the same Segment source. ### Tested Couldn't test the full attribution flow with the Adjust dashboard, but checked the SDK is configured correctly and events are sent. ### Related issues - Fixes celo-org/celo-monorepo#6635 ### Backwards compatibility Yes
1 parent f19d068 commit 45367f7

20 files changed

+87
-81
lines changed

packages/mobile/.env.alfajores

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ FORNO_ENABLED_INITIALLY=true
88
DEFAULT_SYNC_MODE=5
99
DEV_SETTINGS_ACTIVE_INITIALLY=false
1010
FIREBASE_ENABLED=true
11-
SECRETS_KEY=production
1211
SHOW_TESTNET_BANNER=true
1312
SHOW_GET_INVITE_LINK=true
1413
APP_BUNDLE_ID=org.celo.mobile.alfajores

packages/mobile/.env.alfajoresdev

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ SMS_RETRIEVER_APP_SIGNATURE=5yaJvJcZt2P
77
FORNO_ENABLED_INITIALLY=true
88
DEFAULT_SYNC_MODE=5
99
FIREBASE_ENABLED=true
10-
SECRETS_KEY=debug
1110
SHOW_TESTNET_BANNER=true
1211
SHOW_GET_INVITE_LINK=false
1312
DEV_SETTINGS_ACTIVE_INITIALLY=true

packages/mobile/.env.mainnet

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ FORNO_ENABLED_INITIALLY=true
88
DEFAULT_SYNC_MODE=5
99
DEV_SETTINGS_ACTIVE_INITIALLY=false
1010
FIREBASE_ENABLED=true
11-
SECRETS_KEY=production
1211
SHOW_TESTNET_BANNER=false
1312
SHOW_GET_INVITE_LINK=false
1413
APP_BUNDLE_ID=co.clabs.valora

packages/mobile/.env.mainnetdev

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ DEV_SETTINGS_ACTIVE_INITIALLY=true
1010
# Enable for true hot reloading while dev-ing UI
1111
DEV_RESTORE_NAV_STATE_ON_RELOAD=false
1212
FIREBASE_ENABLED=true
13-
SECRETS_KEY=debug
1413
SHOW_TESTNET_BANNER=false
1514
SHOW_GET_INVITE_LINK=false
1615
APP_BUNDLE_ID=co.clabs.valora.dev

packages/mobile/.env.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ DEFAULT_SYNC_MODE=5
77
DEV_SETTINGS_ACTIVE_INITIALLY=true
88
# Disable firebase b.c. google-services.json files are missing in CI
99
FIREBASE_ENABLED=false
10-
SECRETS_KEY=test
1110
SHOW_TESTNET_BANNER=false
1211
SHOW_GET_INVITE_LINK=true
1312
APP_BUNDLE_ID=org.celo.mobile.test

packages/mobile/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ e2e_pidcat_run.log
7878

7979
# keys
8080
secrets.json
81+
!__mocks__/secrets.json
8182

8283
# Branding
8384
# See scripts/sync_branding.sh
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"alfajores": {
3+
"SEGMENT_API_KEY": "SEGMENT_API_KEY",
4+
"SENTRY_URL": "SENTRY_URL",
5+
"RECAPTCHA_SITE_KEY": "RECAPTCHA_SITE_KEY",
6+
"SAFETYNET_KEY": "SAFETYNET_KEY",
7+
"MOONPAY_API_KEY": "MOONPAY_API_KEY",
8+
"BIDALI_URL": "BIDALI_URL"
9+
},
10+
"mainnet": {
11+
"SEGMENT_API_KEY": "SEGMENT_API_KEY",
12+
"SENTRY_URL": "SENTRY_URL",
13+
"RECAPTCHA_SITE_KEY": "RECAPTCHA_SITE_KEY",
14+
"SAFETYNET_KEY": "SAFETYNET_KEY",
15+
"MOONPAY_API_KEY": "MOONPAY_API_KEY",
16+
"BIDALI_URL": "BIDALI_URL"
17+
}
18+
}

packages/mobile/ios/Podfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ $RNFirebaseAsStaticFramework = true
1010
$static_framework = ['react-native-flipper', 'react-native-fast-crypto', 'FlipperKit', 'Flipper', 'Flipper-Folly',
1111
'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion',
1212
'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket',
13-
'CocoaLibEvent', 'OpenSSL-Universal']
13+
'CocoaLibEvent', 'OpenSSL-Universal',
14+
'Segment-Adjust']
1415

1516
require_relative "../../../node_modules/react-native/scripts/react_native_pods"
1617
require_relative "../../../node_modules/@react-native-community/cli-platform-ios/native_modules"

packages/mobile/ios/Podfile.lock

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
PODS:
2+
- Adjust (4.26.1):
3+
- Adjust/Core (= 4.26.1)
4+
- Adjust/Core (4.26.1)
25
- Analytics (4.1.3)
36
- boost-for-react-native (1.63.0)
47
- CeloBlockchain (0.0.319)
@@ -457,10 +460,15 @@ PODS:
457460
- React-Core (= 0.63.4)
458461
- React-cxxreact (= 0.63.4)
459462
- React-jsi (= 0.63.4)
460-
- RNAnalytics (1.3.2):
461-
- Analytics (~> 4.1)
463+
- RNAnalytics (1.4.3):
464+
- Analytics
465+
- React-Core
466+
- RNAnalyticsIntegration-Adjust (1.4.3):
467+
- Analytics
462468
- React
463-
- RNAnalyticsIntegration-Firebase (1.3.2):
469+
- RNAnalytics
470+
- Segment-Adjust
471+
- RNAnalyticsIntegration-Firebase (1.4.3):
464472
- Analytics
465473
- React
466474
- RNAnalytics
@@ -560,6 +568,9 @@ PODS:
560568
- React
561569
- RNSVG (12.1.0):
562570
- React
571+
- Segment-Adjust (3.1.0):
572+
- Adjust (~> 4.23)
573+
- Analytics
563574
- Segment-Firebase (2.7.2):
564575
- Analytics
565576
- Firebase/Core (~> 7.7)
@@ -650,6 +661,7 @@ DEPENDENCIES:
650661
- React-RCTVibration (from `../../../node_modules/react-native/Libraries/Vibration`)
651662
- ReactCommon/turbomodule/core (from `../../../node_modules/react-native/ReactCommon`)
652663
- "RNAnalytics (from `../../../node_modules/@segment/analytics-react-native`)"
664+
- "RNAnalyticsIntegration-Adjust (from `../../../node_modules/@segment/analytics-react-native-adjust`)"
653665
- "RNAnalyticsIntegration-Firebase (from `../../../node_modules/@segment/analytics-react-native-firebase`)"
654666
- "RNCAsyncStorage (from `../../../node_modules/@react-native-community/async-storage`)"
655667
- "RNCClipboard (from `../../../node_modules/@react-native-community/clipboard`)"
@@ -680,6 +692,7 @@ DEPENDENCIES:
680692

681693
SPEC REPOS:
682694
trunk:
695+
- Adjust
683696
- Analytics
684697
- boost-for-react-native
685698
- CocoaAsyncSocket
@@ -709,6 +722,7 @@ SPEC REPOS:
709722
- leveldb-library
710723
- nanopb
711724
- PromisesObjC
725+
- Segment-Adjust
712726
- Segment-Firebase
713727
- Sentry
714728
- Toast
@@ -816,6 +830,8 @@ EXTERNAL SOURCES:
816830
:path: "../../../node_modules/react-native/ReactCommon"
817831
RNAnalytics:
818832
:path: "../../../node_modules/@segment/analytics-react-native"
833+
RNAnalyticsIntegration-Adjust:
834+
:path: "../../../node_modules/@segment/analytics-react-native-adjust"
819835
RNAnalyticsIntegration-Firebase:
820836
:path: "../../../node_modules/@segment/analytics-react-native-firebase"
821837
RNCAsyncStorage:
@@ -875,6 +891,7 @@ CHECKOUT OPTIONS:
875891
:git: https://github.com/celo-org/OpenSSL-headers.git
876892

877893
SPEC CHECKSUMS:
894+
Adjust: e8f9b8b50b3d234923389f8e0077ce911cf502d8
878895
Analytics: 4c01e3e19d4be86705bad6581a1c2aa5a15a9d22
879896
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
880897
CeloBlockchain: 2b3bc8846dff06152d3fcc59c14c43c9740c0a72
@@ -953,8 +970,9 @@ SPEC CHECKSUMS:
953970
React-RCTText: 5c51df3f08cb9dedc6e790161195d12bac06101c
954971
React-RCTVibration: ae4f914cfe8de7d4de95ae1ea6cc8f6315d73d9d
955972
ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b
956-
RNAnalytics: ac18ac964dd53bac7f957994412963e8e2568c4d
957-
RNAnalyticsIntegration-Firebase: daed87b7ab56636ed0098326eb92e26fdfc198c2
973+
RNAnalytics: 43a09152058061b4096eb6cb806093e7b772b1e5
974+
RNAnalyticsIntegration-Adjust: 370a0d04cd76b0df25f1e7dac9bd1053650a8804
975+
RNAnalyticsIntegration-Firebase: 26ed5873658af8d1a0cff73d8da389a5207a3089
958976
RNCAsyncStorage: 453cd7c335ec9ba3b877e27d02238956b76f3268
959977
RNCClipboard: 546484405eaa1c8a3eccce77b8c8871242e73b20
960978
RNCMaskedView: 5a8ec07677aa885546a0d98da336457e2bea557f
@@ -979,13 +997,14 @@ SPEC CHECKSUMS:
979997
RNSentry: 51972e3fe50e2fb38ae459af8c87d61f63f364db
980998
RNShare: fea1801315aa8875d6db73a4010b14afcd568765
981999
RNSVG: ce9d996113475209013317e48b05c21ee988d42e
1000+
Segment-Adjust: 3dd5e37785aff1aed6103e4cd00ec445b5b88f12
9821001
Segment-Firebase: bc9760fe3d1d3aaa34d2f424cd0272ca39c25d82
9831002
Sentry: 388c9dc093b2fd3a264466a5c5b21e25959610a9
9841003
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
9851004
TOCropViewController: 3105367e808b7d3d886a74ff59bf4804e7d3ab38
9861005
Yoga: 4bd86afe9883422a7c4028c00e34790f560923d6
9871006
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
9881007

989-
PODFILE CHECKSUM: a0dfbf57c70298685dd1e3a2a107f65f34e48c67
1008+
PODFILE CHECKSUM: 5c928456ab5a6aa19d7d0e7ced5f0a88193670dd
9901009

9911010
COCOAPODS: 1.10.0

packages/mobile/ios/celo.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@
498498
);
499499
inputPaths = (
500500
"${PODS_ROOT}/Target Support Files/Pods-celo/Pods-celo-frameworks.sh",
501+
"${BUILT_PRODUCTS_DIR}/Adjust/Adjust.framework",
501502
"${BUILT_PRODUCTS_DIR}/CeloBlockchain/CeloBlockchain.framework",
502503
"${BUILT_PRODUCTS_DIR}/DoubleConversion/DoubleConversion.framework",
503504
"${BUILT_PRODUCTS_DIR}/FBReactNativeSpec/FBReactNativeSpec.framework",
@@ -578,6 +579,7 @@
578579
);
579580
name = "[CP] Embed Pods Frameworks";
580581
outputPaths = (
582+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Adjust.framework",
581583
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CeloBlockchain.framework",
582584
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DoubleConversion.framework",
583585
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBReactNativeSpec.framework",

0 commit comments

Comments
 (0)