feat(lib): create responses to text messages

This commit is contained in:
ksenia312
2024-02-06 22:24:58 +01:00
parent f71121bd92
commit 66c6f17b99
15 changed files with 285 additions and 233 deletions
@@ -13,11 +13,15 @@ extension NearbyServicePlugin {
@objc func onMessageReceived(notification: Notification) {
DispatchQueue.main.async {
if let userInfo = NearbyUserInfo.fromDictionary(userInfo: notification.userInfo) {
print(userInfo)
if let message = NearbyMessage.fromUserInfo(userInfo: userInfo) {
print(message)
if message.content is NearbyMessageFilesResponse {
print(message.content)
let response = message.content as! NearbyMessageFilesResponse
let cachedRequest = NearbyRequestsStore.instance.find(for: response.id)
if (response.response && cachedRequest != nil) {
print("send")
self.manager.sendFiles(
id: cachedRequest!.id,
paths: cachedRequest!.files,