diff --git a/CHANGELOG.md b/CHANGELOG.md index 44a91a5..83a69b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.5 + +* Replaces TARGET_OS_SIMULATOR check with targetEnvironment(simulator) + ## 1.3.0 * Fixing swift version diff --git a/ios/Classes/SwiftVibratePlugin.swift b/ios/Classes/SwiftVibratePlugin.swift index 83ba6c7..2198a7e 100644 --- a/ios/Classes/SwiftVibratePlugin.swift +++ b/ios/Classes/SwiftVibratePlugin.swift @@ -2,8 +2,14 @@ import Flutter import UIKit import AudioToolbox -private let isDevice = TARGET_OS_SIMULATOR == 0 - +private let isDevice = { + #if targetEnvironment(simulator) + return false + #else + return true + #endif +}() + public class SwiftVibratePlugin: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "vibrate", binaryMessenger: registrar.messenger()) diff --git a/pubspec.yaml b/pubspec.yaml index a9a1a22..07b4a8a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_vibrate description: A Haptic Feedback plugin. -version: 1.3.0 +version: 1.3.5 environment: sdk: '>=2.12.0 <3.0.0' flutter: ^1.10.0