IOS Error_NFC Cup Game for AI2

Hi,

I am trying the "NFC Cup Game for AI2" from "Tutorials in MIT App Inventor" in an iPhone SE2.

I downloaded the source code to my computer, opened with App Inventor and ran it in the iPhone SE2 via App Inventor.

Unfortunately, a Runtime Error immediately pops-up as shown in the image below.

As expected the NFC function does not work.

Hoping to hear some suggestions how to walk around this issue.

Regards,

Hi,

Thank you very much for the response.

Since the project was originally from MIT Tutorials,
I thought this hyperlink "NFC Cup Game for AI2" would suffice (with regards to the blocks).
I do apologize.

Please see the images below for the blocks.

Regards,

The nearfield sensor isn't available in iOS yet.

http://doesappinventorrunonios.com/

2 Likes

Hi Mr. Peter,

Oh I see...

Thanks.

@Know_About_IT you also could say that more politely...
for example like this

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Thank you for considering this next time...

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

4 Likes

In fact donatz, I understood that the NFC sensor was not accessible by 3rd party Apps but luckily I was wrong, here is Apple's link:
https://developer.apple.com/design/human-interface-guidelines/ios/user-interaction/near-field-communication/

This should mean NFC can be added to AI for iOS in the future. It is of course already available on Android.....

2 Likes

Yes and no. The challenge in this particular case is that the tutorial in question uses both NFC reading and NFC writing. The APIs Apple provides in iOS only support reading tags, not writing. So while we will eventually be able to support reading NFC tags in apps, it seems as though at least in the near future we won't be able to support writing them. This tutorial won't be able to work on iOS unless Apple eventually provides the necessary APIs.

What is this tutorial about then?

https://developer.apple.com/documentation/corenfc

1 Like

Hmm. Yes after further reviewing the API materials for the NFCNDEFTag specifically it does look like it support writes on iOS 13+.

2 Likes