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

Commit

Permalink
Add compat for Play Services v15+ (#278)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cbrevik authored Sep 6, 2018
1 parent 0e9c54d commit f3d0b6c
Show file tree
Hide file tree
Showing 108 changed files with 8,713 additions and 236 deletions.
27 changes: 25 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,30 @@ matrix:
- addon-google_apis-google-16
env: LANE='android'
script: .travis/run.sh

- language: android
sudo: required
jdk: oraclejdk8
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.yarn-cache
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
before_install:
- nvm install 8
- .travis/before_install.sh
android:
components:
- build-tools-26.0.3
- android-26
- extra-android-m2repository
- extra-google-google_play_services
- extra-google-m2repository
- addon-google_apis-google-16
env: LANE='android-post56'
script: .travis/run.sh
- language: objective-c
os: osx
osx_image: xcode9.3
Expand All @@ -47,7 +70,7 @@ matrix:
- nvm install 8
- .travis/before_install.sh
script: .travis/run.sh

notifications:
slack:
secure: qYpqErlZSfd5a88azsJqRkR0dKGXJknLoNsB/MuutbMbsX2HZzRfee9pDR1CDfcLlyBInRoN2lzv2B6xfrRDFnXWB/K9sRjTmzwXVPZbI1KDIi0CpQpgioZeNu2vaqJroX++1RdBCqUE9cHPRUmgo5/SqS4Qnl13uGTyGX4rYHrRK6HC1mXZ7/rVvLg6UnXn6Mb46DSRnFEmGRNlHbw/TmaYDZpFtjxqI9UyTfgrTNaMpXkSrfXlQzYwAfJUaWNClXtk87SFx54UIeu2elCwoPYZozeGDQMi1evPnGUFXwQ+vfnJTFzwt4klr6cdZ1/spmzxzewGheG3pmUnYaKxf3QTD3ppOyE+A44/9eEMib7qUxo2cIv2KOyYLE/pAu3293GhvP4SEdBELLzVHDh4brc6nNndNetJ+GKHeXqIOx48fe3hwfZ+UDCV3KzjUbeiSfh45eEUqEGRRkRLgkB3vC8sKx101vQj2N990h50/CW0+F0nz0S7sDEVfbN9M3RuCtDmpUikTlYCEb1Y6k2uCNbgLuhV99VBVWOrUSB8aBhLPui+xYd+tSUD476mjqqowxYy5O0fbTouf2VzKgGmpyZ3DFvRgG1jbLKKBJxIQJcGq9fITTlh/BouoCAt2BK0JPG1rd+T91lovyqfMrnzrgiGrVIBHzpbh8i3V1H/vN0=
3 changes: 3 additions & 0 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ if [ "$LANE" = "ios" ]; then
elif [ "$LANE" = "android" ]; then
node --version
npm install -g yarn
elif [ "$LANE" = "android-post56" ]; then
node --version
npm install -g yarn
fi
14 changes: 11 additions & 3 deletions .travis/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@
set -e
if [ "$LANE" = "node" ]; then
yarn install
npm run test
yarn run tsc
cd examples/preRN56Example
yarn install
rm -rf node_modules/react-native-google-analytics-bridge/examples
yarn run tsc
else
npm install -g react-native-cli
react-native -v
yarn install
yarn run tsc

cd example
if [ "$LANE" = "android-post56" ]; then
cd examples/postRN56Example
else
cd examples/preRN56Example
fi
yarn install
rm -rf node_modules/react-native-google-analytics-bridge/example
rm -rf node_modules/react-native-google-analytics-bridge/examples

if [ "$LANE" = "ios" ]; then
xcodebuild -project ios/example.xcodeproj/ -configuration Debug -sdk iphonesimulator -scheme example CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
Expand Down
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ android {
dependencies {
compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
compile "com.google.android.gms:play-services-analytics:${safeExtGet('googlePlayServicesVersion', '+')}"
compile "com.google.android.gms:play-services-tagmanager-v4-impl:${safeExtGet('googlePlayServicesVersion', '+')}"
}
163 changes: 0 additions & 163 deletions example/index.ios.js

This file was deleted.

File renamed without changes.
File renamed without changes.
67 changes: 67 additions & 0 deletions examples/postRN56Example/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js

; Ignore polyfills
.*/Libraries/polyfills/.*

; Ignore metro
.*/node_modules/metro/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
node_modules/react-native/flow-github/

[options]
emoji=true

module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*

munge_underscores=true

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'

module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[version]
^0.75.0
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f3d0b6c

Please sign in to comment.