feat(lib, android, ios): permissions clean up, add id to files pack
This commit is contained in:
@@ -11,24 +11,27 @@ import MultipeerConnectivity
|
||||
|
||||
class NearbyStartCommand {
|
||||
|
||||
init(senderName: String, filesCount: Int) {
|
||||
init(id: String, senderName: String, filesCount: Int) {
|
||||
self.id = id
|
||||
self.senderName = senderName
|
||||
self.filesCount = filesCount
|
||||
}
|
||||
|
||||
static func fromUserInfo(userInfo: NearbyUserInfo)-> NearbyStartCommand? {
|
||||
if let name = userInfo.dictionary["name"] as? String,
|
||||
let filesCount = userInfo.dictionary["filesCount"] as? Int
|
||||
let filesCount = userInfo.dictionary["filesCount"] as? Int,
|
||||
let id = userInfo.dictionary["id"] as? String
|
||||
{
|
||||
return NearbyStartCommand(senderName: name, filesCount: filesCount)
|
||||
return NearbyStartCommand(id: id, senderName: name, filesCount: filesCount)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func toDictionary() -> [String: Any] {
|
||||
return ["name": senderName, "filesCount": filesCount]
|
||||
return ["name": senderName, "filesCount": filesCount, "id": id]
|
||||
}
|
||||
|
||||
let id: String
|
||||
let senderName: String
|
||||
let filesCount: Int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user