Socket
Socket
Sign inDemoInstall

@jonz94/capacitor-sim

Package Overview
Dependencies
2
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @jonz94/capacitor-sim

Capacitor plugin to get information from device's sim cards


Version published
Maintainers
1
Created

Changelog

Source

2.0.0 (2023-05-07)

⚠ BREAKING CHANGES

  • upgrade to Capacitor 5

Features

  • upgrade to Capacitor 5 (bb28f65)
  • android: add android 13 support (804f90e)
  • android: use java 17 (ad2a8f9)
  • android: update gradle to 8.0.2 and gradle plugin to 8.0.0 (5253c7e)
  • android: update gradle wrapper (6b3f928)

Bug Fixes

  • android: fix phone number is empty string on android 11 and above (66a8844)
  • android: resolve permission issue (cfe5a8b)
  • android: resolve permission issue for android 13 (d8939ff)
  • ios: fix "Empty collection literal requires an explicit type" warning (5ea57b3)

Readme

Source


Sim

@jonz94/capacitor-sim

Capacitor plugin to get information from device's sim cards.

Install

npm install @jonz94/capacitor-sim
npx cap sync

Android

Variables

This plugin will use the following project variables (defined in your app's variables.gradle file):

  • $androidxCoreKTXVersion version of androidx.core:core-ktx (default: 1.10.0)
  • $kotlin_version version of org.jetbrains.kotlin:kotlin-stdlib (default: 1.8.20)

Configuration

No configuration required for this plugin.

Demo

A working example can be found here: jonz94/capacitor-sim-demo

Usage

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

const getSimCards = async () => {
  const { simCards } = await Sim.getSimCards();

  // console.log(simCards);

  return simCards;
}

API

getSimCards()

getSimCards() => Promise<GetSimCardsResult>

Get information from device's sim cards.

Returns: Promise<GetSimCardsResult>

Since: 1.0.0


checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Check permission to get information from device's sim cards.

On iOS the status is always granted.

Returns: Promise<PermissionStatus>

Since: 1.0.0


requestPermissions()

requestPermissions() => Promise<PermissionStatus>

Request permission to get information from device's sim cards.

On iOS the status is always granted.

Returns: Promise<PermissionStatus>

Since: 1.0.0


Interfaces

GetSimCardsResult
PropType
simCardsSimCard[]
SimCard
PropTypeDescriptionSince
numberstringAndroid only: Phone number.1.0.0
allowsVOIPbooleaniOS only: If this carrier allows VOIP calls to be made on its network.1.0.0
carrierNamestringThe name of the cellular service provider.1.0.0
isoCountryCodestringCountry code for the cellular service provider, represented as an ISO 3166-1 country code string.1.0.0
mobileCountryCodestringMobile country code (MCC) for the cellular service provider, in its numeric representation.1.0.0
mobileNetworkCodestringMobile network code (MNC) for the cellular service provider, in its numeric representation.1.0.0
PermissionStatus
PropType
readSimCardPermissionState

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

Changelog

See CHANGELOG.md.

License

See LICENSE.

Keywords

FAQs

Last updated on 07 May 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc