Skip to content

Commit bde0ebb

Browse files
authored
chore: upgrade AnalyticsReactNativeExample RN version from 0.72->0.76 (#1031)
* fix: to show 'Queue restoration timeout' only once * fix: advertising id being sent for Android application installed events * chore: add privacy manifest file to core package * fix: events not being sent when adTrackingEnabled is false * fix: type mismatch inferred type is String? but String was expected * Revert "fix: type mismatch inferred type is String? but String was expected" This reverts commit 2b1e1fc. * chore: upgrade AnalyticsReactNativeExample to RN 0.76 * chore: upgrade AnalyticsReactNativeExample RN version to 0.76 * chore: removed actual write key with placeholder after testing --------- Co-authored-by: Sunita Prajapati <>
1 parent b114647 commit bde0ebb

File tree

36 files changed

+7331
-3486
lines changed

36 files changed

+7331
-3486
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
};

examples/AnalyticsReactNativeExample/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Home from './Home';
2020
import SecondPage from './SecondPage';
2121
import Modal from './Modal';
2222
import {useState} from 'react';
23-
import {Logger} from './plugins/Logger';
23+
//import {Logger} from './plugins/Logger';
2424

2525
// import {AmplitudeSessionPlugin} from '@segment/analytics-react-native-plugin-amplitude-session';
2626
// import { ConsentManager } from './plugins/ConsentManager';
@@ -45,9 +45,9 @@ const segmentClient = createClient({
4545
],
4646
});
4747

48-
const LoggerPlugin = new Logger();
48+
// const LoggerPlugin = new Logger();
4949

50-
segmentClient.add({plugin: LoggerPlugin});
50+
// segmentClient.add({plugin: LoggerPlugin});
5151

5252
// To see an example Consent Manager uncomment the following
5353
// const ConsentManagerPlugin = new ConsentManager();

examples/AnalyticsReactNativeExample/Gemfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.13'
7-
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'
Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.6)
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
57
rexml
6-
activesupport (7.0.8)
8+
activesupport (6.1.7.10)
79
concurrent-ruby (~> 1.0, >= 1.0.2)
810
i18n (>= 1.6, < 2)
911
minitest (>= 5.1)
1012
tzinfo (~> 2.0)
11-
addressable (2.8.5)
12-
public_suffix (>= 2.0.2, < 6.0)
13+
zeitwerk (~> 2.3)
14+
addressable (2.8.7)
15+
public_suffix (>= 2.0.2, < 7.0)
1316
algoliasearch (1.27.5)
1417
httpclient (~> 2.8, >= 2.8.3)
1518
json (>= 1.5.1)
1619
atomos (0.1.3)
20+
base64 (0.2.0)
1721
claide (1.1.0)
18-
cocoapods (1.13.0)
22+
cocoapods (1.15.2)
1923
addressable (~> 2.8)
2024
claide (>= 1.0.2, < 2.0)
21-
cocoapods-core (= 1.13.0)
25+
cocoapods-core (= 1.15.2)
2226
cocoapods-deintegrate (>= 1.0.3, < 2.0)
23-
cocoapods-downloader (>= 1.6.0, < 2.0)
27+
cocoapods-downloader (>= 2.1, < 3.0)
2428
cocoapods-plugins (>= 1.0.0, < 2.0)
2529
cocoapods-search (>= 1.0.0, < 2.0)
2630
cocoapods-trunk (>= 1.6.0, < 2.0)
@@ -33,7 +37,7 @@ GEM
3337
nap (~> 1.0)
3438
ruby-macho (>= 2.3.0, < 3.0)
3539
xcodeproj (>= 1.23.0, < 2.0)
36-
cocoapods-core (1.13.0)
40+
cocoapods-core (1.15.2)
3741
activesupport (>= 5.0, < 8)
3842
addressable (~> 2.8)
3943
algoliasearch (~> 1.0)
@@ -44,7 +48,7 @@ GEM
4448
public_suffix (~> 4.0)
4549
typhoeus (~> 1.0)
4650
cocoapods-deintegrate (1.0.5)
47-
cocoapods-downloader (1.6.3)
51+
cocoapods-downloader (2.1)
4852
cocoapods-plugins (1.0.0)
4953
nap
5054
cocoapods-search (1.0.1)
@@ -53,49 +57,50 @@ GEM
5357
netrc (~> 0.11)
5458
cocoapods-try (1.2.0)
5559
colored2 (3.1.2)
56-
concurrent-ruby (1.2.2)
60+
concurrent-ruby (1.3.4)
5761
escape (0.0.4)
5862
ethon (0.16.0)
5963
ffi (>= 1.15.0)
60-
ffi (1.16.3)
64+
ffi (1.17.0)
6165
fourflusher (2.3.1)
6266
fuzzy_match (2.0.4)
6367
gh_inspector (1.1.3)
6468
httpclient (2.8.3)
65-
i18n (1.14.1)
69+
i18n (1.14.6)
6670
concurrent-ruby (~> 1.0)
67-
json (2.6.3)
68-
minitest (5.20.0)
71+
json (2.7.5)
72+
minitest (5.25.1)
6973
molinillo (0.8.0)
7074
nanaimo (0.3.0)
7175
nap (1.1.0)
7276
netrc (0.11.0)
77+
nkf (0.2.0)
7378
public_suffix (4.0.7)
74-
rexml (3.3.6)
75-
strscan
79+
rexml (3.3.9)
7680
ruby-macho (2.5.1)
77-
strscan (3.1.0)
78-
typhoeus (1.4.0)
81+
typhoeus (1.4.1)
7982
ethon (>= 0.9.0)
8083
tzinfo (2.0.6)
8184
concurrent-ruby (~> 1.0)
82-
xcodeproj (1.25.0)
85+
xcodeproj (1.25.1)
8386
CFPropertyList (>= 2.3.3, < 4.0)
8487
atomos (~> 0.1.3)
8588
claide (>= 1.0.2, < 2.0)
8689
colored2 (~> 3.1)
8790
nanaimo (~> 0.3.0)
88-
rexml (>= 3.3.2, < 4.0)
91+
rexml (>= 3.3.6, < 4.0)
92+
zeitwerk (2.6.18)
8993

