{"id":4599,"url":"https://github.com/barodeur/react-native-nfc-ios","last_synced_at":"2026-02-08T11:29:54.914Z","repository":{"id":57338699,"uuid":"99004196","full_name":"barodeur/react-native-nfc-ios","owner":"barodeur","description":"Easy to use CoreNFC for React Native","archived":false,"fork":false,"pushed_at":"2021-09-20T13:34:41.000Z","size":232,"stargazers_count":60,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-23T23:43:12.443Z","etag":null,"topics":["corenfc","ios","nfc","react","react-native","xcode"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barodeur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-01T13:26:55.000Z","updated_at":"2023-08-19T04:59:54.000Z","dependencies_parsed_at":"2022-08-31T04:02:33.586Z","dependency_job_id":null,"html_url":"https://github.com/barodeur/react-native-nfc-ios","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/barodeur/react-native-nfc-ios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barodeur%2Freact-native-nfc-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barodeur%2Freact-native-nfc-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barodeur%2Freact-native-nfc-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barodeur%2Freact-native-nfc-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barodeur","download_url":"https://codeload.github.com/barodeur/react-native-nfc-ios/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barodeur%2Freact-native-nfc-ios/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268636431,"owners_count":24282092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["corenfc","ios","nfc","react","react-native","xcode"],"created_at":"2024-01-05T20:17:17.514Z","updated_at":"2026-02-08T11:29:54.842Z","avatar_url":"https://github.com/barodeur.png","language":"JavaScript","funding_links":[],"categories":["Components","\u003ca name=\"Network:-Native-Modules\"\u003eNetwork: Native Modules\u003c/a\u003e","JavaScript"],"sub_categories":["System"],"readme":"# ⚠️ Deprecated ⚠️\n\nThis project is deprecated. It has not been updated since React Native 0.48 and probably doesn't work on recent version of React Native anymore.\n\nI would suggest to use [`react-native-nfc-manager`](https://www.npmjs.com/package/react-native-nfc-manager) as alternative.\n\n---\n\n\n[![Build Status](https://travis-ci.org/barodeur/react-native-nfc-ios.svg?branch=master)](https://travis-ci.org/barodeur/react-native-nfc-ios)\n[![npm version](https://badge.fury.io/js/react-native-nfc-ios.svg)](https://badge.fury.io/js/react-native-nfc-ios)\n\n# React Native NFC for iOS\n\n\u003e ⚠️ Apple CoreNFC is only available for iOS11 on iPhone 7 and iPhone 7 Plus devices.\n\u003e It does not seems to be available on simulator at the moment, but it should be available later.\n\n## Demo\n\n![DEMO](https://user-images.githubusercontent.com/303170/29473145-9b93f8b4-8424-11e7-93f8-e286580df1e6.gif)\n\n## How to use\n\n## Installation\n\nInstall the module\n```\nnpm install --save react-native-nfc-ios\n```\n\nLink the native module to your project\n```\nreact-native link react-native-nfc-ios\n```\n\n### Prepare your Xcode project\n\nAdd the NFC capability key to your `.entitlements` file\n```xml\n\u003ckey\u003ecom.apple.developer.nfc.readersession.formats\u003c/key\u003e\n\u003carray\u003e\n    \u003cstring\u003eNDEF\u003c/string\u003e\n\u003c/array\u003e\n```\n\nAdd the `NFCReaderUsageDescription` key to your project's `Info.plist`\n```xml\n\u003ckey\u003eNFCReaderUsageDescription\u003c/key\u003e\n\u003cstring\u003eReady to use NFC 🚀\u003c/string\u003e\n```\n\n### Lean about NDEF Messages Structure (NFC Data Exchange Format)\n\nAs CoreNFC, the API will return arrays of messages, each message containing an array of records.\n\n```javascript\n[\n  {\n    \"records\": [\n      {\n        \"type\": \"VQ==\", // base64 encoded for 55, URI record\n        \"payload\": \"UmVhY3QgTmF0aXZlIE5GQyBpT1M=\", // base64 encoded for \"React Native NFC iOS\"\n        \"identifier\": null,  // No identifier in the tag\n        \"typeNameFormat\": \"WELL_KNOWN_RECORD\",\n      }\n    ]\n  }\n]\n```\n\nEvery record will have a Base64 encoded `type`, `payload` and `identifier`.\n\nThe `typeFormatName` will be one of the following constant :\n\n- `EMPTY_RECORD`\n- `WELL_KNOWN_RECORD`\n- `MIME_MEDIA_RECORD`\n- `ABSOLUTE_URI_RECORD`\n- `EXTERNAL_RECORD`\n- `UNKNOWN_RECORD`\n- `UNCHANGED_RECORD`\n\nYou can import those constants form the module.\n\n```javascript\nimport { EMPTY_RECORD } from 'react-native-nfc-ios';\n```\n\n## API\n\n### Promise API - One tag at a time\n\n```javascript\nimport base64 from 'base-64';\nimport { NFCNDEFReaderSession } from 'react-native-nfc-ios';\n\nconst messages = await NFCNDEFReaderSession.readTag();\nconst payloadB64 = messages[0].records[0].payload;\nconst payload = base64.decode(payloadB64);\n\nconsole.log(payload);\n// \"React Native NFC iOS\"\n```\n\n### CoreNFC binding API - Aka Event API\n\nThis API is designed to stay as close as possible to CoreNFC.\n\n```javascript\nimport { NFCNDEFReaderSession } from 'react-native-nfc-ios';\n\nconst readerSession = new NFCNDEFReaderSession();\nconst listener = readerSession.addEventListener('NDEFMessages', (messages) =\u003e {\n  console.log(messages);\n});\n\n// Show the NFC reader\nreaderSession.begin();\n\n// Close the NFC reader\nreaderSession.invalidate();\n\n// Remove the event listener\nreaderSession.removeEventListener('NDEFMessages', listener);\n\n// Or Remove all events listeners\nreaderSession.removeAllListeners('NDEFMessages');\n\n// ⚠️ Release the native instance to free memory\nreaderSession.release();\n```\n\n### Set the Alert Message\n\nAs with the native CoreNFC API you can set the alert message \n\n```javascript\n// With the Simple API\nconst messages = await NFCNDEFReaderSession.readTag({\n  alertMessage: 'Please put your NFC Tag',\n});\n\n// As you instantiate a new NFCNDEFReaderSession\nconst readerSession = new NFCNDEFReaderSession({\n  alertMessage: 'Please put your NFC Tag',\n});\n\n// Change reader session alert message\nreaderSession.setAlertMessage('New alert message');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarodeur%2Freact-native-nfc-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarodeur%2Freact-native-nfc-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarodeur%2Freact-native-nfc-ios/lists"}