A Flutter plugin that allows you to query device active SimCards.
Note that his plugin works only supports Android as it uses Telephony SubscriptionManager which is a package provided by Android
Android | |
---|---|
Support | SDK 23+ |
To use this plugin you need to add READ_PHONE_STATE
permission in the AndroidManifest.xml
file. There are debug
, main
and profile
versions which are chosen depending on how you start your app. In general, it's sufficient to add permission only to the main
version.
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<!-- NOTE: Since Android SDK 30, the `READ_PHONE_STATE` permission changed to `READ_PHONE_NUMBERS` -->
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
<application>
...
First you need to request for the previously added READ_PHONE_STATE
permission.
final _simcards = Simcards();
await _simcards.requestPermission();
Next you have to check if the READ_PHONE_STATE
permission has been granted
bool _permissionGranted = await _simcards.hasPermission();
Now you can get all active SimCard
s available on the device.
List<SimCard> _simCardList = await _simcards.getSimCards();
It is just as simple as that.
Use the link below to support the continuous development of open source software by Cybroid Team and Community
Cybroid welcomes contributions to our open source projects on Github. When contributing, please follow the Cybroid Community Code of Conduct.
Feel free to submit issues and enhancement requests here.
Please refer to each project's style and contribution guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we can review your changes
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
MIT License
Copyright (c) 2023 Cybroid Technologies (U) Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.