Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Retrieve SIM Card Information on Latest iOS Version #8

Open
kevindupas opened this issue Apr 24, 2023 · 10 comments
Open

Unable to Retrieve SIM Card Information on Latest iOS Version #8

kevindupas opened this issue Apr 24, 2023 · 10 comments
Labels
help wanted Extra attention is needed

Comments

@kevindupas
Copy link

kevindupas commented Apr 24, 2023

Unable to Retrieve SIM Card Information on iOS Version 16.4.1

Description:
On iOS version 16.4.1, it has become impossible to retrieve the SIM card information using the getSimCards() function. This issue affects iPhone 12 with iOS 16.4.1. The function works correctly on iPhone 12 with iOS 16.3.1.

Relevant Information:

  1. iPhone 12 - iOS Version: 16.4.1 (Issue occurs)

    • To Native -> Sim getSimCards 96******
    • TO JS {"simCards":[{"mobileCountryCode":"65535","mobileNetworkCode":"65535","carrierName":"--","allowsVOIP":true,"isoCountryCode":"--"},{"mobileCountryCode":"65535","allowsVOIP":true,"carrierName":"--","isoCountryCode":"--","mobileNetworkCode":"65535"}]}
  2. iPhone 12 - iOS Version: 16.3.1 (Works as expected)

    • To Native -> Sim getSimCards 1117******
    • TO JS {"simCards":[{"carrierName":"","isoCountryCode":"","mobileCountryCode":"","mobileNetworkCode":"","allowsVOIP":true},{"isoCountryCode":"fr","carrierName":"Orange France","mobileNetworkCode":"01","mobileCountryCode":"208","allowsVOIP":true}]}
  3. iPhone XR - iOS Version: 16.3.1 (Works as expected)

    • To Native -> Sim getSimCards 1138****
    • TO JS {"simCards":[{"isoCountryCode":"fr","carrierName":"Orange France","mobileNetworkCode":"01","mobileCountryCode":"208","allowsVOIP":true},{"carrierName":"","isoCountryCode":"","mobileCountryCode":"","mobileNetworkCode":"","allowsVOIP":true}]}

Code Example:

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

        const sortedSimCards = simCards.map(
            ({
                number, allowsVOIP, carrierName, isoCountryCode, mobileCountryCode, mobileNetworkCode,
            }) => ({
                number,
                allowsVOIP,
                carrierName,
                isoCountryCode,
                mobileCountryCode,
                mobileNetworkCode,
            }),
        );

        setSimInfo(sortedSimCards);
    } catch (error) {
        console.error('Error getting SIM info:', error);
        setSimError('Erreur lors de la récupération des informations de la carte SIM');
    }
}

Please help me fix this issue on the latest iOS version.

@jonz94
Copy link
Owner

jonz94 commented May 20, 2023

Sorry for the late reply...

I can reproduce this issue on my end. This plugin works as expected on iOS 16.3.1 but no longer works on iOS 16.4.

Unfortunately, after some investigation, I have bad news to share:

I found the following comments in the CTCarrier.h file:

To provide some context, this plugin uses Core Telephony CTCarrier API provided by Apple under the hood to retrieve the SIM card information.

Now, it seems that Apple does not allow us to do so... I suspect it is due to privacy reasons...

Until Apple re-adds this feature for developers, I don't think there is much we can do for now.

@sinanverve7
Copy link

@kevindupas
hi kevin
did you found any workaround ?

@sinanverve7
Copy link

@jonz94
any updates ?

@officialomkarjadhav
Copy link

officialomkarjadhav commented Aug 2, 2023

Error getting SIM info: [Error: "Sim" plugin is not implemented on web]

getting this error!!! ?
@jonz94

@jonz94
Copy link
Owner

jonz94 commented Aug 2, 2023

Error getting SIM info: [Error: "Sim" plugin is not implemented on web]

getting this error!!! ? @jonz94

@officialomkarjadhav

This sim card plugin only work when running the app as native android/ios app.

Because it is not possible to get sim card information on the web platform.

@jonz94
Copy link
Owner

jonz94 commented Aug 2, 2023

@sinanverve7 Currently, it is not possible to get SIM card information on iOS 16.4+ because Apple does not allow it.

I am still looking for an alternative way to achieve the same goal, but right now, it seems like there is no hope to make it work.

@officialomkarjadhav
Copy link

officialomkarjadhav commented Aug 2, 2023

Error getting SIM info: [Error: "Sim" plugin is not implemented on web]
getting this error!!! ? @jonz94

@officialomkarjadhav

This sim card plugin only work when running the app as native android/ios app.

Because it is not possible to get sim card information on the web platform.

thank you for your reply but
i am using it in react native -expo not in web @jonz94

@jonz94
Copy link
Owner

jonz94 commented Aug 2, 2023

@officialomkarjadhav Would you like to open a new issue and provide more details? I believe your issue is not related to the original issue of this thread. Thank you!

P.S. I'm not familiar with "React Native / Expo" development, so I'm not sure if using a capacitor plugin in a React Native project is a good idea or not.

@kantharia
Copy link

@jonz94 - Is there alternate way to do it? I've seen one financial app that could check if the SIM card was present or not. Does Apple have something special provision for financial apps, like a Private-API access?

@vijay894com
Copy link

Any update on this.

@jonz94 jonz94 added the help wanted Extra attention is needed label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants