nfc


nfc는 4.2.8 버전 이상 부터 제공되며 해당 라이브러리를 추가하여 사용해야 된다.

read

nfc 태그 정보를 읽어온다.

options

필드설명비고M/O
msgNFC 스캔 메세지 iOS 항목O
    

successCallback

필드필드필드설명비고
result  태그 정보 
uuid 태그 ID7bytes Serial number
(14 hexadecimal characters)
records 태그 상세 정보JSON Array
type태그 데이터의 mine type“U” for URI Record Type
“T” for Text Record Type
“Sp” for Smart Poster Record Type
“Gc” for Generic Control Record Type
data태그 데이터 
     

errorCallback

필드설명
code에러코드
message에러메세지
  

Example

var msg = "태깅하세요.";

hone.channel.execute('nfc', 'read', [msg],
    function (result) {
          alert("Tag Id:" + result.uid + ", Type: " + result.records[0].type));
     }, function (e) {
          alert(JSON.stringify(e));
     }
);

Result

{
"uid": "04:78:7f:7a:ac:5e:80",
"recode": [
   {
    "data": "https://hone.hanwha.co.kr?seat=A45",
    "type": "U"
   }
 ]
}

Error Code

CodeCauseComment
E12600파라메터 값이 잘못되어 있을 경우 
E12601전달된 액션 값이 알 수 없는 액션일 경우 
E12650실행 중 오류가 발생 되었을 경우 
E12651NFC 읽기 모드가 비활성화 된 경우 
E12652태그정보를 얻기위한 서비스가 지원하지 않는 경우 
E12653사용자가 NFC 스캔을 종료한 경우 
E12654NFC 스캔 중 시간초과가 발생한 경우 
E12655유효한 태그 정보가 없는 경우 
E12656NFC 스캔을 위한 entitlement, privacy 설정이 되어있지 않은 경우 
E12657여러 개의 태그가 스캔된 경우 
E12699알 수없는 오류가 발생 되었을 경우