Skip to content

Commit

Permalink
fix: ampli react native error with set instance (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-fiedler authored Sep 23, 2024
1 parent 01dc09f commit 94e48d0
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 41 deletions.
2 changes: 1 addition & 1 deletion react-native/typescript/v2/AmpliApp/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion react-native/typescript/v2/AmpliApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@amplitude/analytics-react-native": "^0.4.0",
"@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",
Expand Down
11 changes: 9 additions & 2 deletions react-native/typescript/v2/AmpliApp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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
*/
Expand Down
82 changes: 46 additions & 36 deletions react-native/typescript/v2/AmpliApp/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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@^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-core" "^0.9.1"
"@amplitude/analytics-types" "^0.10.0"
tslib "^2.3.1"
"@amplitude/analytics-connector" "^1.5.0"
"@amplitude/analytics-core" "^1.2.5"
"@amplitude/analytics-types" "^1.3.4"
tslib "^2.4.1"

"@amplitude/[email protected]":
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.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.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@^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.10.0"
tslib "^2.3.1"
"@amplitude/analytics-types" "^1.3.4"
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.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.1.0"
"@amplitude/analytics-connector" "1.4.5"
"@amplitude/analytics-core" "^0.9.1"
"@amplitude/analytics-types" "^0.10.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.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@^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", "@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==
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 94e48d0

Please sign in to comment.