Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit f3d0b6c

Browse files
authored
Add compat for Play Services v15+ (#278)
Adding specific v4 GTM dependency on Android (`com.google.android.gms:play-services-tagmanager-v4-impl`) allows us to use Play Services v15+. This is for better compat with other libs who pin their Play Services-versions higher than this lib. Have also rewritten examples a bit to test for compat between Gradle-versions. Since RN 0.56+ uses a newer Gradle-version, I have made one RN which is pre-0.56, and one which is post-0.56, and build both in CI (Travis). Minor fix for `trackEvent` number bridge conversion bug.
1 parent 0e9c54d commit f3d0b6c

File tree

108 files changed

+8713
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+8713
-236
lines changed

.travis.yml

+25-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,30 @@ matrix:
3434
- addon-google_apis-google-16
3535
env: LANE='android'
3636
script: .travis/run.sh
37-
37+
- language: android
38+
sudo: required
39+
jdk: oraclejdk8
40+
before_cache:
41+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
42+
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
43+
cache:
44+
directories:
45+
- $HOME/.yarn-cache
46+
- $HOME/.gradle/caches/
47+
- $HOME/.gradle/wrapper/
48+
before_install:
49+
- nvm install 8
50+
- .travis/before_install.sh
51+
android:
52+
components:
53+
- build-tools-26.0.3
54+
- android-26
55+
- extra-android-m2repository
56+
- extra-google-google_play_services
57+
- extra-google-m2repository
58+
- addon-google_apis-google-16
59+
env: LANE='android-post56'
60+
script: .travis/run.sh
3861
- language: objective-c
3962
os: osx
4063
osx_image: xcode9.3
@@ -47,7 +70,7 @@ matrix:
4770
- nvm install 8
4871
- .travis/before_install.sh
4972
script: .travis/run.sh
50-
73+
5174
notifications:
5275
slack:
5376
secure: qYpqErlZSfd5a88azsJqRkR0dKGXJknLoNsB/MuutbMbsX2HZzRfee9pDR1CDfcLlyBInRoN2lzv2B6xfrRDFnXWB/K9sRjTmzwXVPZbI1KDIi0CpQpgioZeNu2vaqJroX++1RdBCqUE9cHPRUmgo5/SqS4Qnl13uGTyGX4rYHrRK6HC1mXZ7/rVvLg6UnXn6Mb46DSRnFEmGRNlHbw/TmaYDZpFtjxqI9UyTfgrTNaMpXkSrfXlQzYwAfJUaWNClXtk87SFx54UIeu2elCwoPYZozeGDQMi1evPnGUFXwQ+vfnJTFzwt4klr6cdZ1/spmzxzewGheG3pmUnYaKxf3QTD3ppOyE+A44/9eEMib7qUxo2cIv2KOyYLE/pAu3293GhvP4SEdBELLzVHDh4brc6nNndNetJ+GKHeXqIOx48fe3hwfZ+UDCV3KzjUbeiSfh45eEUqEGRRkRLgkB3vC8sKx101vQj2N990h50/CW0+F0nz0S7sDEVfbN9M3RuCtDmpUikTlYCEb1Y6k2uCNbgLuhV99VBVWOrUSB8aBhLPui+xYd+tSUD476mjqqowxYy5O0fbTouf2VzKgGmpyZ3DFvRgG1jbLKKBJxIQJcGq9fITTlh/BouoCAt2BK0JPG1rd+T91lovyqfMrnzrgiGrVIBHzpbh8i3V1H/vN0=

.travis/before_install.sh

+3
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ if [ "$LANE" = "ios" ]; then
77
elif [ "$LANE" = "android" ]; then
88
node --version
99
npm install -g yarn
10+
elif [ "$LANE" = "android-post56" ]; then
11+
node --version
12+
npm install -g yarn
1013
fi

.travis/run.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,24 @@
22
set -e
33
if [ "$LANE" = "node" ]; then
44
yarn install
5-
npm run test
5+
yarn run tsc
6+
cd examples/preRN56Example
7+
yarn install
8+
rm -rf node_modules/react-native-google-analytics-bridge/examples
9+
yarn run tsc
610
else
711
npm install -g react-native-cli
812
react-native -v
913
yarn install
1014
yarn run tsc
1115

12-
cd example
16+
if [ "$LANE" = "android-post56" ]; then
17+
cd examples/postRN56Example
18+
else
19+
cd examples/preRN56Example
20+
fi
1321
yarn install
14-
rm -rf node_modules/react-native-google-analytics-bridge/example
22+
rm -rf node_modules/react-native-google-analytics-bridge/examples
1523

1624
if [ "$LANE" = "ios" ]; then
1725
xcodebuild -project ios/example.xcodeproj/ -configuration Debug -sdk iphonesimulator -scheme example CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO

android/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ android {
2323
dependencies {
2424
compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
2525
compile "com.google.android.gms:play-services-analytics:${safeExtGet('googlePlayServicesVersion', '+')}"
26+
compile "com.google.android.gms:play-services-tagmanager-v4-impl:${safeExtGet('googlePlayServicesVersion', '+')}"
2627
}

example/index.ios.js

-163
This file was deleted.
File renamed without changes.
File renamed without changes.

examples/postRN56Example/.flowconfig

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
10+
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
14+
.*/Libraries/react-native/React.js
15+
16+
; Ignore polyfills
17+
.*/Libraries/polyfills/.*
18+
19+
; Ignore metro
20+
.*/node_modules/metro/.*
21+
22+
[include]
23+
24+
[libs]
25+
node_modules/react-native/Libraries/react-native/react-native-interface.js
26+
node_modules/react-native/flow/
27+
node_modules/react-native/flow-github/
28+
29+
[options]
30+
emoji=true
31+
32+
module.system=haste
33+
module.system.haste.use_name_reducers=true
34+
# get basename
35+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
36+
# strip .js or .js.flow suffix
37+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
38+
# strip .ios suffix
39+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
40+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
41+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
42+
module.system.haste.paths.blacklist=.*/__tests__/.*
43+
module.system.haste.paths.blacklist=.*/__mocks__/.*
44+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
45+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
46+
47+
munge_underscores=true
48+
49+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
50+
51+
module.file_ext=.js
52+
module.file_ext=.jsx
53+
module.file_ext=.json
54+
module.file_ext=.native.js
55+
56+
suppress_type=$FlowIssue
57+
suppress_type=$FlowFixMe
58+
suppress_type=$FlowFixMeProps
59+
suppress_type=$FlowFixMeState
60+
61+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
62+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
63+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
64+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
65+
66+
[version]
67+
^0.75.0
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)