Post

Replies

Boosts

Views

Activity

Reply to Push notifcation-driven live activity not starting
Yeah well the live activity is not starting at all in the sense that nothing is ever received on my device and the live activity UI is not triggered despite it working locally which I verified through testing. before the log show the “unable to update live activity”, ill get logs showing the push token successfully going through aswell as my test payload. but Then after that these logs appear
Sep ’25
Reply to depreciated methods
@eskimo @Polyphonic UPDATE: here is my updated code that some of you were requesting. I have the updated methods implemented but im getting the error "Cannot convert return expression of type 'Double' to return type 'String?'" import Foundation class RAMUsage { let processInfo = ProcessInfo.processInfo func getRAM() { let physicalMemory = processInfo.physicalMemory let formatter = ByteCountFormatter() formatter.countStyle = .memory let formattedMemoryUsage = formatter.string(fromByteCount: Int64(physicalMemory)) parseAndPrint(formattedMemoryUsage: formattedMemoryUsage) } func parseAndPrint(formattedMemoryUsage: String) { print("Formatted RAM usage: \(formattedMemoryUsage)") if let gigsOfRAM = parseFormattedRAMUsage(formattedUsage: formattedMemoryUsage) { print("RAM Usage in Gigabytes: \(gigsOfRAM) GB") } else { print("Could not retrieve or parse RAM usage") } } func parseFormattedRAMUsage(formattedUsage: String) -> Double? { let scanner = Scanner(string: formattedUsage) var value: Double = 0.0 var unit: NSString? if let scannedValue = scanner.scanDouble(representation: .decimal) { value = scannedValue func scanCharacters(from set: CharacterSet) -> String? { if let unitString = unit as String?, unitString.lowercased() == "GB" { print("Parsed RAM Usage: \(value) GB") return value } else { print("could not parse and return value") } } return nil } } }
Topic: App & System Services SubTopic: General Tags:
Dec ’23