Search results for

offloading

179 results found

Post

Replies

Boosts

Views

Activity

Offloading task from the cooperative thread pool
Hi, When using Swift Concurrency blocking tasks like file I/O, GPU work and networking can prevent forward moving progress and have the potential to exhaust the cooperative thread pool and under utilize the CPU. It's been recommended to offload these tasks from the cooperative thread pool. Is my understanding correct that the preferred way to do this is by creating async tasks via Dispatch or OperationQueue? And combining these with Continuations if a return value from the task is required? Or should I always be using Continuations in combination with Dispatch/OperationQueue? There are also Executors but the documentation seems a bit limited on how to use these. The new TaskExecutor is also only available on the latest beta's. My question is basically what is the recommend way to offload a task? Thanks!
0
0
761
Jun ’24
Discover and connect to BLE peripherals more rapidly in background
We are developing an app which connects to a BLE peripheral in the background whenever it gets close to it. What we have used so far is that we monitor a circular region. When the phone enters the region the app will start scanning for peripherals and when it discovers the peripheral it connects to it. This worked pretty well for the last few iOS versions, perhaps iOS 14-16. It wasn't perfect but for the most part it would feel like it connected rather quickly when you would approach the BLE peripheral. If you listen to music via BLE or talk to someone using your BLE headset then it could sometimes work noticeably worse. But, as said, for the most part it would work satisfactory. Starting with iOS 17 and analyzing the functionality over the past 6 months or so we've noticed a clear worsening of it. It does generally connect to the peripheral but the user might often have to wait for quite some time. Rather frequently the user must even light up the screen of the phone before anything even happens. It appears
2
0
1.1k
May ’24
Reply to NEHotspotHelper entitlement: Wifi Signal Strength
Is Core Telephony APIs (CTGetSignalStrength class) appropriate in this case That class isn’t part of the public iOS SDK. If you have questions about it, you’ll need to raise them with your carrier contact at Apple. Honestly, I think that’s a good way forward here in general. One expected use case for the hotspot helper subsystem is to help carriers offload traffic to Wi-Fi. There are carrier-specific aspects to this that I’m not really up-to-speed with (because they involve stuff that’s not in the iOS SDK). Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Code Signing SubTopic: Entitlements Tags:
May ’24
Reply to Cocoa Pods App not working in BGAppRefreshTask
My desired result was to monitor my pool filler That’s not really feasible to do directly from iOS. The best way to solve this problem is to stand up some separate hardware that connects to the accessory with MQTT and, when the state changes, sends a push notification to your app. That hardware would be mains-powered, which offloads the energy impact of this task from your battery-powered iPhone. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: App & System Services SubTopic: Core OS Tags:
Feb ’24
Apple Push Notification Issue: Having Trouble Decrypting Messages
I have multiple mobile applications, one developed in React Native and the other in Objective-C and Swift hybrid technology. I use my own system to send push notifications, and these notifications are left encrypted in the Apple queues. However, in any of my applications, I am unable to catch these messages in the code block where I decrypt them. As a result, users see the messages encrypted. While I can deterministically detect this issue on devices experiencing the offload feature from Apple, I've also noticed sporadic occurrences of this issue on devices not utilizing offload. Due to my security policies, I have no chance of sending messages unencrypted. I'm trying to understand why this is happening and need suggestions for a solution. Is there anyone who can help? Additional Information: I use my own system for push notifications. Messages are left encrypted in the Apple queues. I am unable to catch the messages in the code block where I decrypt them in one of the applications. I can de
1
0
729
Feb ’24
Querying data from one-to-many relationship by aggregate in swiftdata
Hi all, I've been struggling a bit with SwiftData, I have a really simple data model but I need to do a fairly complex query over a one-to-many relationship that results in aggregate values. And I want to be able to sort and filter those aggregates. The model looks like this: @Model class Category { var name: String var items = [Item]() } @Model class Item { var added: Date var checked: Date? } In a typical use case I'd expect their to be at most around 50 categories and perhaps 20 items per category. In my UI I would like to be able to sort categories in a couple of ways: by name, by date added and by date checked with a fallback on date added. Also, in my list view I want to be able to list categories and show the checked date of the most recently checked item. I can think of a couple of solutions here, to start of with I can do all the sorting and filtering client-side. In the list view I could retrieve all the categories and then find the most recently checked item per category and go from there. Another
0
0
494
Jan ’24
Can you force Messages to offload old, stuck attachments on macOS?
It appears that some attachments get stuck and aren't offloaded like they are on iOS. I have 200-300 attachments, all dated 5/3/2021 (perhaps that's when I last formatted this Mac and downloaded from iCloud), and then it keeps 1-10 attachments from every month after that. I don't want to delete the attachments because I want them to stay in iCloud. Is there a terminal command to offload or set the maximum space Messages may use or something? Signing out and signing back in does nothing. They stay on the hard drive. Messages on my phone with the same synced conversations stay around 21GB.
0
0
783
Oct ’23
Offloading issues, for an App that is mostly used for Shortcuts
Hi, I have an app that is used by several Shortcuts. In many cases, users download the Shortcut, install the app, and only use the App through the Shortcut, and only through the in-extension Intent. They might never open the app. I've received complaints from users that the app keeps disappearing: apparently, because the app itself is never opened (only the in-extension Intent is), it doesn't count as an actual usage for offloading, and so the app gets offloaded. What can I do?
0
0
596
Oct ’23
Strange Microphone Issue on iOS 17.0.3
Hi all, I'm facing a strange issue on my iPhone 15 Pro Max with iOS 17.0.3 official release. A few days ago I was using WeChat and was making a voice call with my Airpods, and accidentally dropeed one of the Airdpod, after I picked it up, all of a sudden the person on the other end cannot hear me via the voice call anymore. Then I tried to send a voice message on WeChat and noticed it's also failing. Here's a list of things I've tried to investigate/narrow down this issue: I checked in Privacy settings and confirmed the toggle for Microphone is turned on for WeChat, also tried switching it to off then back on. I also checked WeChat's own permission settings and made sure all the toggles for Microphone are turned on, also tried switching them to off then back on. Tested other apps that uses the microphone (e.g. phone, facetime, voice memo, instagram, QQ (also from Tencent) etc.), and they are all working fine. Tried normal restart and hard restart of the phone, issue persists Log out from Wechat and log back i
4
0
2.9k
Oct ’23
Reply to iOS 17 app storage issue
Yes there is an issue with app storage in iOS 17, The cache data is somehow not getting erased from the app resulting in apps taking too much storage space. As off now only way is to offload the app or reinstall it, but the issue keeps on occurring. Waiting a soultion from Apple in the next update ASAP.
Topic: App & System Services SubTopic: Hardware Tags:
Oct ’23
Reply to iPad parent child refreshing issue - onAppear is NOT getting called every single time.
I tested with Xcode 14.2, iPad simulator (iOS 16.2) and it works as expected. on appear on topic Topic1 on appear on topic Topic2 on appear on topic Topic3 on appear on topic Topic1 on appear on topic Topic2 on appear on topic Topic3 Take care that onAppear is only called when view is loaded. May be in your case, view is not offloaded and reloaded ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’23
Reply to macOS NEFilterDataProvider best practices?
Are all flows funneled through a single serial queue that calls into my subclass? Yes. Should I offload flow processing onto a concurrent queue and then pause the flow and return from my callback? Or just do all processing in the callbacks? It’s kinda up to you. Certainly, I wouldn’t use a concurrent queue for this because I wouldn’t use a concurrent queue for anything (-: See Avoid Dispatch Global Concurrent Queues. However, handing work out to your own code that has its own concurrency model is perfectly reasonable. Now, as to whether that’ll actually improve the performance, that’s a very different question, one that doesn’t have an easy answer. My experience is that most networking code is I/O bound, so getting more CPUs to work on the problem doesn’t help. However, the only way to know for sure is to measure and test. And once I return an allow/deny verdict for the flow … do I no longer see that flow's traffic in my content filter? Correct. What if multiple content filters are present? Are they
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’23