Skip to content

BrunoVillanova/react-native-iccid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@ammora/react-native-iccid

Install package

$ yarn add @ammora/react-native-iccid

Automatic add native Android modules

$ react-native link @ammora/react-native-iccid

Manual installation

Android

  1. Append the following lines to android/settings.gradle:

    include ':@ammora_react-native-iccid'
    project(':@ammora_react-native-iccid').projectDir = new File(rootProject.projectDir, 	'../node_modules/@ammora/react-native-iccid/android')
    
  2. Add to android/app/src/main/AndroidManifest.xml the following permission:

    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    
  3. Open up android/app/src/main/java/.../MainApplication.java

  • Add import com.ammora.RNIccid.RNIccidPackage; to the imports at the top of the file
  • Add new RNIccidPackage() to the list returned by the getPackages() method

Usage

import ICCID from '@ammora/react-native-iccid';

ICCID.getIccid(0) // Parameter slot is required
     .then(iccid => {
       console.log(`Simcard at slot #${slot} got ICCID ${iccid}`);
     })
     .catch(e => {
       console.log(`Error trying to get ICCID from device simcard at slot #${slot}`);
       console.log(e);
     });

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 83.9%
  • JavaScript 16.1%