728x90
npx expo install expo-apple-authentication
일단 설치.
애플도 마찬가지로 expo에서 공식지원한다
https://docs.expo.dev/versions/latest/sdk/apple-authentication/#login
AppleAuthentication
A library that provides Sign in with Apple capability for iOS 13 and higher.
docs.expo.dev
요게 공식 문서 사이트
보면 알듯이 ios에서만 지원된다(당연)
// app.json
{
"ios": {
"usesAppleSignIn": true
}
"plugins": ["expo-apple-authentication"]
}
플러그인에 이렇게 추가해주고
import * as AppleAuthentication from "expo-apple-authentication";
//애플
const loginWithApple = async (): Promise<void> => {
try {
const data = await AppleAuthentication.signInAsync({
requestedScopes: [
AppleAuthentication.AppleAuthenticationScope.FULL_NAME,
AppleAuthentication.AppleAuthenticationScope.EMAIL,
],
});
setResult("성공 :" + JSON.stringify(data));
// signed in
} catch (err) {
setResult("실패 :" + JSON.stringify(err));
}
};
expo go에서는 바로 적용해서 볼 수 있다
근데 prebuild나 eas build했을때는 애플개발자계정이 있어야한다(유료임)
난 회사에서 지원해줘서 애플계발자계정으로 연결시켰다
prebuild했을때 뜨는 ios 폴더를 xcode로 열어서 signing & Capabilities 항목에 team 설정을 유료결제된 계정으로 변경해줘야한다
그래야 빌드가 제대로 가능하다
728x90
'JS > React Native Expo' 카테고리의 다른 글
[React Native Expo] 로컬 스토리지 (local storage) (0) | 2024.01.24 |
---|---|
[React Native Expo] EAS update로 코드푸시하기 (0) | 2024.01.24 |
[React Native Expo] 페이스북 로그인하기 (1) | 2024.01.23 |
[React Native Expo] 네이버로그인 prebuild하기 (0) | 2024.01.23 |
[React Native Expo] 카카오로그인 prebuild하기 (1) | 2024.01.23 |