ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / NFC functions
  • Special cases
  • Required permissions
  • AppID required
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns the activation status of the NFC sensor found on the device.
Example
Android
// Ecrit une url dans un tag NFC
IF NFCStatus = nfcEnabled THEN
	tag is nfcTag
	url is nfcData
	url.Type = nfcURI
	url.Content = "www.pcsoft.com"
	Add(tag, url)
	NFCWriteTag(tag)
	IF ErrorOccurred THEN
		Error("Echec de l'écriture sur le tag NFC.", ErrorInfo())
	END
END
Syntax
<Result> = NFCStatus()
<Result>: Integer constant
Activation status of the sensor:
nfcDisabledThe NFC sensor is disabled.
nfcEnabledThe NFC sensor is enabled.
iPhone/iPad Scan in progress.
nfcUnavailableThe device is not equipped with an NFC sensor or this one is not available.
Remarks

Special cases

  • iPhone/iPad The NFC functions are only available in read-only mode.
  • Android The activation status of the NFC sensor cannot be modified programmatically.
    If the NFC sensor is not enabled, the user has the ability to enable it via the window for configuring the wireless communications by using the following code in a procedure in native Java code:
    getCurrentActivity().startActivity(new android.content.Intent(
    android.provider.Settings.ACTION_WIRELESS_SETTINGS));
  • The NFCStatus function cannot be used in either the simulator or the emulator: the function will return the constant nfcUnavailable.
  • Android NFCStatus is available only for devices running Android 2.3.3 or later (API level 10).
    A fatal error occurs if the function is used with an earlier system version.
    To determine the version of Android the application is running on, use SysAndroidVersion.
  • iPhone/iPad NFCStatus is only available on iPhones from iPhone 8 onwards.
Android

Required permissions

This function changes the permissions required by the application.
Permission required: NFC: Allows applications to perform input/output operations using NFC technology.
iPhone/iPad

AppID required

Calling this function modifies the AppIDs of the application in the Apple developer account. It is necessary to activate the "NFC Tag Reading" App ID..
Business / UI classification: Business Logic
Component: wd300android.jar
Minimum version required
  • Version 18
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help