반응형
https://github.com/invertase/react-native-apple-authentication
GitHub - invertase/react-native-apple-authentication: A React Native library providing support for Apple Authentication on iOS a
A React Native library providing support for Apple Authentication on iOS and Android. - invertase/react-native-apple-authentication
github.com
방법은 어렵지 않다.
// App.js
import React from 'react';
import { View } from 'react-native';
import { AppleButton, appleAuth } from '@invertase/react-native-apple-authentication';
async function onAppleButtonPress() {
const {identityToken, fullName} = await appleAuth.performRequest({
requestedOperation: appleAuth.Operation.LOGIN,
// Note: it appears putting FULL_NAME first is important, see issue #293
requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL],
});
if (identityToken) {
// 통신내용 블라 블라~
}
}
function App() {
return (
<View>
<AppleButton
buttonStyle={AppleButton.Style.WHITE}
buttonType={AppleButton.Type.SIGN_IN}
style={{
width: 160, // You must specify a width
height: 45, // You must specify a height
}}
onPress={() => onAppleButtonPress()}
/>
</View>
);
}
728x90
'코딩 > React Native' 카테고리의 다른 글
[RN] 코드 푸쉬.... 안됨.. (1) | 2025.02.22 |
---|---|
[RN] RN 아이콘 적용하기. (0) | 2025.02.22 |
[RN] Splash 화면 설정하기 (0) | 2025.02.21 |
[RN] react-error-boundary 이용한 에러 페이지 추가하기. (0) | 2025.02.21 |
[RN] react native webview 빈화면 버그 (0) | 2025.02.20 |