ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / NFC functions
  • Special cases
  • Required permissions
  • AppID required
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns the activation status of the NFC sensor found on the device.
Example
Android
// Write a url into an NFC tag
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("Unable to write NFC tag.", ErrorInfo())
END
END
Syntax
<Result> = NFCStatus()
<Result>: Integer constant
Sensor activation status:
nfcDisabledThe NFC sensor is disabled.
nfcEnabledThe NFC sensor is enabled.
iPhone/iPad Scan in progress.
nfcUnavailableThe device is not equipped with a 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 through programming.
    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));
  • NFCStatus cannot be used in the simulator or in the emulator: the function will return the nfcUnavailable constant.
  • 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

The call to this function modifies the permissions required by the application.
Required permission: NFC: Allows the applications to perform input/output operations via the 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: wd290android.jar
Minimum version required
  • Version 18
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help