mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Merge pull request #50 from meshtastic/feature/data_migration
Assorted Bug Fixes, remove Background plist items
This commit is contained in:
commit
0ad308c34d
5 changed files with 32 additions and 29 deletions
|
|
@ -738,7 +738,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = MeshtasticClient/MeshtasticClient.entitlements;
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
CURRENT_PROJECT_VERSION = 4;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"MeshtasticClient/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = GCH7VS5Y9R;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
|
|
@ -769,7 +769,7 @@
|
|||
CODE_SIGN_ENTITLEMENTS = MeshtasticClient/MeshtasticClient.entitlements;
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 3;
|
||||
CURRENT_PROJECT_VERSION = 4;
|
||||
DEVELOPMENT_ASSET_PATHS = "\"MeshtasticClient/Preview Content\"";
|
||||
DEVELOPMENT_TEAM = GCH7VS5Y9R;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
|
|
|
|||
|
|
@ -726,7 +726,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
|
||||
try context!.save()
|
||||
print("💾 Saved a new message for \(decodedInfo.packet.id)")
|
||||
if meshLoggingEnabled { MeshLogger.log("💾 Saved a new message for \(decodedInfo.packet.id)") }
|
||||
if meshLoggingEnabled { MeshLogger.log("💾 Saved a new message for \(newMessage.messageId)") }
|
||||
|
||||
if newMessage.toUser!.num == self.broadcastNodeNum || self.connectedPeripheral != nil && self.connectedPeripheral.num == newMessage.toUser!.num {
|
||||
|
||||
|
|
@ -735,7 +735,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
|
||||
manager.notifications = [
|
||||
Notification(
|
||||
id: ("notification.id.\(decodedInfo.packet.id)"),
|
||||
id: ("notification.id.\(newMessage.messageId)"),
|
||||
title: "\(newMessage.fromUser?.longName ?? "Unknown")",
|
||||
subtitle: "AKA \(newMessage.fromUser?.shortName ?? "???")",
|
||||
content: messageText)
|
||||
|
|
@ -878,8 +878,6 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
|
||||
let currentNodeNum = self.connectedPeripheral.num
|
||||
|
||||
|
||||
|
||||
if let routingMessage = try? Routing(serializedData: decodedInfo.packet.decoded.payload) {
|
||||
print(decodedInfo.packet.decoded.requestID)
|
||||
print(routingMessage)
|
||||
|
|
@ -891,8 +889,6 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
|
||||
if decodedInfo.packet.priority == MeshPacket.Priority.ack {
|
||||
|
||||
|
||||
|
||||
let fetchMessageRequest: NSFetchRequest<NSFetchRequestResult> = NSFetchRequest.init(entityName: "MessageEntity")
|
||||
fetchMessageRequest.predicate = NSPredicate(format: "messageId == %lld", Int64(decodedInfo.packet.decoded.requestID))
|
||||
|
||||
|
|
@ -908,7 +904,6 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1110,7 +1105,7 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate, CBPeriph
|
|||
positionPacket.batteryLevel = mostRecentPosition.batteryLevel
|
||||
|
||||
var meshPacket = MeshPacket()
|
||||
meshPacket.to = UInt32(broadcastNodeNum)
|
||||
meshPacket.to = UInt32(destNum)
|
||||
meshPacket.from = UInt32(connectedPeripheral.num)
|
||||
meshPacket.wantAck = wantResponse
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>LSSupportsOpeningDocumentsInPlace</key>
|
||||
<true/>
|
||||
<false/>
|
||||
<key>NSBluetoothAlwaysUsageDescription</key>
|
||||
<string>We use bluetooth to connect to nearby Meshtastic Devices</string>
|
||||
<key>NSBluetoothPeripheralUsageDescription</key>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ struct UserMessageList: View {
|
|||
var body: some View {
|
||||
|
||||
let firmwareVersion = bleManager.lastConnnectionVersion
|
||||
let minimumVersion = "1.2.60"
|
||||
let minimumVersion = "1.3.0"
|
||||
let hasTapbackSupport = minimumVersion.compare(firmwareVersion, options: .numeric) == .orderedAscending || minimumVersion.compare(firmwareVersion, options: .numeric) == .orderedSame
|
||||
|
||||
VStack {
|
||||
|
|
@ -49,7 +49,7 @@ struct UserMessageList: View {
|
|||
if allMessages.count > 0 {
|
||||
|
||||
HStack{
|
||||
// Padding at the top of the message list
|
||||
// Padding at the top of the message list
|
||||
}.padding(.bottom)
|
||||
|
||||
ForEach( allMessages ) { (message: MessageEntity) in
|
||||
|
|
@ -63,7 +63,7 @@ struct UserMessageList: View {
|
|||
let messageReply = allMessages.first(where: { $0.messageId == message.replyID })
|
||||
|
||||
HStack {
|
||||
Text(String(message.messageId))
|
||||
|
||||
Text(messageReply?.messagePayload ?? "EMPTY MESSAGE").foregroundColor(.blue).font(.caption2)
|
||||
.padding(10)
|
||||
.overlay(
|
||||
|
|
@ -390,10 +390,18 @@ struct UserMessageList: View {
|
|||
Button {
|
||||
let userLongName = bleManager.connectedPeripheral != nil ? bleManager.connectedPeripheral.longName : "Unknown"
|
||||
sendPositionWithMessage = true
|
||||
typingMessage = "📍 " + userLongName + " Has shared their position with the mesh."
|
||||
|
||||
if user.num == bleManager.broadcastNodeNum {
|
||||
|
||||
typingMessage = "📍 " + userLongName + " Has shared their position with the mesh."
|
||||
|
||||
} else {
|
||||
|
||||
typingMessage = "📍 " + userLongName + " Has shared their position with you."
|
||||
}
|
||||
} label: {
|
||||
Image(systemName: "mappin")
|
||||
Image(systemName: "mappin.and.ellipse")
|
||||
.symbolRenderingMode(.hierarchical)
|
||||
.imageScale(.large).foregroundColor(.accentColor)
|
||||
}
|
||||
|
||||
ProgressView("Bytes: \(totalBytes) / \(maxbytes)", value: Double(totalBytes), total: Double(maxbytes))
|
||||
|
|
|
|||
|
|
@ -69,11 +69,11 @@ class UserSettings: ObservableObject {
|
|||
UserDefaults.standard.set(preferredPeripheralId, forKey: "preferredPeripheralId")
|
||||
}
|
||||
}
|
||||
// @Published var provideLocation: Bool {
|
||||
// didSet {
|
||||
// UserDefaults.standard.set(provideLocation, forKey: "provideLocation")
|
||||
// }
|
||||
// }
|
||||
@Published var provideLocation: Bool {
|
||||
didSet {
|
||||
UserDefaults.standard.set(provideLocation, forKey: "provideLocation")
|
||||
}
|
||||
}
|
||||
@Published var keyboardType: Int {
|
||||
didSet {
|
||||
UserDefaults.standard.set(keyboardType, forKey: "keyboardType")
|
||||
|
|
@ -102,7 +102,7 @@ class UserSettings: ObservableObject {
|
|||
// self.meshtasticUsername = UserDefaults.standard.object(forKey: "meshtasticusername") as? String ?? ""
|
||||
self.preferredPeripheralName = UserDefaults.standard.object(forKey: "preferredPeripheralName") as? String ?? ""
|
||||
self.preferredPeripheralId = UserDefaults.standard.object(forKey: "preferredPeripheralId") as? String ?? ""
|
||||
// self.provideLocation = UserDefaults.standard.object(forKey: "provideLocation") as? Bool ?? false
|
||||
self.provideLocation = UserDefaults.standard.object(forKey: "provideLocation") as? Bool ?? false
|
||||
self.keyboardType = UserDefaults.standard.object(forKey: "keyboardType") as? Int ?? 0
|
||||
self.meshActivityLog = UserDefaults.standard.object(forKey: "meshActivityLog") as? Bool ?? false
|
||||
self.meshMapType = UserDefaults.standard.string(forKey: "meshMapType") ?? "hybrid"
|
||||
|
|
@ -137,12 +137,12 @@ struct AppSettings: View {
|
|||
// .foregroundColor(.gray)
|
||||
// }
|
||||
// .listRowSeparator(.visible)
|
||||
// Toggle(isOn: $userSettings.provideLocation) {
|
||||
//
|
||||
// Label("Provide location to mesh", systemImage: "location.circle.fill")
|
||||
// }
|
||||
// .toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
// .listRowSeparator(.visible)
|
||||
Toggle(isOn: $userSettings.provideLocation) {
|
||||
|
||||
Label("Provide location to mesh", systemImage: "location.circle.fill")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
.listRowSeparator(.visible)
|
||||
Label("Preferred Radio", systemImage: "flipphone")
|
||||
.listRowSeparator(.hidden)
|
||||
Text(userSettings.preferredPeripheralName)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue