简体   繁体   中英

How do I access NFC capabilities using Flutter or React Native?

I'm trying to decide which language to learn so I can program an mobile app that revolves around NFC and your location. I heard Flutter and Reactive Native are two relatively new languages that allows you to write code for both iOS and Android and there's courses for them on Udemy. However when I Google searched "NFC Flutter" there wasn't any relevant articles on how to incorporate NFC. Is it worth learning either of the two languages or should I write my app separately in Swift and Java?

You can use either React Native or Flutter and still have NFC capabilities.

  • For Flutter there is this plugin you could try (haven't tested it myself)
  • For React Native you could use this plugin which is tested and works great

At the time of writing this answer there is no full solution for NFC in flutter.

That said, you can implement NFC functionality using PlatformChannels . Or, better, encapsulate in in a plugin .

That way, you can write a code for your app in dart for both platforms, but NFC functionality will call Native Swift or Java code to handle platform specifics.

Here is one plugin that is still Work in progress, that does the exact same thing for Android only. You could, for example, fork the plugin and add iOS code and there you would have full solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM