NFC
complete
Joseph Dowling
nfc integration would allow novel data transfer with many possible use cases in security, payments, social, games and interactive installations
Evan Bacon
complete
Today, we are pleased to announce that with the arrival of Expo SDK 42, you can now create custom development clients in the cloud using EAS Build, or locally with the new Expo run commands.
The package has a config plugin built-in, so setup is pretty easy!
You can try it out today:
- Create a new project: expo init
- Install the packages: expo add react-native-nfc-manager expo-dev-client(can also use npm or yarn)
- Add react-native-nfc-managerto theexpo.pluginsarray in yourapp.json.
Build the native app:
- In the cloud with eas build -p all --profile development(expo build does not support custom builds)
- Or locally with expo run:iosandexpo run:android
These custom clients can be shared across teams, and even reused across projects (just like Expo Go).
To be clear,
react-native-nfc-manager
has not been added to the Expo Go app that you download from the App Store or Google Play Store. We still consider this feature to be completed because users can now:
- Create a custom client app without needing to write any native code.
- Build the iOS project without having access to an Apple computer.
We hope you enjoy, and we have big plans to continue improving this workflow going forward!
Alai Wunpini
react-native-nfc-manager Warning: TypeError - Cannot convert null value to object in React Native Expo
I'm encountering an issue with react-native-nfc-manager in a React Native Expo project, where I'm receiving the following warning: TypeError: Cannot convert null value to object
I'm using react-native-nfc-manager for NFC functionalities in my React Native Expo project. The warning occurs in a specific scenario, and I'm unsure about the cause or how to resolve it.
Картавый!
Alai Wunpini I ran into the same problem. >:(
Alai Wunpini
Картавый! i found a solution to it, add react-native-nfc-manager to your plugins array in app.json like, "plugins": ["react-native-nfc-manager"], and create a development build.
Картавый!
Alai Wunpini Thank you for responding!
Alas, it didn't help me :(
I didn't have "plugins", so I added it manually
Alai Wunpini
Картавый! yes! that's how it goes. run with a development build, it should work. That is if you've already installed react-native-nfc-manager package
Paul Kirchhoff
Hello everyone, first of all thank you for this cool feature.
Is it possible to have a read function permanently active. So that you don't have to call a readTag method via a button?
Thanks in advanced
Wodin
Paul Kirchhoff: Hi. It seems like the
react-native-nfc-manager
people would be the best people to answer that question :)Jaydeep Chauhan
Paul Kirchhoff: Yes its possible using old scanning method i've done it and it working well.
Gene
Hey there, doe anyone have any insight on how to test on a physical iOS device? I saw the comment below
expo run:ios -d
allows you to select a device locally, however It only gives me options for the simulators - not my phsical device and we need this to test actual NFC. Do I need to register my device somehow? I also tried building via Xcode from the ejected workspace. This failed on expo-dev-Wodin
Gene: I have not tried this myself, but I think you can do it like this:
Create a build for internal distribution after registering the device (explained in the internal distribution docs).
Then in theory you can do this:
'Press the "Install" button on the build page and follow the instructions presented in the modal.'
Otherwise you can apparently plug your phone in and drag and drop the
.ipa
onto it in the Finder.Gene
Wodin: thanks for your help! I had a go at that, but having issues with a Reantimated error. Doesn't seem as easy as the docs make it out to be sadly. Looking at having to run it as react native cli now which is a shame
Wodin
Gene: Perhaps post to forums.expo.dev with the details.
As far as I know there's a known issue with Reanimated and remote debugging
If you do need to eject, fortunately the Expo Team has made that much closer to the managed workflow and you could always switch back to the managed workflow later.
Gene
Wodin: oh I missed that regarding the remote debugging issue, seems like that was the problem (it acutally only works if i enable remote debugging which is odd). Thanks for your help!
Mohammed Khairala
Hi there !
can u please provide me with how to read nfc tags because i feel lost in the documentation
Wodin
Mohammed Khairala: Hi. This is really a question for the
react-native-nfc-manager
project. But have you had a look at their example app?Or the examples in their README?
Daniel Pal
Hi there! That's awesome! Should I do anything to be able to write ndef ? Because I'm able to read Ndef messages from my tag, but when I want to write Ndef I call await NfcManager.requestTechnology(NfcTech.Ndef); and it never reaches the next row, and it does not write Ndef messages... I use Iphone 11 pro
Thanks your help in advance!
Wodin
Daniel Pal: Hi. You should probably ask the react-native-nfc-manager project this
Daniel Pal
Wodin: Yes, I have asked them. Anyway, With Mod preview I was able to see info.plist (https://blog.expo.io/expo-sdk-42-579aee2348b6), and everything looks great. I have permission, so the problem is with my code..., but I followed the example from here: https://github.com/revtel/react-native-nfc-manager
Wodin
Daniel Pal: I had a quick try with their example app. I only tried this on Android and I don't have any tags that I can write to. Also, I know very little about NFC. But maybe see if this works for you?
Daniel Pal
Wodin: Unfortunately, it wont be able to write or read Ndef data. But I was able to read and write Ndef to Mifare Ultralight EV1 tags. So the problem is with my emulated PN532. Because I use Electhouse PN532 V4 as an emulated tag. The strange thing is that NFC tools app is able to read and write ndef messages to PN532 emulated tag. May it's nfc manager's library issue?
Wodin
Daniel Pal: I don't know, but hopefully the
react-native-nfc-manager
project will be able to help you if you give them all of that info.Daniel Pal
Wodin: I hope. Do you know how to solve this? error: Provisioning profile "*[expo] com.freeridre.senityiosnfc AdHoc 1626966835251" doesn't include the com.apple.developer.nfc.readersession.iso7816.select-identifiers entitlement. (in target 'senityiosnfc' from project 'senityiosnfc').
In my example.entitlements I see:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>NDEF</string>
<string>TAG</string>
</array>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000001020304</string>
<string>A000000063504B43532D3135</string>
<string>E828BD080F</string>
<string>D2760000850100</string>
<string>D2760000850101</string>
</array>
</dict>
</plist>
In my info.plist I see:
<key>NFCReaderUsageDescription</key>
<string>Senity Security Systems Ltd.</string>
Wodin
Daniel Pal: Hi. I'm not sure, but it looks like you might need to add the selectIdentifiers prop to your app.json to specify the acceptable application IDs.
Daniel Pal
Wodin: I have added as you can see my previous comment. So I dont know what's the problem.
Wodin
Daniel Pal: I don't see any mention of
app.json
or selectIdentifiers
in your previous comments. Anyway, I think it would be best to contact the react-native-nfc-manager
developers about this problem. If anyone is able to help, I suspect it's them. I am just a normal Expo user and I don't have any more ideas to give you.Mohammed Khairala
Daniel Pal: can u please provide me with how to read nfc tags because i feel lost in the documentation
Daniel Pal
Wodin: Finally the problem was with library. When I added the selected aids the library added them imto the wrong file. I told it its develeopers and they fixed.
Daniel Pal
Mohammed Khairala: Sorry for the late answer. So, you can check the examples. They work great, and you can use them. Check if your tag is writeable with nfc tools app.
Evan Bacon
complete
Today, we are pleased to announce that with the arrival of Expo SDK 42, you can now create custom development clients in the cloud using EAS Build, or locally with the new Expo run commands.
The package has a config plugin built-in, so setup is pretty easy!
You can try it out today:
- Create a new project: expo init
- Install the packages: expo add react-native-nfc-manager expo-dev-client(can also use npm or yarn)
- Add react-native-nfc-managerto theexpo.pluginsarray in yourapp.json.
Build the native app:
- In the cloud with eas build -p all --profile development(expo build does not support custom builds)
- Or locally with expo run:iosandexpo run:android
These custom clients can be shared across teams, and even reused across projects (just like Expo Go).
To be clear,
react-native-nfc-manager
has not been added to the Expo Go app that you download from the App Store or Google Play Store. We still consider this feature to be completed because users can now:
- Create a custom client app without needing to write any native code.
- Build the iOS project without having access to an Apple computer.
We hope you enjoy, and we have big plans to continue improving this workflow going forward!
Evan Bacon
in progress
Update: I've merged a PR to add a prebuild config plugin to
react-native-nfc-manager
. In
react-native-nfc-manage@3.6.0
, users can now add the package to Expo projects built on EAS build, or locally with expo run:ios
and expo run:android
(i.e. after running expo prebuild
to sync the plugin with the native project).Read the official NFC docs!
We're also still working on the Expo dev client project, which will utilize this proposed config plugin to create a custom dev app that has NFC support.
For now:
- expo init
- yarn add react-native-nfc-manager
- Add react-native-nfc-managerto thepluginsarray in yourapp.json
- Run expo run:ios -dorexpo run:android -dto create a custom app locally that has NFC support! You need a physical device to test NFC correct, the-dflag enables you to choose a connected device.
Importing and setting up the package should render you the following native modal (see image).
Brent Vatne
we're focused on making it possible to add any library to managed expo apps, you can read about it here https://blog.expo.io/expo-managed-workflow-in-2021-d1c9b68aa10
Ryan Galletto
Expo team please make this one a priority. It would add great value to the framework..
B
Barry Geukdjian
NFC and BlueTooth are a must in today's apps. Please, let us know if this is something Expo team is planning to do soon.
Load More
→