npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@memorres/react-native-applesignin

v1.1.0

Published

A React Native package for apple login

Downloads

6

Readme

react-native-applesignin

react-native-applesignin npm module is used for authentication using Apple id in React Native apps. Apple sign-in only works with IOS platform .

Getting started

To install the module, run the following command in your project directory: npm install @memorres/react-native-applesignin --save or yarn add @memorres/react-native-applesignin

IMPORTANT: There are additional steps required for jwt-decode. Check the this guide to complete the installation.

Mostly automatic installation

react-native link @memorres/react-native-applesignin

Manual installation

iOS

Pods

  1. Add the line below to your Podfile.
    pod 'react-native-applesignin', :path => '../node_modules/@memorres/react-native-applesignin'
  2. Run pod install in your iOS project directory.

Manually

  1. In XCode's project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesmemorresreact-native-applesignin and select Applesignin.xcodeproj`
  3. Run your project (Cmd+R)

Configure Project

1: Sign in with Apple is supportable from XCode 11 and iOS 13. 2: Add the Sign In with Apple capability in your project. This will add an entitlement that lets your app use Sign In with Apple. 3: Enable Sign in with Apple in your developer account. Go to “Certificates, Identifiers & Profile” section and then click on the “Keys” option. Click on “Create a key” option. Enter the name of the key and enable the “Sign in with Apple” option.

Usage

1. Button style and login process
import Applesignin, {
  AppleButtonBlackContinue,
  AppleButtonBlackSignin,
  AppleButtonWhiteContinue,
  AppleButtonWhiteSignin,
  DecodeToken,
} from '@memorres/react-native-applesignin';
export default class App extends React.Component{
  appleSignIn = (response) => {
    console.log(response);
  };
  render(){
    return(
    <View style = {styles.container}>
     {AppleButtonBlackContinue(styles.appleBtn,this.appleSignIn)}
    </View>)
  }
}
const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center'
  },
  appleBtn: { height: 44, width: 200 }
});
2: Create custom button
import Applesignin from '@memorres/react-native-applesignin';
   Applesignin.requestAppleUser({
    requestedScopes: [Applesignin.Scope.FULL_NAME, Applesignin.Scope.EMAIL],
    }).then((response) => {
        console.log(response) //Log response
    }, (error) => {
        console.log(error) //Log error
    });
3: Decode token
import Applesignin,{DecodeToken} from 'react-native-applesignin';
const decoded = DecodeToken(result.identityToken);
4: logout process
import Applesignin from '@memorres/react-native-applesignin';
try {
    const response = await Applesignin.requestAppleUser({
        requestedScopes: [Applesignin.Operation.LOGOUT
    });
    const credentialState = await Applesignin.getCredentialStateForUser(response.user);
}catch(error){
    console.log(error) //Log error
}

FAQs

Why does full name and email return null?

Apple only returns the full name and email on the first login, it will return null on the succeeding login so you need to save those data. For testing purposes, to be receive these again, go to your device settings; Settings > Apple ID, iCloud, iTunes & App Store > Password & Security > Apps Using Your Apple ID, tap on your app and tap Stop Using Apple ID. You can now sign-in again and you'll receive the full name and `email.