Socket
Socket
Sign inDemoInstall

react-native-nfc-suppress

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-nfc-suppress

suppress nfc


Version published
Weekly downloads
5
decreased by-44.44%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-native-nfc-suppress

Allow disabling of Google pay and Apple pay if needed.

Contributions are welcome!

Installation

npm install react-native-nfc-suppress
Android

Update AndroidManifest.xml

<uses-permission android:name="android.permission.NFC" />
iOS

This library use native-modules, so you will need to do pod install for iOS:

cd ios && pod install && cd ..

Usage

import React from 'react';

import {
  View,
  Text,
  Button,
} from 'react-native';

import { useNfcSuppressor } from 'react-native-nfc-suppress';

export const ExampleComponent= () => {
  const { suppressed, supported, enabled, enable, disable } = useNfcSuppressor();
  
  const switchSuppression = (): void => {
    if (suppressed) {
      disable();
    } else {
      enable();
    }
  };

  return (
    <View style={{display:'flex', flexDirection:'column'}}>
      <Text>{`Is NFC enabled: ${supported}`}</Text>
      <Text>{`Is NFC enabled: ${enabled}`}</Text>
      <Text>{`Is enabled: ${suppressed}`}</Text>
      <Button title="Switch" onPress={switchSuppression} />
    <View>	 
   )
}

Docs

Hooks
useNfcSupportedState

Return boolean value. Channel NFC support state. Value updates on state change.

useNfcEnabledState

Return boolean value. Channel NFC state. Value updates on state change.

useNfcSuppressionState

Return boolean value. Channel NFC suppresion state. Value updates on state change.

useNfcSuppressor

Return object. Expose all module functionality.

License

MIT

Keywords

FAQs

Last updated on 03 Nov 2022

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