1.1.6 • Published 5 years ago

react-native-app-version-update-new2 v1.1.6

Weekly downloads
-
License
Biznovare
Repository
-
Last release
5 years ago

react-native-app-version-update-new2

This project will check that app needs an update or not. It will do calculation based on version of App and will show a popup based on below 3 condition.

  • App needs a force update
  • App needs a update but with remind me later option
  • App is updated

Installation

react-native-device-info

This package has a dependency with react-native-device-info. If your project doesn't have a dependency with this package already, please refer to their installation instructions.

$ npm install react-native-app-version-update-new2 --save

Usage

import {checkForVersion} from 'react-native-app-version-update-new2';

checkForVersion(API_RESPONSE, DATE_FORMAT, APP_URL, STYLE);
ParamsUsageRequired
API_RESPONSEApi response which should be same as defined at apiRespone.json in src folderYes
DATE_FORMATdate formate which we show as a titleYes
APP_URLPlatform specific app urlYes
STYLECustom style for popupOptional

Example

import {checkForVersion} from 'react-native-app-version-update-new2';
import apiRespone from './src/apiRespone.json';
const iosUrl = "ios app-store url";
const androidUrl = "android play-store url";

class Demo extends React.Component {
  componentDidMount(){
    checkForVersion(apiRespone, 'DD-MM-YYYY', Platform.OS === 'ios' ? iosUrl : androidUrl);
  }
  render() {
    return (
      <View>
        <Text style={{}}>Hello World!</Text>
      </View>
    )
  }
}
How to redesign style ?

We can pass the styles prop to cover default style. See Example below.

const styleobj = {
  mainViewStyle : {
    backgroundColor: 'rgba(0, 50, 60, 0.9)',
  },
  titleStyle:{
    color: 'rgba(255,255,255,0.8)',
  },
  descTextStyle :{
    color:'rgba(255,255,255,0.8)',
  },
  updateBtnStyle : {
    color:'rgb(255,255,255)'
  },
  remindMeLaterBtnStyle : {
    color:'rgba(255,255,90,0.6)',
  },
  closeBtnStyle:{
    tintColor:'white'
  }
};


checkForVersion(apiRespone, 'DD-MM-YYYY', Platform.OS === 'ios' ? iosUrl : androidUrl, styleobj);

Example check version popup

1.1.6

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago