mirror of
https://github.com/hackku21/nearby_connections.git
synced 2026-03-02 03:49:22 +00:00
Fix ios build
This commit is contained in:
@@ -97,8 +97,6 @@ class MPCManager: NSObject {
|
||||
if(device?.state == MCSessionState.notConnected){
|
||||
device?.invite(with: self.browser)
|
||||
}
|
||||
} catch let error {
|
||||
print(error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ enum MethodCall: String {
|
||||
|
||||
case adOnConnectionInitiated = "ad.onConnectionInitiated"
|
||||
case adOnConnectionResult = "ad.onConnectionResult"
|
||||
case adOnDisconnected = "ad.onConnectionResult"
|
||||
case adOnDisconnected = "ad.onDisconnected"
|
||||
|
||||
case disOnConnectionInitiated = "dis.onConnectionInitiated"
|
||||
case disOnConnectionResult = "dis.onConnectionResult"
|
||||
case disOnDisconnected = "dis.onConnectionResult"
|
||||
case disOnDisconnected = "dis.onDisconnected"
|
||||
case disOnEndpointFound = "dis.onEndpointFound"
|
||||
case disOnEndpointLost = "dis.onEndpointLost"
|
||||
|
||||
@@ -33,7 +33,7 @@ enum MethodCall: String {
|
||||
public class SwiftNearbyConnectionsPlugin: NSObject, FlutterPlugin {
|
||||
public static func register(with registrar: FlutterPluginRegistrar) {
|
||||
let channel = FlutterMethodChannel(name: "nearby_connections", binaryMessenger: registrar.messenger())
|
||||
let instance = SwiftNearbyConnectionsPlugin()
|
||||
let instance = SwiftNearbyConnectionsPlugin(channel: channel)
|
||||
registrar.addMethodCallDelegate(instance, channel: channel)
|
||||
}
|
||||
|
||||
@@ -85,8 +85,6 @@ public class SwiftNearbyConnectionsPlugin: NSObject, FlutterPlugin {
|
||||
let dict = convertToDictionary(text: stringData)
|
||||
self.channel.invokeMethod(INVOKE_MESSAGE_RECEIVE_METHOD, arguments: dict)
|
||||
}
|
||||
} catch let e {
|
||||
print(e.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +190,7 @@ public class SwiftNearbyConnectionsPlugin: NSObject, FlutterPlugin {
|
||||
return
|
||||
}
|
||||
do {
|
||||
let jsonData = try JSONSerialization.data(withJSONObject: dict["bytes"])
|
||||
let jsonData = try JSONSerialization.data(withJSONObject: dict)
|
||||
if let device = MPCManager.instance.findDevice(for: dict["endpointId"] as! String) {
|
||||
currentReceivedDevice = device
|
||||
try device.send(data: jsonData)
|
||||
|
||||
@@ -17,6 +17,8 @@ A new flutter plugin project.
|
||||
s.dependency 'Flutter'
|
||||
s.platform = :ios, '8.0'
|
||||
|
||||
s.dependency 'SwiftyJSON', '~> 4.0'
|
||||
|
||||
# Flutter.framework does not contain a i386 slice.
|
||||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
|
||||
s.swift_version = '5.0'
|
||||
|
||||
Reference in New Issue
Block a user