Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v2.8.x #52

Merged
merged 14 commits into from
Jun 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { setRemoteConfig, loadSubscription } from './app/actions';
import Instabug from 'instabug-reactnative';
import { PersistGate } from 'redux-persist/integration/react'
import analytics from "./app/helper/analytics";
import {initInstabug} from "./app/helper/instabug";
import { initFCM } from './app/helper/firebaseCloudMessaging';

const { store, persistor } = configureStore();
Expand Down Expand Up @@ -106,10 +107,7 @@ export default class App extends React.Component {
}

async componentWillMount() {
Instabug.startWithToken('d50e4b80d80701c04553b97dbf6a318b', Instabug.invocationEvent.shake);
Instabug.setColorTheme(Instabug.colorTheme.dark);
Instabug.setExtendedBugReportMode(Instabug.extendedBugReportMode.enabledWithRequiredFields);
Instabug.setAutoScreenRecordingEnabled(true);
initInstabug();

this.setState({ loading: false });
// TODO: Hardcoded value until better approach is implemented since onNavigationStateChange does not capture initial screen view
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The project was initially created with CRNA (create-react-native-app) before we
- [Firebase Analytics](https://console.firebase.google.com/project/panacea-39e5a/analytics/app/ios:digital.telenor.panacea/overview%3Ft=2&cs=app.m.dashboard.overview&g=1) link to firebase analytics dashboard
- [Screen Tracking with React Navigation](https://reactnavigation.org/docs/en/screen-tracking.html)
- [Remote Config](https://console.firebase.google.com/project/panacea-39e5a/config) used to send global configuration to clients or to run experiments where client can get different configurations
- [Bug Reporting](https://instabug.com/) we use instabug for bug reporting
- [Bug Reporting](https://instabug.com/) we use instabug for bug reporting. Requires micro phone and photo permissions

## Remote Config

Expand Down
10 changes: 6 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,20 @@ def enableProguardInReleaseBuilds = false
def pass = getPassword("mac","android_keystore")

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion 26
buildToolsVersion "26.0.1"

defaultConfig {
applicationId "digital.telenor.panacea"
minSdkVersion 16
targetSdkVersion 26
versionCode 15
versionName "2.7.0"
versionCode 17
versionName "2.8.1"
ndk {
abiFilters "armeabi-v7a", "x86"
}
// Enabling multidex support.
multiDexEnabled true
}
signingConfigs {
release {
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<application
android:name=".MainApplication"
Expand Down
12 changes: 9 additions & 3 deletions app/containers/OnBoarding/OnBoarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import PropTypes from 'prop-types';
import {Image} from "react-native";
import styles from './styles';
import {textStyles} from "../../config/fonts";
import { version } from '../../../package.json';

const OnBoarding = (props) => {
const { showTermsAndConditions, signIn } = props;
const { showTermsAndConditions, signIn, version } = props;
return (
<Container>
<Image source={require('../../../assets/sweets.jpg')} style={styles.containerImage} />
<Header androidStatusBarColor={'rgba(0,0,0,0.5)'} style={styles.header} noShadow>
<Body style={{ alignItems: 'center' }}>
<Title style={textStyles.textStyle11}>pi</Title>
<Title style={textStyles.textStyle11}>pi <Text style={{ color: 'white' }}>({ version })</Text> </Title>
</Body>
</Header>
<Content contentContainerStyle={styles.contentContainer}>
Expand Down Expand Up @@ -44,7 +45,12 @@ const OnBoarding = (props) => {

OnBoarding.propTypes = {
showTermsAndConditions: PropTypes.func,
signIn: PropTypes.func
signIn: PropTypes.func,
version: PropTypes.string.isRequired
};

OnBoarding.defaultProps = {
version
};

export default OnBoarding;
3 changes: 2 additions & 1 deletion app/containers/OnBoarding/OnBoardingContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ class OnBoardingContainer extends React.Component {
}

componentDidUpdate(prevProps, prevState, snapshot) {
const forceSignUp = this.props.navigation.getParam('forceSignUp', false);
if (this.props.profile.queried === true && prevProps.profile.queried === false) {
// We have finished the getProfile query.
// if the profile is missing we go to Signup.
if (!this.props.profile.data) {
if (forceSignUp || !this.props.profile.data) {
this.props.navigation.navigate(screens.SignUp);
} else {
// Otherwise go to home page
Expand Down
12 changes: 10 additions & 2 deletions app/containers/Settings/Settings.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import {Container, Body, Left, Title, Text, Button, Icon, Content, Header, Right, View} from "native-base";
import {Container, Body, Left, Title, Text, Button, Icon, Content, Header, Right, View, Footer} from "native-base";
import {textStyles} from "../../config/fonts";
import styles from "./styles";
import {colors} from "../../config/colors";
Expand All @@ -9,7 +9,7 @@ import { IconButton } from './components';
import { version } from '../../../package';

const Settings = props => {
const { goBack, showUserDetails, handleLogout, showPrivacy, showPurchaseHistory, handleFeedback } = props;
const { goBack, showUserDetails, handleLogout, showPrivacy, showPurchaseHistory, handleShowSignUp, handleFeedback } = props;
return (
<Container style={styles.container}>
<Header style={styles.header} androidStatusBarColor={'rgba(0,0,0,0.5)'} noShadow>
Expand Down Expand Up @@ -44,13 +44,21 @@ const Settings = props => {
<Text style={textStyles.textStyle8}>Logout</Text>
</View>
</TouchableHighlight>
<TouchableHighlight onPress={handleShowSignUp}>
<View style={styles.bottomButton}>
<Text style={textStyles.textStyle8}>Sign Up Flow</Text>
</View>
</TouchableHighlight>
<TouchableHighlight onPress={handleFeedback}>
<View style={styles.bottomButton}>
<Text style={textStyles.textStyle8}>Report a problem</Text>
</View>
</TouchableHighlight>
</View>
</Content>
<Footer style={styles.footer}>
<Text style={styles.footerText}>version: {version}</Text>
</Footer>
</Container>
);
}
Expand Down
7 changes: 7 additions & 0 deletions app/containers/Settings/SettingsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ class SettingsContainer extends React.Component {
this.props.userLogout();
return auth0.webAuth.clearSession()
.finally(() => {
Instabug.logOut();
this.props.navigation.navigate(screens.OnBoarding);
});
};

_handleShowSignUp = () => {
this.props.navigation.navigate(screens.OnBoarding, {
forceSignUp: true
});

_handleFeedback = () => {
Instabug.invoke();
};
Expand All @@ -49,6 +55,7 @@ class SettingsContainer extends React.Component {
showPurchaseHistory={this._showPurchaseHistory}
showDeleteAccount={this._showDeleteAccount}
handleLogout={this._handleLogout}
handleShowSignUp={this._handleShowSignUp}
handleFeedback={this._handleFeedback}
/>
)
Expand Down
8 changes: 8 additions & 0 deletions app/containers/Settings/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,13 @@ export default StyleSheet.create({
backgroundColor: colors.white,
padding: 15,
marginVertical: 8
},
footer: {
backgroundColor: colors.whiteTwo,
alignItems: 'center',
borderTopWidth: 0
},
footerText: {
color: colors.brownishGrey
}
});
39 changes: 39 additions & 0 deletions app/helper/instabug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {Platform, AsyncStorage} from 'react-native';
import Instabug from "instabug-reactnative";

export const initInstabug = async () => {
Instabug.startWithToken('d50e4b80d80701c04553b97dbf6a318b', Instabug.invocationEvent.shake);
Instabug.setColorTheme(Instabug.colorTheme.dark);
Instabug.setExtendedBugReportMode(Instabug.extendedBugReportMode.enabledWithRequiredFields);
Instabug.setIntroMessageEnabled(false);

if (Platform.OS === 'ios') {
Instabug.setUserStepsEnabled(true);
}

Instabug.isRunningLive(function (isLive) {
if (isLive) {
// Instabug.startWithToken('LIVE_TOKEN', Instabug.invocationEvent.none);
} else {
Instabug.startWithToken('d50e4b80d80701c04553b97dbf6a318b', Instabug.invocationEvent.shake);
}
});

const hasShownWelcomeMessage = await AsyncStorage.getItem('@Panacea:hasShownInstabugWelcomeMessage');
if (hasShownWelcomeMessage !== "yes") {
showWelcomeMessage();
AsyncStorage.setItem('@Panacea:hasShownInstabugWelcomeMessage', "yes");
}


};

const showWelcomeMessage = () => {
Instabug.isRunningLive(isLive => {
if (isLive) {
Instabug.showWelcomeMessage(Instabug.welcomeMessageMode.live);
} else {
Instabug.showWelcomeMessage(Instabug.welcomeMessageMode.beta);
}
})
}
4 changes: 2 additions & 2 deletions ios/PanaceaReactNativeClient-tvOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.7.0</string>
<string>2.8.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>24</string>
<string>28</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
4 changes: 2 additions & 2 deletions ios/PanaceaReactNativeClient-tvOSTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2.7.0</string>
<string>2.8.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>24</string>
<string>28</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions ios/PanaceaReactNativeClient.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@
CODE_SIGN_ENTITLEMENTS = PanaceaReactNativeClient/PanaceaReactNativeClient.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 24;
CURRENT_PROJECT_VERSION = 28;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = G4VMYY2CK5;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -1621,7 +1621,7 @@
CODE_SIGN_ENTITLEMENTS = PanaceaReactNativeClient/PanaceaReactNativeClient.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 24;
CURRENT_PROJECT_VERSION = 28;
DEVELOPMENT_TEAM = G4VMYY2CK5;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down
8 changes: 6 additions & 2 deletions ios/PanaceaReactNativeClient/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.7.0</string>
<string>2.8.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>24</string>
<string>28</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down Expand Up @@ -66,6 +66,10 @@
<string>SimpleLineIcons.ttf</string>
<string>Zocial.ttf</string>
</array>
<key>NSPhotoLibraryUsageDescription</key>
<string>To give the user possibility to send extra context on feedback</string>
<key>NSMicrophoneUsageDescription</key>
<string>To give the user possibility to send extra context on feedback</string>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
Expand Down
4 changes: 2 additions & 2 deletions ios/PanaceaReactNativeClientTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2.7.0</string>
<string>2.8.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>24</string>
<string>28</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PanaceaReactNativeClient",
"version": "2.7.0",
"version": "2.8.1",
"private": true,
"devDependencies": {
"babel-core": "^7.0.0-bridge.0",
Expand Down