Search results for

“offloading”

183 results found

Post

Replies

Boosts

Views

Activity

Reply to Network framework and background tasks
[quote='757385021, xiazhvera, /thread/757385, /profile/xiazhvera'] I'm working on an MQTT client for Apple platforms (macOS, iOS, and possibly tvOS and watchOS). [/quote] The story here varies by platform: For macOS, it’s possible to run indefinitely in the background. watchOS has significantly more restrictions than iOS. See TN3135 Low-level networking on watchOS for the details. tvOS generally follows iOS, except that one of the common workarounds, push notifications, is not available there. The rest of my response focuses on iOS (including iPadOS). [quote='757385021, xiazhvera, /thread/757385, /profile/xiazhvera'] it seems that my best bet is to use a long-running background process with BGProcessingTaskRequest while setting up the connection. Does that sound like the right approach? [/quote] No. Quoting iOS Background Execution Limits: To request extended background execution time, typically delivered overnight when the user is asleep, use BGProcessingTaskRequest. So, unless you just happen to want to run
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.2k
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
762
Feb ’24
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
3.0k
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
macOS NEFilterDataProvider best practices?
I've seen some discussion around performance on the forums but nothing official. What is the best practice for [handleNewFlow:] , [handleOutboundDataFromFlow:], and [handleInboundDataFromFlow:] callbacks in a content filter? Are all flows funneled through a single serial queue that calls into my subclass? If so this seems like we are back in the days of early OS X with the kernel network funnel serializing all network traffic. 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? And once I return an allow/deny verdict for the flow (without asking for more data) do I no longer see that flow's traffic in my content filter? That's what I would expect and it seems to be the case in actual practice too. For reference I never need to interact with the user. All of the rules are loaded from an EDR platform. I bring this up because we have users complaining of stuttering during Google Meet / Zoom, etc when ou
4
0
945
Aug ’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
Generating vertex data in compute shader
Hi there, I am working on a 3d game engine in Swift and Metal. Currently I dynamically generate vertex buffers for terrain chunks on the CPU and pass all models to the GPU via argument buffer and make indirect draw calls. Calculating where vertices should be is costly and I would like to offload the work to a compute shader. Setting up the shader was straightforward and I can see that it (at least as an empty function) is being executed in the CommandBuffer. However, I come to this problem: since I do not know ahead of time how many vertices a chunk of terrain will have, I cannot create a correctly-sized MTLBuffer to pass into the compute function to be populated for later use in a draw call. The only solution I could think of is something like the following: For each chunk model, allocate a VertexBuffer and IndexBuffer that will accommodate the maximum possible number of vertices for a chunk. Pass in the empty too-large buffers to the compute function Populate the too-large buffers and set the actua
6
0
2.0k
Jul ’23
Reply to Generating vertex data in compute shader
Reusing one big buffer instead of many seems like a great idea. Less moving parts the better here. Why the vertices are expensive to compute is mostly a question of scale. For instance, with indirect draw calls I can handle 4000+ chunks of terrain and 25 million+ vertices at 60 fps. With much lower terrain distances the meshing on the CPU can keep up fine, but when I push it there is a lot of frame dropping when moving over the terrain and generating meshes for dozens or hundreds of chunks. Part of this is that my meshing is single-threaded on the CPU, but my experience with Swift multi-threading is so far hit and miss for this kind of thing. As such, parallelism is the entire point of trying to offload this to a compute shader. The process of vertex generation is pretty standard for block/Minecraft-style terrain. We loop through all the blocks in a chunk, and if a block is solid, we check if any of its neighbours are air, and therefore if we should put a quad opposite it. Roughly: for y in i..
Topic: Graphics & Games SubTopic: General Tags:
Jul ’23
Reply to Network framework and background tasks
[quote='757385021, xiazhvera, /thread/757385, /profile/xiazhvera'] I'm working on an MQTT client for Apple platforms (macOS, iOS, and possibly tvOS and watchOS). [/quote] The story here varies by platform: For macOS, it’s possible to run indefinitely in the background. watchOS has significantly more restrictions than iOS. See TN3135 Low-level networking on watchOS for the details. tvOS generally follows iOS, except that one of the common workarounds, push notifications, is not available there. The rest of my response focuses on iOS (including iPadOS). [quote='757385021, xiazhvera, /thread/757385, /profile/xiazhvera'] it seems that my best bet is to use a long-running background process with BGProcessingTaskRequest while setting up the connection. Does that sound like the right approach? [/quote] No. Quoting iOS Background Execution Limits: To request extended background execution time, typically delivered overnight when the user is asleep, use BGProcessingTaskRequest. So, unless you just happen to want to run
Replies
Boosts
Views
Activity
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
Replies
2
Boosts
0
Views
1.2k
Activity
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:
Replies
Boosts
Views
Activity
May ’24
Reply to Other Storage Taking Too Much Space
You're not alone. Here's why it happens and what to do: Cause: System files, caches & incomplete iCloud sync can eat up space. Fix: Restart, offload apps, check iCloud settings, update iOS (if needed). Last Resort: Backup & restore as new (erase all content first!).
Replies
Boosts
Views
Activity
Apr ’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:
Replies
Boosts
Views
Activity
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
Replies
1
Boosts
0
Views
762
Activity
Feb ’24
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
Replies
4
Boosts
0
Views
3.0k
Activity
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:
Replies
Boosts
Views
Activity
Oct ’23
Reply to iPad parent child refreshing issue - onAppear is NOT getting called every single time.
I tested 20 times, on simulator, both in Portrait and landscape. onAppear always called. Please explain exactly how you get the error, and which versions you use. On simulator or device ? For the meaning: offloaded means the view is offloaded from view hierarchy and will be reloaded after.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
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:
Replies
Boosts
Views
Activity
Sep ’23
Reply to iOS - Cash APP options API Error Code : 8447435879
Clearing the cache can potentially resolve the issue if it is corrupted. To clear Cash App's cache on your iPhone, open the Settings app, go to General, Scroll down and tap on “iPhone Storage”, locate the Cash App and tap on it, Tap on “Offload App.” Confirm the action when prompted.
Replies
Boosts
Views
Activity
Aug ’23
macOS NEFilterDataProvider best practices?
I've seen some discussion around performance on the forums but nothing official. What is the best practice for [handleNewFlow:] , [handleOutboundDataFromFlow:], and [handleInboundDataFromFlow:] callbacks in a content filter? Are all flows funneled through a single serial queue that calls into my subclass? If so this seems like we are back in the days of early OS X with the kernel network funnel serializing all network traffic. 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? And once I return an allow/deny verdict for the flow (without asking for more data) do I no longer see that flow's traffic in my content filter? That's what I would expect and it seems to be the case in actual practice too. For reference I never need to interact with the user. All of the rules are loaded from an EDR platform. I bring this up because we have users complaining of stuttering during Google Meet / Zoom, etc when ou
Replies
4
Boosts
0
Views
945
Activity
Aug ’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:
Replies
Boosts
Views
Activity
Aug ’23
Generating vertex data in compute shader
Hi there, I am working on a 3d game engine in Swift and Metal. Currently I dynamically generate vertex buffers for terrain chunks on the CPU and pass all models to the GPU via argument buffer and make indirect draw calls. Calculating where vertices should be is costly and I would like to offload the work to a compute shader. Setting up the shader was straightforward and I can see that it (at least as an empty function) is being executed in the CommandBuffer. However, I come to this problem: since I do not know ahead of time how many vertices a chunk of terrain will have, I cannot create a correctly-sized MTLBuffer to pass into the compute function to be populated for later use in a draw call. The only solution I could think of is something like the following: For each chunk model, allocate a VertexBuffer and IndexBuffer that will accommodate the maximum possible number of vertices for a chunk. Pass in the empty too-large buffers to the compute function Populate the too-large buffers and set the actua
Replies
6
Boosts
0
Views
2.0k
Activity
Jul ’23
Reply to Generating vertex data in compute shader
Reusing one big buffer instead of many seems like a great idea. Less moving parts the better here. Why the vertices are expensive to compute is mostly a question of scale. For instance, with indirect draw calls I can handle 4000+ chunks of terrain and 25 million+ vertices at 60 fps. With much lower terrain distances the meshing on the CPU can keep up fine, but when I push it there is a lot of frame dropping when moving over the terrain and generating meshes for dozens or hundreds of chunks. Part of this is that my meshing is single-threaded on the CPU, but my experience with Swift multi-threading is so far hit and miss for this kind of thing. As such, parallelism is the entire point of trying to offload this to a compute shader. The process of vertex generation is pretty standard for block/Minecraft-style terrain. We loop through all the blocks in a chunk, and if a block is solid, we check if any of its neighbours are air, and therefore if we should put a quad opposite it. Roughly: for y in i..
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’23