SystangoTechnologies / react-native-apple-authentication

React Native apple sign in
MIT License
42 stars 25 forks source link

How to change the text of sign in button #10

Closed mailtokun closed 4 years ago

amourya-systango commented 4 years ago

We are looking at it @mailtokun. Stay tuned

mailtokun commented 4 years ago

We are looking at it @mailtokun. Stay tuned

Thanks. It's very important for non-English country.

songjihyeok commented 4 years ago

I solved. but it is a little annoying.

you should change the nodemodule/react-native-apple-authentification/index.js

i changed like this ( i use korean )

import React from 'react'; import {TouchableOpacity, Text, StyleSheet,Dimensions} from 'react-native' import { NativeModules, requireNativeComponent ,Platform } from 'react-native';

const { AppleAuthentication } = NativeModules;

// export const RNSignInWithAppleButton = requireNativeComponent('RNCSignInWithAppleButton');

export const SignInWithAppleButton = (buttonStyle, callBack) => { if(Platform.OS === 'ios'){ return <TouchableOpacity style={styles.appleLoginButton} onPress={async () => {

    await AppleAuthentication.requestAsync({
      requestedScopes: [AppleAuthentication.Scope.FULL_NAME, AppleAuthentication.Scope.EMAIL],
    }).then((response) => {
      callBack(response) //Display response
      }, (error) => {
        callBack(error) //Display error

    });

}}> <Text style = {{ fontSize : 15, color: "white" }}> 애플계정으로 로그인하기

}else{ return null

}

}

export default AppleAuthentication;

const styles = StyleSheet.create({ appleLoginButton:{ borderRadius : 4, backgroundColor : "black", width : Dimensions.get('window').width/1.1,

height : 60,
justifyContent : "center",
alignItems : "center",
marginBottom: "3%"

} })

You can customizing the button by changing it to touchableopacity but you should change it everytime when you remove the nodemodules or newly install it

스크린샷 2020-04-08 오후 7 30 04
amourya-systango commented 4 years ago

I have included the changes shared by @songjihyeok in the master branch in version 1.0.7. Now apple login button title could be changed. Closing this issue.