CBCentralManager's retrievePeripherals(withIdentifiers:) not yielding CBPeripherals under iOS13? - xamarin

I was wondering if anyone ran into the same problem under iOS 13 that the call to CBCentralManager retrievePeripherals(withIdentifiers:) returns 'null' although there is a ble device paired with the system?
This seems to be a specific problem in combination with iOS13 since if I'm testing the very same code under iOS 12, I'm getting the paired devices as expected.
I already had a look at apple's core bluetooth documentation today where, however, i could not find possible deviations which might have arised with iOS 13.
Any information is greatly appreciated!

Basically the issue was related to the fact, that the BLE stack was not ready when i tried to initialize the device (see here).

Related

kVTCompressionPropertyKey_DataRateLimits property not being respected by hardware encoder, macOS

I am working on a macOS project that uses hardware acceleration for video encoding, using VideoToolbox. I have tried controlling the bitrate using kVTCompressionPropertyKey_AverageBitRate and kVTCompressionPropertyKey_DataRateLimits, but after many attempts it still frequently overshoots the target bitrate.
Is kVTCompressionPropertyKey_DataRateLimits respected on macOS?
When I use VTSessionCopySupportedPropertyDictionary to get the supported properties on my compression session, DataRateLimits shows up in the dictionary, and I have set it on the compression session without error. But then if I try to actually get the value of it using
CFTypeRef value = nullptr;
result = VTSessionCopyProperty(m_compressionSessionRef, (__bridge CFStringRef)key, kCFAllocatorDefault, &value);
where key is DataRateLimits, as taken from the dictionary, it returns an error that the property is unsupported. But on iOS, it returns successfully.
This seems pretty serious, and does not appear limited to my machine. If it's truly not supported, that would help explain the volatility of my encoding bitrate. However, in months of working on this project and researching VideoToolbox, I have not seen anything about this not being supported by the hardware encoder on macOS. I would think such a defect would be a big issue. Does anyone have any insight here? Thank you!
Update: 8/5
Note: SDKs targeted are recent (macOS-10.14.x, iOS-12.x). I see this issue on multiple hardware models with varying versions of macOS (10.11-10.14), though all are MacBook Pros, going as far back as 2013/2014, as well as recent touch models 2017/2018. For iOS, I don't have a lot of data, but I see DataRateLimits appears as expected on 12.3.1, and on iPhone 7 and iPhone X. Bottom line, the OS version and hardware doesn't seem to matter; it works on phones, but not laptops.

Using IOKit in macOS app

I found several topics where arises the same question, but they're pretty old and most of them don't have a definite answer, or the answer is applicable to iOS only. Also some sources say it's prohibited while other disagree.
For example, here or here about iOS.
I'm interested whether IOKit can be used for macOS applications - note! macOS, not iOS - to get only battery information.
If no, I'd like to find out, how apps like Battery Health work.
What are your guesses? Thanks.
The IOKit.framework is a reasonably well documented, public API on macOS. Many apps and most 3rd party device drivers use it. For the Mac App Store, entitlements restrictions apply.
Regarding Mac battery status, you probably want to take a look at the IOPMPowerSource/AppleSmartBattery objects. The output from running the following command on the Terminal should give you an idea of what information is available:
ioreg -w 0 -irc IOPMPowerSource
The AppleSmartBattery source code is available, that's probably your best reference.

Xamarin.Forms Maps Not Displaying Tiles on iOS

I have an iOS mobile app that was developed a year ago and I know I have done the setup properly since the Xamarin.Forms Maps were working then. I updated to the latest nuget libraries recently and I am seeing the map but without the tiles rendered. I also have entries for the info.plist permissions that cropped up in iOS 8:
<key>NSLocationAlwaysUsageDescription</key>
<string></string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
Did something change recently with native maps for iOS 9?
I have faced this issue too, also in conjunction but not exclusively with Xamarin.Forms. This behavior can be reproduced with the pre-installed Apple maps app in several cases for instance:
if you are connected to a network that requires proxy-credentials to connect to the internet
really bad network latency
or reduced data-carrier network speed
At the moment it seems like there is no work-around. At least I couldn't find one suitable.
I know answering this question is too late. But for those of you who haven't found the answers yet, could try this option, as I too had a similar issue and solved it by following the link below.
If you are using Xamarin.Forms.Maps NuGet package, some initialization code is required in each application project, after the Xamarin.Forms.Forms.Init method call. For iOS use the following code in your AppDelegate.cs:
Xamarin.FormsMaps.Init();
Refer this link for more information.

A proper way of handling audio I/O devices attache and detach on Mac

I have been looking for something similar for
AVCaptureDeviceWasConnectedNotification or AVCaptureDeviceWasDisconnectedNotification
but for audio playback and record device. I have done a quick google search, but I haven't found any quite relevant answer for this question. There is a sample code from Apple AVCaptureToAudioUnitOSX. but it does not handle multiple audio route.
I wonder if anyone has idea about it?
You can do this at IOKit level by adding IOKit matching notifications for audio devices being hot-plugged or unplugged. [Caveat - I've not done this in about a decade: higher level APIs might exist]
Apple's documentation for this is here - particularly the section
Getting Notifications of Device Arrival and Departure
This is quite hard work. I advise you to get the IORegistryExplorer tool - which I believe is now in the Hardware IO Tools for Xcode download package (Xcode->Open Developer Tool->More Developer Tools). You can use this to work out the matching criteria.

Ready iCloud + Core Data solution

I spent 10 days trying to debug iCloud connection for my (extra cool) app coming... Its really hard to set up when you use Core Data. Now it doesn't work on device with iCloud on.
I want to ask if there is ready open-source solution to copy&paste code to my app for it finally to run?
Thanks!
***Not interested in iCloud analogs like parse, dropbox...
There's code around, but code is not the problem. In the current versions of Mac OS X and iOS, and in the current version of whatever server side code they're using, Core Data with iCloud often just fails to work. This happens even if your code is exactly right. Start with Apple's sample code (including the SharedCoreData example from WWDC 2012), and if you have specific questions, ask them. But getting the code just right is not enough. File bugs and hope that future versions of Mac OS X and iOS are better.

Resources