Socket
Socket
Sign inDemoInstall

native-apple-login

Package Overview
Dependencies
811
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    native-apple-login

apple login modules for react native


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

native-apple-login

installation

$ yarn add native-apple-login
$ cd ios
$ pod install

how to use

import AppleLogin from "native-apple-login";

const login = async () => {
    const result = await AppleLogin.login();
}

Apple Credential State Change Listener

import AppleLogin, {
  Events,
  EventNames,
  CredentialStateChangedResult,
} from 'native-apple-login';

export default function App() {
    const eventSubscription = React.useRef<EmitterSubscription | null>(null);

    React.useEffect(() => {
        eventSubscription.current = Events.addListener(
        EventNames.CredentialStateChanged,
            ({ state, error }: CredentialStateChangedResult) => {
                if (state === "revoked") {
                    logout();
                }
            }
        );
        return () => {
            if (eventSubscription && eventSubscription.current) {
                eventSubscription.current.remove();
            }
        };
    }, []);

    const fetchList = async () => {
        NaitveAppleLogin.getCredentialState(await AsyncStorage.getUserAppleId());
        await getList();
    }
}

Keywords

FAQs

Last updated on 20 Sep 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc