Fixed iOS Simulator Crash
This commit is contained in:
parent
b8f6dfb6df
commit
4a15d251b3
@ -1,3 +1,7 @@
|
|||||||
|
## 0.0.3
|
||||||
|
|
||||||
|
* Bug Fix for iOS Simulator Error
|
||||||
|
|
||||||
## 0.0.2
|
## 0.0.2
|
||||||
|
|
||||||
* Fixing Version
|
* Fixing Version
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
# flutter_sms
|
# flutter_sms
|
||||||
|
|
||||||
<p align="center">
|

|
||||||
<img src="https://github.com/AppleEducate/flutter_sms/blob/master/screenshots/ios_blank.PNG" width="400">
|
|
||||||
</p>
|
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
|
@ -16,12 +16,16 @@ public class SwiftFlutterSmsPlugin: NSObject, FlutterPlugin, UINavigationControl
|
|||||||
_arguments = call.arguments as! [String : Any];
|
_arguments = call.arguments as! [String : Any];
|
||||||
switch call.method {
|
switch call.method {
|
||||||
case "sendSMS":
|
case "sendSMS":
|
||||||
|
#if targetEnvironment(simulator)
|
||||||
|
result(FlutterError(code: "message_not_sent", message: "Cannot send message on this device!", details: "Cannot send SMS and MMS on a Simulator. Test on a real device."))
|
||||||
|
#else
|
||||||
let controller = MFMessageComposeViewController()
|
let controller = MFMessageComposeViewController()
|
||||||
controller.body = _arguments["message"] as? String
|
controller.body = _arguments["message"] as? String
|
||||||
controller.recipients = _arguments["recipients"] as? [String]
|
controller.recipients = _arguments["recipients"] as? [String]
|
||||||
controller.messageComposeDelegate = self
|
controller.messageComposeDelegate = self
|
||||||
UIApplication.shared.keyWindow?.rootViewController?.present(controller, animated: true, completion: nil)
|
UIApplication.shared.keyWindow?.rootViewController?.present(controller, animated: true, completion: nil)
|
||||||
result(message)
|
result(message)
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
result(FlutterMethodNotImplemented)
|
result(FlutterMethodNotImplemented)
|
||||||
break
|
break
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: flutter_sms
|
name: flutter_sms
|
||||||
description: A Flutter plugin for Sending SMS on Android and iOS.
|
description: A Flutter plugin to Send SMS and MMS on iOS and Android. If iMessage is enabled it will send as iMessage on iOS. This plugin must be tested on a real device on iOS.
|
||||||
version: 0.0.2
|
version: 0.0.3
|
||||||
author: Rody Davis <rody.davis.jr@gmail.com>
|
author: Rody Davis <rody.davis.jr@gmail.com>
|
||||||
homepage: https://github.com/AppleEducate/flutter_sms
|
homepage: https://github.com/AppleEducate/flutter_sms
|
||||||
environment:
|
environment:
|
||||||
@ -11,6 +11,7 @@ dependencies:
|
|||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
# flutter packages pub publish
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://www.dartlang.org/tools/pub/pubspec
|
# following page: https://www.dartlang.org/tools/pub/pubspec
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user