yarn add --dev eslint babel-eslint eslint eslint-plugin-react eslint-plugin-react-native
yarn add --dev eslint @react-native-community/eslint-config
For android keyboard open close issue
blurOnSubmit={false}
Add
returnKeyType={"next”}
and not implement
onSubmitEditing={() => { this.email.focus(); }}
if (Text.defaultProps == null) Text.defaultProps = {};
Text.defaultProps.allowFontScaling = false;
if (TextInput.defaultProps == null) TextInput.defaultProps = {};
TextInput.defaultProps.allowFontScaling = false;
if (Button.defaultProps == null) Button.defaultProps = {};
Button.defaultProps.allowFontScaling = false;
Unless your app is using some special encryption you can simply add Boolean a key to your Info.plist with name ITSAppUsesNonExemptEncryption and value NO.
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
xcodebuild -workspace <*ProjectName*>.xcworkspace -scheme <*SchemeName*> -arch x86_64 -sdk iphonesimulator<Version>
curl -v -d '{"aps":{"alert":"hello"}}' -H "apns-topic: BUNDEL_ID" --http2 --cert PEM_FILE_PATH :PASSWORD https://api.push.apple.com/3/device/DEVICE_TOKEN
mkdir -p android/app/src/main/assets && rm -rf android/app/build && react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
import { Dimensions, Platform, PixelRatio } from 'react-native';
export const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get(
'window',
);
// based on iphone X's scale
const wscale = SCREEN_WIDTH / 375;
const hscale = SCREEN_HEIGHT / 812;
export function normalize(size, based = 'width') {
const newSize = based === 'height' ? size * hscale : size * wscale;
if (Platform.OS === 'ios') {
return Math.round(PixelRatio.roundToNearestPixel(newSize));
} else {
return Math.round(PixelRatio.roundToNearestPixel(newSize)) - 2;
}
}
uses
// import { useScreens } from 'react-native-screens';
// useScreens();
// iphone X
normalize(100) // = 100
// iphone 5s
normalize(100) // = maybe 80
// You can choose either "width" (default) or "height" depend on cases:
container = {
width: normalize(100, "width"), // "width" is optional, it's default
height: normalize(100, "height")
}