forked from react-native-webrtc/react-native-carrier-info
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (28 loc) · 768 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
'use strict';
import React from 'react';
import {
NativeModules,
Platform,
} from 'react-native';
const _CarrierInfo = require('react-native').NativeModules.RNCarrierInfo;
export default class CarrierInfo {
static async allowsVOIP() {
if (Platform.OS === 'android') return true;
return await _CarrierInfo.allowsVOIP();
}
static async carrierName() {
return await _CarrierInfo.carrierName();
}
static async isoCountryCode() {
return await _CarrierInfo.isoCountryCode();
}
static async mobileCountryCode() {
return await _CarrierInfo.mobileCountryCode();
}
static async mobileNetworkCode() {
return await _CarrierInfo.mobileNetworkCode();
}
static async mobileNetworkOperator() {
return await _CarrierInfo.mobileNetworkOperator();
}
}