9094
PLATFORMS
9195
ruby
9296

9397
DEPENDENCIES
94-
activesupport (>= 6.1.7.3, < 7.1.0)
95-
cocoapods (~> 1.13)
98+
activesupport (>= 6.1.7.5, != 7.1.0)
99+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
100+
xcodeproj (< 1.26.0)
96101

97102
RUBY VERSION
98-
ruby 2.7.6p219
103+
ruby 2.6.10p210
99104

100105
BUNDLED WITH
101-
2.1.4
106+
1.17.2

examples/AnalyticsReactNativeExample/Home.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const Home = ({navigation}: {navigation: any}) => {
5555
name: 'Alias',
5656
testID: 'BUTTON_ALIAS',
5757
onPress: () => {
58-
void alias('new-id');
58+
void alias('new-id');
5959
},
6060
},
6161
];
@@ -75,7 +75,7 @@ const Home = ({navigation}: {navigation: any}) => {
7575
name: 'Reset',
7676
testID: 'BUTTON_RESET',
7777
onPress: () => {
78-
void reset();
78+
void reset();
7979
},
8080
},
8181
];

examples/AnalyticsReactNativeExample/android/app/build.gradle

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
34

45
/**
@@ -7,14 +8,14 @@ apply plugin: "com.facebook.react"
78
*/
89
react {
910
/* Folders */
10-
// The root of your project, i.e. where "package.json" lives. Default is '..'
11-
// root = file("../")
12-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
13-
// reactNativeDir = file("../node_modules/react-native")
14-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
15-
// codegenDir = file("../node_modules/@react-native/codegen")
16-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
17-
// cliFile = file("../node_modules/react-native/cli.js")
11+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
12+
// root = file("../../")
13+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
14+
// reactNativeDir = file("../../node_modules/react-native")
15+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
16+
// codegenDir = file("../../node_modules/@react-native/codegen")
17+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
18+
// cliFile = file("../../node_modules/react-native/cli.js")
1819

1920
/* Variants */
2021
// The list of variants to that are debuggable. For those we're going to
@@ -48,6 +49,9 @@ react {
4849
//
4950
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5051
// hermesFlags = ["-O", "-output-source-map"]
52+
53+
/* Autolinking */
54+
autolinkLibrariesWithApp()
5155
}
5256

5357
/**
@@ -70,8 +74,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
7074

7175
android {
7276
ndkVersion rootProject.ext.ndkVersion
73-
74-
compileSdkVersion rootProject.ext.compileSdkVersion
77+
buildToolsVersion rootProject.ext.buildToolsVersion
78+
compileSdk rootProject.ext.compileSdkVersion
7579

7680
namespace "com.analyticsreactnativeexample"
7781
defaultConfig {
@@ -80,8 +84,6 @@ android {
8084
targetSdkVersion rootProject.ext.targetSdkVersion
8185
versionCode 1
8286
versionName "1.0"
83-
testBuildType System.getProperty('testBuildType', 'debug')
84-
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
8587
}
8688
signingConfigs {
8789
debug {
@@ -101,28 +103,17 @@ android {
101103
signingConfig signingConfigs.debug
102104
minifyEnabled enableProguardInReleaseBuilds
103105
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
104-
proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
105106
}
106107
}
107108
}
108109

109110
dependencies {
110-
androidTestImplementation('com.wix:detox:+')
111-
implementation 'androidx.appcompat:appcompat:1.1.0'
112111
// The version of react-native is set by the React Native Gradle Plugin
113112
implementation("com.facebook.react:react-android")
114113

115-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
116-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
117-
exclude group:'com.squareup.okhttp3', module:'okhttp'
118-
}
119-
120-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
121114
if (hermesEnabled.toBoolean()) {
122115
implementation("com.facebook.react:hermes-android")
123116
} else {
124117
implementation jscFlavor
125118
}
126119
}
127-
128-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

examples/AnalyticsReactNativeExample/android/app/src/androidTest/java/com/segmentanalyticsreactnativeexample/DetoxTest.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

examples/AnalyticsReactNativeExample/android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6-
75
<application
86
android:usesCleartextTraffic="true"
97
tools:targetApi="28"
10-
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12-
</application>
8+
tools:ignore="GoogleAppIndexingWarning"/>
139
</manifest>

examples/AnalyticsReactNativeExample/android/app/src/debug/java/com/analyticsreactnativeexample/ReactNativeFlipper.java

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)