Skip to content

Commit

Permalink
Merge branch 'feature/upgrade-react-native' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
akilburge committed Jun 5, 2018
2 parents 9f90b23 + 5e9965b commit 1bc9eae
Show file tree
Hide file tree
Showing 30 changed files with 15,332 additions and 10,394 deletions.
3 changes: 2 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Create a .env file and insert your credentials below
GOOGLE_MAPS_API_KEY=USE_YOUR_OWN
GOOGLE_MAPS_API_KEY_ANDROID=USE_YOUR_OWN
GOOGLE_MAPS_API_KEY_IOS=USE_YOUR_OWN

// Android Release Config
RUKATUK_RELEASE_STORE_FILE=USE_YOUR_OWN
Expand Down
28 changes: 18 additions & 10 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@
; 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
.*/Libraries/react-native/ReactNative.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
flow/
node_modules/react-native/flow/
node_modules/react-native/flow-github/

[options]
emoji=true
Expand All @@ -30,16 +35,19 @@ 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=$FixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
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

unsafe.enable_getters_and_setters=true

[version]
^0.49.1
^0.67.0
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ buck-out/
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
# https://docs.fastlane.tools/best-practices/source-control/

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifact
*.jsbundle
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The official iOS and Android mobile App for Ruk-A-Tuk Promotions.
- [React Native](http://facebook.github.io/react-native/docs/getting-started.html) for development
- [Android Studio](https://developer.android.com/studio/index.html) for Android development
- [Xcode](https://developer.apple.com/xcode/) for iOS development
- [Android SDK](https://developer.android.com/sdk/) `23.0.1` or newer for Android development
- [Android SDK](https://developer.android.com/sdk/) `26.0.0` or newer for Android development
- [Genymotion](https://www.genymotion.com/) for Android emulation
- [YARN](https://yarnpkg.com/) - for dependency management

Expand All @@ -27,23 +27,17 @@ Clone this repo
$ git clone git@github.com:akilb/rukatuk-mobile.git
$ cd rukatuk-mobile
$ yarn install or npm install
$ cd rukatuk-mobile/ios # iOS only
$ pod install # iOS only
```

Create a `.env` file and add the following:

```
GOOGLE_MAPS_API_KEY=ENTER_GOOGLE_MAPS_API_KEY
GOOGLE_MAPS_API_KEY_ANDROID=ENTER_GOOGLE_MAPS_API_KEY
GOOGLE_MAPS_API_KEY_IOS=ENTER_GOOGLE_MAPS_API_KEY
```

[firebase]: https://firebase.google.com/
[firebase-ios-setup]: https://firebase.google.com/docs/ios/setup#add_firebase_to_your_app
[firebase-android-setup]: https://firebase.google.com/docs/android/setup#manually_add_firebase

This application uses [Firebase][firebase] for analytics, crash reporting and push notifications. You can use your own firebase account when running the app.

- *[iOS]* Follow the add firebase to your app instructions [here][firebase-ios-setup] to generate your GoogleService-Info.plist file if you haven't done so already. Place this file in the ios/Rukatuk directory.
- *[Android]* Follow the manually add firebase to your app instructions [here][firebase-android-setup] to generate your google-services.json file if you haven't done so already. Place this file in the android/app/ directory

## How to start

```sh
Expand Down
17 changes: 17 additions & 0 deletions android/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Rukatuk</name>
<comment>Project Rukatuk created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connection.project.dir=
eclipse.preferences.version=1
6 changes: 6 additions & 0 deletions android/app/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin"/>
</classpath>
23 changes: 23 additions & 0 deletions android/app/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
2 changes: 2 additions & 0 deletions android/app/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connection.project.dir=..
eclipse.preferences.version=1
42 changes: 15 additions & 27 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ import com.android.build.OutputFile
* ]
*/

project.ext.react = [
entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

project.ext.vectoricons = [
Expand All @@ -97,13 +101,13 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = true

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
applicationId "com.rukatuk.app"
minSdkVersion 16
targetSdkVersion 23
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 3
versionName "2.0.1"
ndk {
Expand Down Expand Up @@ -154,34 +158,18 @@ android {
}

dependencies {
compile project(':react-native-vector-icons')
compile project(':react-native-config')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-navigation')

compile(project(':react-native-maps')) {
exclude group: 'com.google.android.gms'
}

compile(project(':react-native-firebase')) {
transitive = false
exclude group: 'com.google.android.gms'
}
compile "com.google.firebase:firebase-core:11.2.0"
compile "com.google.firebase:firebase-analytics:11.2.0"
compile "com.google.firebase:firebase-crash:11.2.0"

compile 'com.google.android.gms:play-services-base:11.2.0'
compile 'com.google.android.gms:play-services-maps:11.2.0'
implementation project(':react-native-vector-icons')
implementation project(':react-native-config')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:23.0.1"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-navigation')
implementation project(':react-native-maps')
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}

apply plugin: 'com.google.gms.google-services'
}
12 changes: 3 additions & 9 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.rukatuk.app"
android:versionCode="3"
android:versionName="2.0.1">
package="com.rukatuk.app">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="${excludedPermissionName}" tools:node="remove"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove" />

<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
Expand All @@ -32,7 +26,7 @@
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/GOOGLE_MAPS_API_KEY" />
android:value="@string/GOOGLE_MAPS_API_KEY_ANDROID" />
</application>

</manifest>
13 changes: 6 additions & 7 deletions android/app/src/main/java/com/rukatuk/app/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import com.airbnb.android.react.maps.MapsPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
import io.invertase.firebase.RNFirebasePackage;
import io.invertase.firebase.analytics.RNFirebaseAnalyticsPackage;
import io.invertase.firebase.crash.RNFirebaseCrashPackage;

import java.util.Arrays;
import java.util.List;
Expand All @@ -25,10 +22,12 @@ public List<ReactPackage> createAdditionalReactPackages() {
return Arrays.<ReactPackage>asList(
new ReactNativeConfigPackage(),
new MapsPackage(),
new VectorIconsPackage(),
new RNFirebasePackage(),
new RNFirebaseAnalyticsPackage(),
new RNFirebaseCrashPackage()
new VectorIconsPackage()
);
}

@Override
public String getJSMainModuleName() {
return "index";
}
}
21 changes: 19 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.android.tools.build:gradle:3.1.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -26,3 +26,20 @@ allprojects {
}
}
}

ext {
compileSdkVersion = 26
targetSdkVersion = 26
buildToolsVersion = "27.0.3"
}

subprojects { subproject ->
afterEvaluate{
if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
}
}
}
}
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 23 08:41:06 BST 2017
#Tue Jun 05 19:37:53 BST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
5 changes: 1 addition & 4 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@ project(':react-native-config').projectDir = new File(rootProject.projectDir, '.

include ':app'
include ':react-native-navigation'
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/android/app/')

include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/android/app/')
2 changes: 0 additions & 2 deletions app/screens/events/EventsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
View
} from 'react-native';
import Moment from 'moment';
import Badge from 'react-native-smart-badge';

import appStyles, { theme, navigatorStyle } from '../../config/styles';
import styles from './styles';
Expand Down Expand Up @@ -225,7 +224,6 @@ export default class EventsScreen extends Component {
}}>
{Moment(event.startDate).format('ddd, D MMM @HH:mm')}
</Text>
{ isLive && <Badge style={{ backgroundColor: theme.colours.primary }}>LIVE</Badge>}
</View>
</View>
</View>
Expand Down
9 changes: 4 additions & 5 deletions app/utils/analytics.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import firebase from './firebase';

const analytics = firebase.analytics();
analytics.setAnalyticsCollectionEnabled(true);
// const analytics = firebase.analytics();
// analytics.setAnalyticsCollectionEnabled(true);

function trackScreenView(screenName) {
analytics.setCurrentScreen(screenName);
// analytics.setCurrentScreen(screenName);
}

function trackEvent(event, params) {
analytics.logEvent(event, params);
// analytics.logEvent(event, params);
}

export { trackScreenView, trackEvent };
Loading

0 comments on commit 1bc9eae

Please sign in to comment.