기기 정보 (Device)
Device 모듈은 현재 사용 중인 기기와 앱에 대한 상세 정보를 제공합니다.
메서드
getInfo
기기 및 앱의 기본 정보를 가져옵니다.
getInfo(): Promise<DeviceInfo>
DeviceInfo 타입:
platform:'ios' | 'android'appVersion: 앱 버전 (예:'1.0.2')uniqueId: 기기 고유 식별자
getIdfaAdid
광고 식별자(IDFA 또는 ADID)를 가져옵니다. 사용자의 권한 허용이 필요할 수 있습니다.
getIdfaAdid(): Promise<string | null>
- 반환값: 광고 식별자 문자열 (가져올 수 없는 경우
null)
사용 예제
import { appify } from '@nolraunsoft/appify-sdk';
const info = await appify.device.getInfo();
console.log(`플랫폼: ${info.platform}, 버전: ${info.appVersion}`);
const adid = await appify.device.getIdfaAdid();
if (adid) {
console.log(`광고 식별자: ${adid}`);
}