Sitelet https://github.com/jonz94/capacitor-sim/issues/8
Skip to content

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

Description

@kevindupas

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions