NFC Host-based card emulation (HCE)

EDIT: I’ve made some changes to the plugin based on feedback. I will likely still change it to remove the use of fs and maybe remove the use of xml2js. See GitHub - wodin/rn-hce-test: Expo Config Plugin for NFC HCE etc.

Remove the post install hook and try the following:

I have only tested that it makes the changes specified here. I have not actually tried to use it in an app.

Copy plugins/withReactNativeHce.js into your project.

Install `xml2js` as a dev dependency. e.g.:
yarn add -D xml2js

EDIT: I modified the code so that it does not use xml2js directly, but instead uses XML from @expo/config-plugins.

Add the plugin and the application IDs to your app.json:

{
  "expo": {
    [...]
    "plugins": [
      [
        "./plugins/withReactNativeHce",
        {
          "appIds": [
            "D2760000850101",
            "F0010203040506",
            "F0394148148100"
          ]
        }
      ]
    ]
  }
}
1 Like