From 8f04feca119785466c6e4d68c1e1030133d1de14 Mon Sep 17 00:00:00 2001 From: Justin Fiedler Date: Thu, 11 Jul 2024 18:36:53 +0000 Subject: [PATCH 1/3] fix: update ReactNative example to use Gradle 7.3 to work with latest RN --- react-native/typescript/v2/AmpliApp/android/build.gradle | 2 +- .../AmpliApp/android/gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/react-native/typescript/v2/AmpliApp/android/build.gradle b/react-native/typescript/v2/AmpliApp/android/build.gradle index 3be1031f..60ae3c29 100644 --- a/react-native/typescript/v2/AmpliApp/android/build.gradle +++ b/react-native/typescript/v2/AmpliApp/android/build.gradle @@ -13,7 +13,7 @@ buildscript { mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle:4.2.2") + classpath("com.android.tools.build:gradle:7.0.0") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/react-native/typescript/v2/AmpliApp/android/gradle/wrapper/gradle-wrapper.properties b/react-native/typescript/v2/AmpliApp/android/gradle/wrapper/gradle-wrapper.properties index a0f7639f..fbce071a 100644 --- a/react-native/typescript/v2/AmpliApp/android/gradle/wrapper/gradle-wrapper.properties +++ b/react-native/typescript/v2/AmpliApp/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 897d8bf273120f2c12023bee2461583b21f46eac Mon Sep 17 00:00:00 2001 From: Justin Fiedler Date: Thu, 11 Jul 2024 18:37:19 +0000 Subject: [PATCH 2/3] fix: update ReactNative sample to use 1.1.7 of @amplitude/analytics-react-native --- .../typescript/v2/AmpliApp/package.json | 2 +- .../typescript/v2/AmpliApp/src/App.tsx | 11 ++- react-native/typescript/v2/AmpliApp/yarn.lock | 82 +++++++++++-------- 3 files changed, 56 insertions(+), 39 deletions(-) diff --git a/react-native/typescript/v2/AmpliApp/package.json b/react-native/typescript/v2/AmpliApp/package.json index 03822fff..2f1a892a 100644 --- a/react-native/typescript/v2/AmpliApp/package.json +++ b/react-native/typescript/v2/AmpliApp/package.json @@ -10,7 +10,7 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { - "@amplitude/analytics-react-native": "^0.4.0", + "@amplitude/analytics-react-native": "1.1.7", "@react-native-async-storage/async-storage": "^1.17.9", "@segment/analytics-react-native": "^2.1.7", "@segment/sovran-react-native": "^0.2.6", diff --git a/react-native/typescript/v2/AmpliApp/src/App.tsx b/react-native/typescript/v2/AmpliApp/src/App.tsx index 5f76c265..39804b8a 100644 --- a/react-native/typescript/v2/AmpliApp/src/App.tsx +++ b/react-native/typescript/v2/AmpliApp/src/App.tsx @@ -15,8 +15,7 @@ import {Button, StyleSheet, View} from 'react-native'; import Config from 'react-native-config'; import * as amplitude from '@amplitude/analytics-react-native'; -import {ampli} from './ampli'; -import {EventWithOptionalProperties} from './ampli'; +import {ampli, EventWithOptionalProperties} from './ampli'; import LoggingPlugin from './plugins/loggingPlugin'; import SegmentPlugin from './plugins/segmentPlugin'; @@ -47,6 +46,14 @@ async function initAmpli() { /** OR Provide a specific Amplitude API key */ // ampli.load({client: {apiKey: AMPLITUDE_API_KEY}}); + /** + * OR Use your existing "default" Amplitude instance + */ + // amplitude.init(AMPLITUDE_API_KEY, undefined, { + // deviceId: 'existing-instance-device-id', + // }); + // await ampli.load({client: {instance: amplitude}}).promise; + /** * OR Use an existing Amplitude instance */ diff --git a/react-native/typescript/v2/AmpliApp/yarn.lock b/react-native/typescript/v2/AmpliApp/yarn.lock index c458557c..5d8407da 100644 --- a/react-native/typescript/v2/AmpliApp/yarn.lock +++ b/react-native/typescript/v2/AmpliApp/yarn.lock @@ -2,49 +2,47 @@ # yarn lockfile v1 -"@amplitude/analytics-client-common@^0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@amplitude/analytics-client-common/-/analytics-client-common-0.1.0.tgz#9910dd4d218a3085afa6c55393829513ed2a48b8" - integrity sha512-hbWzPd3Xr8ajw+vvgL5QJ2x6ch2IKnTwQD3IVjlnW4vkUxR+vg3+dOuMgmhobEbHRKrBYosqEr34nh1EM6BHHw== +"@amplitude/analytics-client-common@^0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@amplitude/analytics-client-common/-/analytics-client-common-0.7.0.tgz#b099a97853d8622cdb371329d5e70afc6d9dca10" + integrity sha512-fKBR5DSo6qTqFcCFnLopRdWv6Zieox3YnzyXG2Zg1hR9MDeX96GoMEwwT2VB5MPzGxE1wYW6kQPvU2C/xpn5ww== dependencies: - "@amplitude/analytics-core" "^0.9.1" - "@amplitude/analytics-types" "^0.10.0" - tslib "^2.3.1" + "@amplitude/analytics-connector" "^1.4.5" + "@amplitude/analytics-core" "^0.13.3" + "@amplitude/analytics-types" "^0.20.0" + tslib "^2.4.1" -"@amplitude/analytics-connector@1.4.5": - version "1.4.5" - resolved "https://registry.yarnpkg.com/@amplitude/analytics-connector/-/analytics-connector-1.4.5.tgz#07e9375101332bd8b6f15e39e70f31f287e87ad0" - integrity sha512-ELAP6ivg+13uSk+TOirGZE/92M+tTbeiQ/i7eXgDO4Hiy00Abf/UxO/rp9WovtxCyeFYTILrujEYxPv5cRQmFw== - dependencies: - "@amplitude/ua-parser-js" "0.7.31" +"@amplitude/analytics-connector@^1.4.5": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@amplitude/analytics-connector/-/analytics-connector-1.5.0.tgz#89a78b8c6463abe4de1d621db4af6c62f0d62b0a" + integrity sha512-T8mOYzB9RRxckzhL0NTHwdge9xuFxXEOplC8B1Y3UX3NHa3BLh7DlBUZlCOwQgMc2nxDfnSweDL5S3bhC+W90g== -"@amplitude/analytics-core@^0.9.1": - version "0.9.1" - resolved "https://registry.yarnpkg.com/@amplitude/analytics-core/-/analytics-core-0.9.1.tgz#32564c743a50ba6bfc987aa7089df80a3fa4fb6a" - integrity sha512-hktDNRBNrGsRrgYh6+j1fgFurNuuaF1nCNTg+2hcK3tYWz7iEBLKQyjQUI3sU7teJ0Z6uAGfz0kTLz+z8rIPuA== +"@amplitude/analytics-core@^0.13.3": + version "0.13.3" + resolved "https://registry.yarnpkg.com/@amplitude/analytics-core/-/analytics-core-0.13.3.tgz#c1c99751dd25ec616b6dc242d65997f83659f564" + integrity sha512-lLLmUwi78iqGsCPgd15yH488K+3FPYQ19fCdA3OemoEK9959xCzMZe/KYafQKkgZmI4ZiZLOp3pjamKWc6mcdQ== dependencies: - "@amplitude/analytics-types" "^0.10.0" - tslib "^2.3.1" + "@amplitude/analytics-types" "^0.20.0" + tslib "^2.4.1" -"@amplitude/analytics-react-native@^0.4.0": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@amplitude/analytics-react-native/-/analytics-react-native-0.4.1.tgz#92edf2e0f884c4b220fa71a8d8f4e604cd86f0d5" - integrity sha512-z9okuqj1mqJBOOCMo0XZlXbFim+ACx5k/pkrhjO/MMfM8YDSBil8cB8GsHGk3rFBSczK2BLN2mDZw1aakZ9WNg== +"@amplitude/analytics-react-native@1.1.7": + version "1.1.7" + resolved "https://registry.yarnpkg.com/@amplitude/analytics-react-native/-/analytics-react-native-1.1.7.tgz#190192ffbb97d61bba5adfda5d670a227ba77663" + integrity sha512-d8DU9dHxZE+vTlgQ6SaxiC7E2R9j60iM38DlWEKMux2qT5wkP7na5xq13jnBPOmzhtw+fRA81CLLKbgBj1he3Q== dependencies: - "@amplitude/analytics-client-common" "^0.1.0" - "@amplitude/analytics-connector" "1.4.5" - "@amplitude/analytics-core" "^0.9.1" - "@amplitude/analytics-types" "^0.10.0" + "@amplitude/analytics-client-common" "^0.7.0" + "@amplitude/analytics-core" "^0.13.3" + "@amplitude/analytics-types" "^0.20.0" "@amplitude/ua-parser-js" "^0.7.31" - "@react-native-async-storage/async-storage" "^1.17.7" - tslib "^2.3.1" + "@react-native-async-storage/async-storage" "^1.17.11" + tslib "^2.4.1" -"@amplitude/analytics-types@^0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@amplitude/analytics-types/-/analytics-types-0.10.0.tgz#60c839bfcf4c6de059d16e853c9025babb9c080e" - integrity sha512-LJ1krefs4c5udSE+oKM/LYOvrblOOVwP+ELpdNdhXt3kV2BBV6T/dUBd3TLo/St8VjjCeIOeFnS+OPBGgjMvFQ== +"@amplitude/analytics-types@^0.20.0": + version "0.20.0" + resolved "https://registry.yarnpkg.com/@amplitude/analytics-types/-/analytics-types-0.20.0.tgz#9efc83b758fdbf3929f0b00a8ba3e5a7262e1c7a" + integrity sha512-OYoUrf7QUl5sL4mqcQJBu+0GuSar7ga5prJv0HDtPT4LGu7Adv8S3AWljGiEJuTS/YaOMzvTe2qyKZbwyiNrMw== -"@amplitude/ua-parser-js@0.7.31", "@amplitude/ua-parser-js@^0.7.31": +"@amplitude/ua-parser-js@^0.7.31": version "0.7.31" resolved "https://registry.yarnpkg.com/@amplitude/ua-parser-js/-/ua-parser-js-0.7.31.tgz#749bf7cb633cfcc7ff3c10805bad7c5f6fbdbc61" integrity sha512-+z8UGRaj13Pt5NDzOnkTBy49HE2CX64jeL0ArB86HAtilpnfkPB7oqkigN7Lf2LxscMg4QhFD7mmCfedh3rqTg== @@ -1334,13 +1332,20 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@react-native-async-storage/async-storage@^1.15.15", "@react-native-async-storage/async-storage@^1.15.17", "@react-native-async-storage/async-storage@^1.17.7", "@react-native-async-storage/async-storage@^1.17.9": +"@react-native-async-storage/async-storage@^1.15.15", "@react-native-async-storage/async-storage@^1.15.17", "@react-native-async-storage/async-storage@^1.17.9": version "1.17.9" resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.17.9.tgz#2092d675fb9de05a3e71cdf8cefa9c5c4e4a3728" integrity sha512-HKhMvjpA5/YzNMkcY3qeWLdTtUrtJe243knHNNYe1c0IplX69hZyiw7DjFwAgxPG9+YvzHDHliqPV+mBNOv+cQ== dependencies: merge-options "^3.0.4" +"@react-native-async-storage/async-storage@^1.17.11": + version "1.23.1" + resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.23.1.tgz#cad3cd4fab7dacfe9838dce6ecb352f79150c883" + integrity sha512-Qd2kQ3yi6Y3+AcUlrHxSLlnBvpdCEMVGFlVBneVOjaFaPU61g1huc38g339ysXspwY1QZA2aNhrk/KlHGO+ewA== + dependencies: + merge-options "^3.0.4" + "@react-native-community/cli-debugger-ui@^7.0.3": version "7.0.3" resolved "https://registry.yarnpkg.com/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-7.0.3.tgz#3eeeacc5a43513cbcae56e5e965d77726361bcb4" @@ -7069,11 +7074,16 @@ tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.1, tslib@^2.3.1: +tslib@^2.0.1: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== +tslib@^2.4.1: + version "2.6.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" + integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== + tsutils@^3.17.1, tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" From 821c2920d57002d30818c197b521898a447a2731 Mon Sep 17 00:00:00 2001 From: Xinyi Ye Date: Mon, 23 Sep 2024 11:29:31 -0700 Subject: [PATCH 3/3] fix: update ReactNative sample to use 1.4.10 of @amplitude/analytics-react-native --- .../typescript/v2/AmpliApp/package.json | 2 +- react-native/typescript/v2/AmpliApp/yarn.lock | 50 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/react-native/typescript/v2/AmpliApp/package.json b/react-native/typescript/v2/AmpliApp/package.json index 2f1a892a..d77bdeaa 100644 --- a/react-native/typescript/v2/AmpliApp/package.json +++ b/react-native/typescript/v2/AmpliApp/package.json @@ -10,7 +10,7 @@ "lint": "eslint . --ext .js,.jsx,.ts,.tsx" }, "dependencies": { - "@amplitude/analytics-react-native": "1.1.7", + "@amplitude/analytics-react-native": "1.4.10", "@react-native-async-storage/async-storage": "^1.17.9", "@segment/analytics-react-native": "^2.1.7", "@segment/sovran-react-native": "^0.2.6", diff --git a/react-native/typescript/v2/AmpliApp/yarn.lock b/react-native/typescript/v2/AmpliApp/yarn.lock index 5d8407da..c620348e 100644 --- a/react-native/typescript/v2/AmpliApp/yarn.lock +++ b/react-native/typescript/v2/AmpliApp/yarn.lock @@ -2,45 +2,45 @@ # yarn lockfile v1 -"@amplitude/analytics-client-common@^0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@amplitude/analytics-client-common/-/analytics-client-common-0.7.0.tgz#b099a97853d8622cdb371329d5e70afc6d9dca10" - integrity sha512-fKBR5DSo6qTqFcCFnLopRdWv6Zieox3YnzyXG2Zg1hR9MDeX96GoMEwwT2VB5MPzGxE1wYW6kQPvU2C/xpn5ww== - dependencies: - "@amplitude/analytics-connector" "^1.4.5" - "@amplitude/analytics-core" "^0.13.3" - "@amplitude/analytics-types" "^0.20.0" +"@amplitude/analytics-client-common@^1.2.3": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@amplitude/analytics-client-common/-/analytics-client-common-1.2.3.tgz#13c31681ee84e4519f66a0451e6014351c20df53" + integrity sha512-J/RlOmzvrhhLkk5HhpYlV83SGnli+IRWzHaWPV5Dhg1yieaMZlGPkyoS26gyMMPBIv9fcoG6b4LptO9pbMbjSg== + dependencies: + "@amplitude/analytics-connector" "^1.5.0" + "@amplitude/analytics-core" "^1.2.5" + "@amplitude/analytics-types" "^1.3.4" tslib "^2.4.1" -"@amplitude/analytics-connector@^1.4.5": +"@amplitude/analytics-connector@^1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@amplitude/analytics-connector/-/analytics-connector-1.5.0.tgz#89a78b8c6463abe4de1d621db4af6c62f0d62b0a" integrity sha512-T8mOYzB9RRxckzhL0NTHwdge9xuFxXEOplC8B1Y3UX3NHa3BLh7DlBUZlCOwQgMc2nxDfnSweDL5S3bhC+W90g== -"@amplitude/analytics-core@^0.13.3": - version "0.13.3" - resolved "https://registry.yarnpkg.com/@amplitude/analytics-core/-/analytics-core-0.13.3.tgz#c1c99751dd25ec616b6dc242d65997f83659f564" - integrity sha512-lLLmUwi78iqGsCPgd15yH488K+3FPYQ19fCdA3OemoEK9959xCzMZe/KYafQKkgZmI4ZiZLOp3pjamKWc6mcdQ== +"@amplitude/analytics-core@^1.2.5": + version "1.2.5" + resolved "https://registry.yarnpkg.com/@amplitude/analytics-core/-/analytics-core-1.2.5.tgz#f5fc39d93920f3e5447956b9a7525b924b5c0791" + integrity sha512-V7CVlHVN+1diKiOpdp2bCPZ0mbS4CmUYF+v+eXDwVfJL3M/t3sVcT1apXnmVYGYi14cGu9hQOD11rD6qKbUOsw== dependencies: - "@amplitude/analytics-types" "^0.20.0" + "@amplitude/analytics-types" "^1.3.4" tslib "^2.4.1" -"@amplitude/analytics-react-native@1.1.7": - version "1.1.7" - resolved "https://registry.yarnpkg.com/@amplitude/analytics-react-native/-/analytics-react-native-1.1.7.tgz#190192ffbb97d61bba5adfda5d670a227ba77663" - integrity sha512-d8DU9dHxZE+vTlgQ6SaxiC7E2R9j60iM38DlWEKMux2qT5wkP7na5xq13jnBPOmzhtw+fRA81CLLKbgBj1he3Q== +"@amplitude/analytics-react-native@1.4.10": + version "1.4.10" + resolved "https://registry.yarnpkg.com/@amplitude/analytics-react-native/-/analytics-react-native-1.4.10.tgz#108d491e9b3bea0183ca989fdd23c1f669e86120" + integrity sha512-anliECw3uVqi5lFXp3LPifxIHk71aLRle2SvYpA34MPfPLHqGDI7Xfs+JjuJxDY1GpluwG/BNAbQIGENBxuzgQ== dependencies: - "@amplitude/analytics-client-common" "^0.7.0" - "@amplitude/analytics-core" "^0.13.3" - "@amplitude/analytics-types" "^0.20.0" + "@amplitude/analytics-client-common" "^1.2.3" + "@amplitude/analytics-core" "^1.2.5" + "@amplitude/analytics-types" "^1.3.4" "@amplitude/ua-parser-js" "^0.7.31" "@react-native-async-storage/async-storage" "^1.17.11" tslib "^2.4.1" -"@amplitude/analytics-types@^0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@amplitude/analytics-types/-/analytics-types-0.20.0.tgz#9efc83b758fdbf3929f0b00a8ba3e5a7262e1c7a" - integrity sha512-OYoUrf7QUl5sL4mqcQJBu+0GuSar7ga5prJv0HDtPT4LGu7Adv8S3AWljGiEJuTS/YaOMzvTe2qyKZbwyiNrMw== +"@amplitude/analytics-types@^1.3.4": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@amplitude/analytics-types/-/analytics-types-1.3.4.tgz#9142a893313cc28a9c7a7a3e3360c33636fc9b7d" + integrity sha512-tR70gzqFkEzX9QpxvWYMfLCledT7vMhgd3d4/bkp3nnGXTOORaVUOCcSgOyxyuFdSx84T61aP/eZPKIcZcaP+A== "@amplitude/ua-parser-js@^0.7.31": version "0.7.31"