{"id":31037078,"url":"https://github.com/0xfnzero/flutter_sms_zh","last_synced_at":"2025-09-14T04:48:48.449Z","repository":{"id":79537589,"uuid":"221908537","full_name":"0xfnzero/flutter_sms_zh","owner":"0xfnzero","description":"forked from babariviere/flutter_sms，修复国内短信内容超过70个文字发送失败的问题","archived":false,"fork":false,"pushed_at":"2019-11-15T11:21:16.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T07:35:24.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xfnzero.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-11-15T11:16:22.000Z","updated_at":"2019-11-15T11:21:18.000Z","dependencies_parsed_at":"2023-03-12T08:29:24.394Z","dependency_job_id":null,"html_url":"https://github.com/0xfnzero/flutter_sms_zh","commit_stats":null,"previous_names":["0xfnzero/flutter_sms_zh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0xfnzero/flutter_sms_zh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fflutter_sms_zh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fflutter_sms_zh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fflutter_sms_zh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fflutter_sms_zh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xfnzero","download_url":"https://codeload.github.com/0xfnzero/flutter_sms_zh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xfnzero%2Fflutter_sms_zh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275062965,"owners_count":25398888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-14T04:48:44.760Z","updated_at":"2025-09-14T04:48:48.437Z","avatar_url":"https://github.com/0xfnzero.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![xxhdpi](https://user-images.githubusercontent.com/37498811/41118114-d9cad440-6ab0-11e8-9254-68d6aac245be.png)\n\n# [UNMAINTAINED] This project is unmaintained\n\n\n# Flutter SMS\n\nThis is an SMS library for flutter.\n\nIt only support Android for now (I can't do it for iOS because I don't own Mac).\n\n## Getting Started\n\nFor help getting started with Flutter, view our online\n[documentation](https://flutter.io/).\n\nFor help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code).\n\n## Installation and Usage\n\nOnce you're familiar with Flutter you may install this package adding `sms` (0.1.4 or higher) to the dependencies list\nof the `pubspec.yaml` file as follow:\n\n```yaml\ndependencies:\n  flutter:\n    sdk: flutter\n\n  sms: ^0.2.0\n```\n\nThen run the command `flutter packages get` on the console.\n\n## Querying SMS messages\n\nAdd the import statement for `sms` and create an instance of the *SmsQuery* class:\n\n```dart\nimport 'package:sms/sms.dart';\n\nvoid main() {\n  SmsQuery query = new SmsQuery();\n}\n\n```\n\n## Getting all SMS messages\n\n```dart\nList\u003cSmsMessage\u003e messages = await query.getAllSms;\n``` \n\n**Note**: _the use of `await` keyword means that `getAllSms` is resolved asynchronously\nand a Future is retorned._\n\n## Filtering SMS messages\n\nThe method `querySms` from the `SmsQuery` class returns a list of sms depending of the supplied parameters. For example,\nfor querying all the sms messages sent and received write the followed code:\n\n```dart\nawait query.querySms({\n    kinds: [SmsQueryKind.Inbox, SmsQueryKind.Sent]\n});\n```\n\nYou can also query all the sms messages sent and received from a specific contact:\n\n```dart\nawait query.querySms({\n    address: getContactAddress()\n});\n```\n\n## Getting all Threads Conversations\n\nWith `SmsQuery` you can also get the entire list of conversations:\n\n```dart\nList\u003cSmsThread\u003e threads = await query.getAllThreads;\n```\n\n## Getting the Contact info\n\nEach conversation thread is related with a Contact. \nThe class `Contact` contains all the info of a thread contact (address, photo, full name).\nTo get access to `Contact` class you must import `'package:sms/contact.dart'` into your dart file:\n\n```dart\nimport 'package:sms/contact.dart';\n\nvoid main() {\n  ...\n  Contact contact = threads.first.contact;\n  print(contact.address);\n}\n```\n\n## Querying Contact\n\nYou can also query a contact by its address _(phone number)_:\n\n```dart\nimport 'package:sms/contact.dart';\n\nvoid main() {\n  ContactQuery contacts = new ContactQuery();\n  Contact contact = await contacts.queryContact(someAddress());\n  print(contact.fullName);\n}\nString getAddress() {...}\n```\n\n## The Contact photo\n\nYou can retrieve the photo of the contact (full size or thumbnail):\n\n```dart\n...\nUint8List fullSize = contact.photo.bytes;\nUint8List thumbnail = contact.thumbnail.bytes;\n```\n\n## User Profile\n\nSome times it is useful to request basic info of the phone owner, like the contact photo, addresses, etc.\n\n```dart\nimport 'package:sms/contact.dart';\n\nUserProfileProvider provider = new UserProfileProvider();\nUserProfile profile = await provider.getUserProfile();\nprint(profile.fullName);\n```\n\n## Sending SMS\n\nWhat about sending a SMS? All you have to do is to create an instance of the `SmsSender` class:\n\n```dart\nimport 'package:sms/sms.dart';\n\nvoid main() {\n  SmsSender sender = new SmsSender();\n  String address = someAddress();\n  ...\n  sender.sendSms(new SmsMessage(address, 'Hello flutter!'));\n}\n```\n\nTo be notified when the message is sent and/or delivered, you must add a listener to your message:\n\n```dart\nimport 'package:sms/sms.dart';\n\nvoid main() {\n  SmsSender sender = new SmsSender();\n  String address = someAddress();\n  ...\n  SmsMessage message = new SmsMessage(address, 'Hello flutter!');\n  message.onStateChanged.listen((state) {\n    if (state == SmsMessageState.Sent) {\n      print(\"SMS is sent!\");\n    } else if (state == SmsMessageState.Delivered) {\n      print(\"SMS is delivered!\");\n    }\n  });\n  sender.sendSms(message);\n}\n```\nSome times it is useful to be notified of delivered messages regardless of the message. To do that you must subscribe to the `onSmsDelivered` of the `SmsSender` class instance:\n\n```dart\nvoid main() {\n...\nSmsSender sender = new SmsSender();\nsender.onSmsDelivered.listen((SmsMessage message){\n  print('${message.address} received your message.');\n}));\n}\n```\n\nYou can also send with another SimCard:\n\n```dart\nvoid main() {\nSimCardsProvider provider = new SimCardsProvider();\nSimCard card = await provider.getSimCards()[0];\nSmsSender sender = new SmsSender();\nSmsMessage message = new SmsMessage(\"address\", \"message\");\nsender.sendSMS(message, simCard: card);\n}\n```\n\n**Note**: Using the `onSmsDelivered` from the `SmsSender` will only notify to listeners of messages that has been sent through `SmsSender.send()`.\n\n## Receiving SMS\n\nIf you want to be notified for incoming new messages you must subscribe to an instance of the `SmsReceiver` class:\n\n```dart\nimport 'package:sms/sms.dart';\n\nvoid main() {\n  SmsReceiver receiver = new SmsReceiver();\n  receiver.onSmsReceived.listen((SmsMessage msg) =\u003e print(msg.body));\n}\n```\n\n## Roadmap\n\n- [x] SMS Receiver\n- [x] SMS Sender\n- [x] SMS Delivery\n- [x] SMS Query\n- [x] SMS Thread\n- [ ] MMS Receiver\n- [ ] MMS Sender\n- [ ] MMS Delivery\n- [ ] MMS Query\n- [ ] Multi Sim Card\n- [x] Contact\n- [x] Contact Photo (full size, thumbnail)\n- [x] User profile (basic info)\n\n## Contributors\n\n- babariviere [github](https://github.com/babariviere)\n- joanpablo [github](https://github.com/joanpablo)\n- saifulfrank [github](https://github.com/saifulfrank)\n\n### App logo\nDesigned and created by [Imrul kayes](https://github.com/saifulfrank)\n\n## Contributions\n\nAny contribution is welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xfnzero%2Fflutter_sms_zh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xfnzero%2Fflutter_sms_zh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xfnzero%2Fflutter_sms_zh/lists"}