메인 콘텐츠로 건너뛰기
플러그인으로 돌아가기
@capgo/capacitor-sim
튜토리얼
github.com/Cap-go에 의해

SIM

SIM 카드를 포함한 통신사 이름, 국가 code, 및 전화번호를 검색합니다.

가이드

SIM SIM 튜토리얼

사용자 @capgo/capacitor-sim

Capacitor SIM 플러그인: 장치 SIM 카드에서 정보를 가져오는 데 사용됩니다.

설치

bun add @capgo/capacitor-sim
bunx cap sync

이 플러그인은 다음을 제공합니다.

  • getSimCards - SIM 카드에서 정보를 가져옵니다.
  • checkPermissions - SIM 카드 정보에 접근할 수 있는 권한을 확인합니다.
  • requestPermissions - SIM 카드 정보에 접근할 수 있는 권한을 요청합니다.

사용 예

getSimCards

SIM 카드에서 정보를 가져옵니다.

import { Sim } from '@capgo/capacitor-sim';

const { simCards } = await SimPlugin.getSimCards();
simCards.forEach((sim, index) => {
  console.log(`SIM ${index + 1}:`);
  console.log(`  Carrier: ${sim.carrierName}`);
  console.log(`  Country: ${sim.isoCountryCode}`);
  console.log(`  MCC: ${sim.mobileCountryCode}`);
  console.log(`  MNC: ${sim.mobileNetworkCode}`);
});

checkPermissions

SIM 카드 정보에 접근할 수 있는 권한을 확인합니다.

import { Sim } from '@capgo/capacitor-sim';

const status = await SimPlugin.checkPermissions();
if (status.readSimCard === 'granted') {
  console.log('Permission granted');
} else {
  console.log('Permission not granted');
}

requestPermissions

SIM 카드 정보에 접근할 수 있는 권한을 요청합니다.

import { Sim } from '@capgo/capacitor-sim';

const status = await SimPlugin.requestPermissions();
if (status.readSimCard === 'granted') {
  // Now you can call getSimCards()
  const simCards = await SimPlugin.getSimCards();
}

전체 참조

Using @capgo/capacitor-sim을 계속 사용하세요.

__CAPGO_KEEP_0__를 사용 중이라면 Using @capgo/capacitor-sim을 사용하여 API를 사용 중이라면 @capgo/capacitor-sim @capgo/capacitor-sim과 연결하세요. Getting Started Getting Started의 구현 세부 정보를 위해 API Overview API Overview의 구현 세부 정보를 위해 Introduction Introduction의 구현 세부 정보를 위해 API 키 API 키의 구현 세부 정보를 위한 키.