Skip to content

Commit

Permalink
Merge pull request #8248 from LedgerHQ/feat/llm-remove-react-native-a…
Browse files Browse the repository at this point in the history
…djust-sdk

➖ LLM - Remove Adjust
  • Loading branch information
cgrellard-ledger authored Oct 31, 2024
2 parents 901cdd5 + de397a9 commit 714fc67
Show file tree
Hide file tree
Showing 22 changed files with 10 additions and 150 deletions.
5 changes: 5 additions & 0 deletions .changeset/clean-nails-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": minor
---

LLM - Remove react-native-adjust SDK and all adjust related parts from the codebase
1 change: 0 additions & 1 deletion apps/ledger-live-desktop/src/config/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ export const urls = {
"https://cdn.figment.io/legal/Current%20Ledger_Online%20Staking%20Delgation%20Services%20Agreement.pdf",
ens: "https://support.ledger.com/article/9710787581469-zd",
ledgerLiveMobile: {
storeLink: "https://r354.adj.st/?adj_t=t2esmlk&adj_campaign=Ledger_Live",
appStore: "https://apps.apple.com/app/id1361671700",
playStore: "https://play.google.com/store/apps/details?id=com.ledger.live",
},
Expand Down
1 change: 0 additions & 1 deletion apps/ledger-live-mobile/.env.android.prerelease
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
APP_NAME="Ledger Live"
SENTRY_DSN=https://ea730d6c531f40679e7306c888f7fbc5@o118392.ingest.sentry.io/6723478
ANALYTICS_TOKEN=jfUZbw28ig8JpEi9DZpTUc21dKUKu1e3
ADJUST_APP_TOKEN=104p56owfekg
BRAZE_ANDROID_API_KEY="b34d1245-04d6-4209-9580-eed4ec82cf17"
BRAZE_IOS_API_KEY="93d6248d-f2e9-4255-84bc-6b551b7afcd2"
BRAZE_CUSTOM_ENDPOINT="sdk.fra-02.braze.eu"
1 change: 0 additions & 1 deletion apps/ledger-live-mobile/.env.android.release
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
APP_NAME="Ledger Live"
SENTRY_DSN=https://bfd61f321b4144ffbce693aa6c6be9d0@o118392.ingest.sentry.io/6505213
ANALYTICS_TOKEN=jfUZbw28ig8JpEi9DZpTUc21dKUKu1e3
ADJUST_APP_TOKEN=104p56owfekg
BRAZE_ANDROID_API_KEY="b34d1245-04d6-4209-9580-eed4ec82cf17"
BRAZE_IOS_API_KEY="93d6248d-f2e9-4255-84bc-6b551b7afcd2"
BRAZE_CUSTOM_ENDPOINT="sdk.fra-02.braze.eu"
1 change: 0 additions & 1 deletion apps/ledger-live-mobile/.env.android.staging
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
APP_NAME="LL [STAGING]"
SENTRY_DSN=https://0109819a39084e718120d031def0db38@o118392.ingest.sentry.io/6619343
ANALYTICS_TOKEN=Yc026bN2XbyBhTCPDFY0VibJugAKnjmh
ADJUST_APP_TOKEN=v88jjyrsto8w
BRAZE_ANDROID_API_KEY="4ef07be0-a4ea-4f73-81a9-760e473959f3"
BRAZE_IOS_API_KEY="4d6c9f5b-823e-4ea0-8158-5359bdf89618"
BRAZE_CUSTOM_ENDPOINT="sdk.fra-02.braze.eu"
5 changes: 0 additions & 5 deletions apps/ledger-live-mobile/.env.ios.prerelease
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ APP_NAME="Ledger Live"
SENTRY_DSN=https://52a4181714f74dffa9cdf48224dba505@o118392.ingest.sentry.io/6723477
ANALYTICS_TOKEN=jfUZbw28ig8JpEi9DZpTUc21dKUKu1e3
GOOGLE_SERVICE_INFO_NAME="GoogleService-Info-Production"
ADJUST_APP_TOKEN=104p56owfekg
ADJUST_BUY_GENERIC_EVENT_ID=1sc6n8
ADJUST_BUY_NANOX_EVENT_ID=jf9r4k
ADJUST_BUY_NANOS_EVENT_ID=qn40mj
ADJUST_BUY_NANOSP_EVENT_ID=fq8lrx
BRAZE_ANDROID_API_KEY="b34d1245-04d6-4209-9580-eed4ec82cf17"
BRAZE_IOS_API_KEY="93d6248d-f2e9-4255-84bc-6b551b7afcd2"
BRAZE_CUSTOM_ENDPOINT="sdk.fra-02.braze.eu"
5 changes: 0 additions & 5 deletions apps/ledger-live-mobile/.env.ios.release
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ APP_NAME="Ledger Live"
SENTRY_DSN=https://b4ac5f291b7a48529fc7ec1f34cf57ed@o118392.ingest.sentry.io/6505205
ANALYTICS_TOKEN=jfUZbw28ig8JpEi9DZpTUc21dKUKu1e3
GOOGLE_SERVICE_INFO_NAME="GoogleService-Info-Production"
ADJUST_APP_TOKEN=104p56owfekg
ADJUST_BUY_GENERIC_EVENT_ID=1sc6n8
ADJUST_BUY_NANOX_EVENT_ID=jf9r4k
ADJUST_BUY_NANOS_EVENT_ID=qn40mj
ADJUST_BUY_NANOSP_EVENT_ID=fq8lrx
BRAZE_ANDROID_API_KEY="b34d1245-04d6-4209-9580-eed4ec82cf17"
BRAZE_IOS_API_KEY="93d6248d-f2e9-4255-84bc-6b551b7afcd2"
BRAZE_CUSTOM_ENDPOINT="sdk.fra-02.braze.eu"
5 changes: 0 additions & 5 deletions apps/ledger-live-mobile/.env.ios.staging
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ APP_NAME="LL [STAGING]"
SENTRY_DSN=https://bd8b742115104e82b9ad3686fd9fd9f2@o118392.ingest.sentry.io/6619346
ANALYTICS_TOKEN=Yc026bN2XbyBhTCPDFY0VibJugAKnjmh
GOOGLE_SERVICE_INFO_NAME="GoogleService-Info-Staging"
ADJUST_APP_TOKEN=v88jjyrsto8w
ADJUST_BUY_GENERIC_EVENT_ID=h7zcss
ADJUST_BUY_NANOX_EVENT_ID=8cykqm
ADJUST_BUY_NANOS_EVENT_ID=rocmaw
ADJUST_BUY_NANOSP_EVENT_ID=y0ku50
BRAZE_ANDROID_API_KEY="4ef07be0-a4ea-4f73-81a9-760e473959f3"
BRAZE_IOS_API_KEY="4d6c9f5b-823e-4ea0-8158-5359bdf89618"
BRAZE_CUSTOM_ENDPOINT="sdk.fra-02.braze.eu"
1 change: 0 additions & 1 deletion apps/ledger-live-mobile/.env.mock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ DISABLE_YELLOW_BOX=1
GOOGLE_SERVICE_INFO_NAME="GoogleService-Info-Testing"
MOCK_SCAN_RECIPIENT=bitcoin:3HX3Q4wgYi8nKakxv7kmdCgLWJFrFgcqEt?amount=0.001
FORCE_DEBUG_VISIBLE=1
ADJUST_APP_TOKEN=cbxft2ch7wn4
BRAZE_ANDROID_API_KEY="be5e1bc8-43f1-4864-b097-076a3c693a43"
BRAZE_IOS_API_KEY="e0a7dfaf-fc30-48f6-b998-01dbebbb73a4"
BRAZE_CUSTOM_ENDPOINT="sdk.fra-02.braze.eu"
Expand Down
4 changes: 0 additions & 4 deletions apps/ledger-live-mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,6 @@ dependencies {
// implementation 'com.brentvatne.react:react-native-video'
implementation project(':react-native-video')
implementation "androidx.appcompat:appcompat:1.0.0"

// Adjust
implementation 'com.google.android.gms:play-services-analytics:10.0.1'
implementation 'com.android.installreferrer:installreferrer:1.0'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
Expand Down
1 change: 0 additions & 1 deletion apps/ledger-live-mobile/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }

-keep class com.adjust.sdk.** { *; }
-keep class com.google.android.gms.common.ConnectionResult {
int SUCCESS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- react-native-share base64 sharing (swap history/logs export)-->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- Needed by Flipper 🐬 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Needed by Adjust and by Braze -->
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/> <!-- Needed by Adjust -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Needed by Braze -->
<uses-permission android:name="android.permission.RECORD_AUDIO" /> <!-- Needed by Live apps -->
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <!-- Required for the webview camera/audio media -->
<uses-sdk
Expand Down
15 changes: 1 addition & 14 deletions apps/ledger-live-mobile/docs/analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,7 @@ We use a lightweight opt-out analytics layer composed of different api and sdk.

These tools are targetted towards internal contributors only or with

- **_Adjust integration_** 🠒 Installs data analytics

Several dev environments are available to track installs of apps
Debug, Staging and Prod

In order to log events add this to your target build dot-env file

```
DEBUG_ADJUST_LOGS=true
```

For more details on how to work with the SDK check the adjust doc [here](https://github.com/adjust/react_native_sdk)

* **_Segment integration_** 🠒 General use analytics
- **_Segment integration_** 🠒 General use analytics

in order to track events we use segment API with specific react API

Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/e2e/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export async function launchApp() {
launchArgs: {
wsPort: port,
detoxURLBlacklistRegex:
'\\(".*sdk.*.braze.*",".*.googleapis.com/.*",".*app.adjust.*",".*clients3.google.com.*"\\)',
'\\(".*sdk.*.braze.*",".*.googleapis.com/.*",".*clients3.google.com.*"\\)',
},
languageAndLocale: {
language: "en-US",
Expand Down
12 changes: 0 additions & 12 deletions apps/ledger-live-mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
PODS:
- Adjust (4.38.0):
- Adjust/Core (= 4.38.0)
- Adjust/Core (4.38.0)
- boost (1.83.0)
- braze-react-native-sdk (8.4.0):
- BrazeKit (~> 7.7.0)
Expand Down Expand Up @@ -1112,9 +1109,6 @@ PODS:
- React-Mapbuffer (0.74.6):
- glog
- React-debug
- react-native-adjust (4.38.0):
- Adjust (= 4.38.0)
- React-Core
- react-native-biometrics (3.0.1):
- React-Core
- react-native-ble-plx (3.1.2):
Expand Down Expand Up @@ -1678,7 +1672,6 @@ DEPENDENCIES:
- React-jsitracing (from `../node_modules/react-native/ReactCommon/hermes/executor/`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
- react-native-adjust (from `../node_modules/react-native-adjust`)
- react-native-biometrics (from `../node_modules/react-native-biometrics`)
- react-native-ble-plx (from `../node_modules/react-native-ble-plx`)
- react-native-config (from `../node_modules/react-native-config`)
Expand Down Expand Up @@ -1754,7 +1747,6 @@ DEPENDENCIES:

SPEC REPOS:
trunk:
- Adjust
- BrazeKit
- BrazeLocation
- BrazeUI
Expand Down Expand Up @@ -1871,8 +1863,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/logger"
React-Mapbuffer:
:path: "../node_modules/react-native/ReactCommon"
react-native-adjust:
:path: "../node_modules/react-native-adjust"
react-native-biometrics:
:path: "../node_modules/react-native-biometrics"
react-native-ble-plx:
Expand Down Expand Up @@ -2019,7 +2009,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"

SPEC CHECKSUMS:
Adjust: c98d85594a746ff9f2bafe424c5beb6db66cd6a8
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
braze-react-native-sdk: 62de95dfbbfde54fa101a5d8c75e19ea639e4eda
BrazeKit: ee31d3b5113646cbd6ad44eafc93b14c3c3c504c
Expand Down Expand Up @@ -2082,7 +2071,6 @@ SPEC CHECKSUMS:
React-jsitracing: df84cc252a1f4bb0970f7fe13c470451b18c2cbb
React-logger: de9b65c8c7b71a663e6e99d347b1c445f5190c39
React-Mapbuffer: 766bb4d8f655d816913325b353d800debbde7209
react-native-adjust: 801fe33f0dc0097b0474f11d08572a89fa6602ce
react-native-biometrics: 352e5a794bfffc46a0c86725ea7dc62deb085bdc
react-native-ble-plx: cd7b99ddaf7c15e652c63f87a12e96c715ee3c80
react-native-config: 8f7283449bbb048902f4e764affbbf24504454af
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ledgerlivemobile/Pods-ledgerlivemobile-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/Adjust/Adjust.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/BrazeKit/BrazeKit.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/BrazeLocation/BrazeLocation.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/BrazeUI/BrazeUI.bundle",
Expand Down Expand Up @@ -498,7 +497,6 @@
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Adjust.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/BrazeKit.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/BrazeLocation.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/BrazeUI.bundle",
Expand Down
1 change: 0 additions & 1 deletion apps/ledger-live-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@
"react-i18next": "11.18.6",
"react-is": "18.2.0",
"react-native": "0.74.6",
"react-native-adjust": "4.38.0",
"react-native-android-location-services-dialog-box": "2.8.2",
"react-native-animatable": "1.4.0",
"react-native-biometrics": "3.0.1",
Expand Down
53 changes: 0 additions & 53 deletions apps/ledger-live-mobile/src/components/AdjustSetup.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions apps/ledger-live-mobile/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ import Modals from "~/screens/Modals";
import NavBarColorHandler from "~/components/NavBarColorHandler";
import { FirebaseRemoteConfigProvider } from "~/components/FirebaseRemoteConfig";
import { FirebaseFeatureFlagsProvider } from "~/components/FirebaseFeatureFlags";
import AdjustSetup from "~/components/AdjustSetup";
import { TermsAndConditionMigrateLegacyData } from "~/logic/terms";
import HookDynamicContentCards from "~/dynamicContent/useContentCards";
import PlatformAppProviderWrapper from "./PlatformAppProviderWrapper";
Expand Down Expand Up @@ -331,7 +330,6 @@ export default class Root extends Component {
<>
<SetEnvsFromSettings />
<HookSentry />
<AdjustSetup />
<SegmentSetup />
<HookNotifications />
<HookDynamicContentCards />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const linkingOptions = () => ({
prefixes: [
"ledgerlive://",
"https://ledger.com",
// FIXME: We will be fixing the universal links in this epic : https://ledgerhq.atlassian.net/browse/LIVE-14732
/**
* Adjust universal links attached to iOS Bundle ID com.ledger.live
* (local debug, prod & nightly builds)
Expand Down
31 changes: 1 addition & 30 deletions apps/ledger-live-mobile/src/screens/PurchaseDevice/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { WebViewMessageEvent } from "react-native-webview";
import { useTranslation } from "react-i18next";
import { useDispatch } from "react-redux";

import { Adjust, AdjustEvent } from "react-native-adjust";
import Config from "react-native-config";
import Button from "~/components/wrappedUi/Button";
import logger from "../../logger";
import DebugURLDrawer from "./DebugURLDrawer";
Expand Down Expand Up @@ -50,32 +48,6 @@ const PurchaseDevice = () => {
setURLDrawerOpen(true);
}, [setURLDrawerOpen]);

const handleAdjustTracking = useCallback((data: PurchaseMessage) => {
const ids = {
nanoS: Config.ADJUST_BUY_NANOS_EVENT_ID,
nanoX: Config.ADJUST_BUY_NANOX_EVENT_ID,
nanoSP: Config.ADJUST_BUY_NANOSP_EVENT_ID,
};
const id = data.value?.deviceId
? ids[data.value.deviceId as keyof typeof ids] || Config.ADJUST_BUY_GENERIC_EVENT_ID
: Config.ADJUST_BUY_GENERIC_EVENT_ID;

if (!id) {
return;
}

const revenue = data.value?.price;
const currency = data.value?.currency;

const adjustEvent = new AdjustEvent(id);

if (revenue && currency) {
adjustEvent.setRevenue(revenue, currency);
}

Adjust.trackEvent(adjustEvent);
}, []);

const handleOnboardingStates = useCallback(
(data: PurchaseMessage) => {
if (data.type === "ledgerLiveOrderSuccess") {
Expand All @@ -93,14 +65,13 @@ const PurchaseDevice = () => {
const data: PurchaseMessage = JSON.parse(event.nativeEvent.data);
setMessage(data);
setMessageDrawerOpen(true);
handleAdjustTracking(data);
handleOnboardingStates(data);
} catch (error) {
logger.critical(error as Error);
}
}
},
[handleAdjustTracking, handleOnboardingStates],
[handleOnboardingStates],
);

return (
Expand Down
8 changes: 0 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 714fc67

Please sign in to comment.