728x90
반응형

apple Oauth 를 하는 과정에서 com.apple.AuthenticationServices.Authorization Error Code 1000 란 에러가 발생했다.

 

xcode 에서, sign with apple 추가해주면 해결

728x90
반응형
728x90
반응형

Podfile 에

 


pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true

추가로 해결

728x90
반응형
728x90
반응형

edit scheme -> pre-action 

# Type a script or drag a script file from your workspace to insert its path.

cp "${PROJECT_DIR}/../.env.development" "${PROJECT_DIR}/../.env"

echo ".env.development" > /tmp/envfile

 

밑에

touch "${PROJECT_DIR}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildDotenvConfig.rb"

 

추가

 

최종

 

# Type a script or drag a script file from your workspace to insert its path.

cp "${PROJECT_DIR}/../.env.development" "${PROJECT_DIR}/../.env"

echo ".env.development" > /tmp/envfile

touch "${PROJECT_DIR}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildDotenvConfig.rb"

728x90
반응형
728x90
반응형

상품관련된 부분을 api를 통해 html 태그를 통해서 받게되었다.

 

핸드폰 가로비율에 100%로 맞추고, 웹뷰안에서 네비게이팅을 하지않도록 작성했다

 

<WebView
style={{ height: Dimensions.get('window').height }}
originWhitelist={['*']}
source={{
html: html,
}}
onShouldStartLoadWithRequest={(event) => {
if (event.url.slice(0, 4) === 'http') {
Linking.openURL(event.url);
return false;
}
return true;
}}
setBuiltInZoomControls={false} // android prevent zoom
showsHorizontalScrollIndicator={false} //indicator 숨김
showsVerticalScrollIndicator={false} //indicator 숨김
/>

화면 100% 맞추는 작업은 html을 

 

const returnImageWidth100 = resultAws.replaceAll(
'<img ',
'<img width = "100%"',
);

const zoomDisable = `<meta name = "viewport" content="initial-scale=1.0, maximum-scale=1.0">`;

return zoomDisable + returnImageWidth100;

해당함수로 직접 변경해줘서 해결했다.

728x90
반응형
728x90
반응형

rm -rf ios/Pods 로 pod 관련 부분을 지우고 다시 pod-install을 진행했는데

 

해당 에러가 발생했다.

 

에러로그는 xcrun: error: SDK "iphoneos" cannot be located.

 

로 

 

sudo xcode-select --switch /Applications/Xcode.app

 

를 사용하여 xcode 위치 설정을 잡아주면 해결

728x90
반응형
728x90
반응형

react-native run-android --mode release #android

react-native run-ios --configuration Release #ios

728x90
반응형
728x90
반응형

redux 툴킷을 상요하지않다가 이번에 사용을 하면서

 

기존

const store = createStore(rootReducer, applyMiddleware(myLogger, logger));

const store = createStore(reducer, composeWithDevTools(
  applyMiddleware(...middleware),
  // other store enhancers if any
));

로 사용하던 로거를

 

const store = configureStore({
reducer: persistedReducer,
middleware: (getDefaultMiddleware) => {
// eslint-disable-next-line no-undef
if (__DEV__) {
return getDefaultMiddleware({ serializableCheck: false }).concat(logger);
}
return getDefaultMiddleware({ serializableCheck: false });
},
// eslint-disable-next-line no-undef
devTools: __DEV__,
});

형태로 바꾸어줬다

728x90
반응형
728x90
반응형

watchman watch-del '/Users/유저이름/프로젝트이름' ; watchman watch-project '/Users/유저이름/프로젝트이름'

 

으로 해결

728x90
반응형
728x90
반응형
import * as React from 'react';
import {Alert, Text, TouchableOpacity, View} from 'react-native';

interface ErrorBoundaryProps {}

interface ErrorBoundaryState {
hasError: boolean;
errorMessage: string;
}

export default class ErrorBoundary extends React.Component<
React.PropsWithChildren<ErrorBoundaryProps>,
ErrorBoundaryState
> {
constructor(props: ErrorBoundaryProps) {
super(props);
this.state = {hasError: false, errorMessage: ''};
}

static getDerivedStateFromError(_error: Error) {
return {hasError: true};
}

componentDidCatch(error: Error, _errorInfo: any) {
this.setState({errorMessage: error.toString()});
}

onRefresh = () => {
Alert.alert('', 'error refresh');
this.setState({hasError: false});
};

render() {
if (this.state.hasError) {
return (
<View
style={{
flex: 1,
justifyContent: 'center',
alignContent: 'center',
backgroundColor: '#ffe2e2',
}}>
<Text>system error</Text>
<Text>{this.state.errorMessage}</Text>
<TouchableOpacity onPress={this.onRefresh}>
<Text>refresh</Text>
</TouchableOpacity>
</View>
);
}

return this.props.children;
}
}
728x90
반응형
728x90
반응형

Any way to disable onPress on child views while swiping?

 

스와이프를 할때도, pressable / touchableopacity 가 event가 먹기에 Pressable을 커스텀했다.

 

import React, {useRef} from 'react';
import {NativeTouchEvent, Pressable, PressableProps} from 'react-native';

export const CustomPressable = ({
onPress,
onPressIn,
onPressOut,
...props
}: PressableProps) => {
const _touchActivatePositionRef = useRef<NativeTouchEvent | null>(null);
const _onPressIn: PressableProps['onPressIn'] = e => {
_touchActivatePositionRef.current = e.nativeEvent;

onPressIn?.(e);
};

const _onPress: PressableProps['onPress'] = e => {
const {pageX, pageY} = e.nativeEvent;

const absX = Math.abs(
(_touchActivatePositionRef.current?.pageX || 0) - pageX,
);
const absY = Math.abs(
(_touchActivatePositionRef.current?.pageY || 0) - pageY,
);

const dragged = absX > 2 || absY > 2;
if (!dragged) {
onPress?.(e);
}
};

return (
<Pressable
onPressIn={_onPressIn}
onPress={_onPress}
onPressOut={onPressOut}
{...props}>
{props.children}
</Pressable>
);
};

Pressable 말고 TouchableOpacity로도 사용이 가능한데, RN공홈에서 Pressable 을 권장하니 참고

728x90
반응형

+ Recent posts