How to play gif in widget? "网易云音乐" and "one widget" can play gif in the widget. can anyone guide me. Thank you
Delve into the world of built-in app and system services available to developers. Discuss leveraging these services to enhance your app's functionality and user experience.
Post
Replies
Boosts
Views
Activity
we are seeing what appears to be an internal healthkit error appearing in our app. not sure if it's connected, but we've mostly seen it reported on devices running ios 16. even though our app's primary language is japanese, and in all reported occurrences the app was running in japanese, the error message itself appears in english. searching the error string on the web yields surprisingly few results (including only two mentions on this forum that i could find, neither of which seemed relevant). this would seem to suggest that it's coming from something deep inside healthkit, since the error message is not localized.
in all reported cases, the user had recently upgraded to a new iphone. in most cases, the problem only occurs on the new device even though everything had been working correctly prior to the upgrade. the error occurs when the app is unable to read step count data from healthkit.
we have confirmed that the app has been granted access permissions to all health data via os settings. we've also tried having the user toggling those settings off, then back on, rebooting the device, deleting and reinstalling the app, etc., to no avail.
the error message is "Unable to invalidate interval: no data source avallable."
we'd appreciate it if anyone can shed more light on this issue.
thanks!
Hello, When Apple officially released iOS16 to users in Sept and Oct this year, our custom device that uses a nRF52832 Nordic based BLE chip would no longer hold the connection for more that 90 seconds before disconnecting.
Through other forums and documentation, we realized that with iOS16, Apple changed their requested Connection Intervals and we had to modify them on our product to solve.
[Previously Worked with iOS15 & below] Connection Interval for Product: Min 7.5ms - Max 15ms
Does not work with iOS16.0
Does work with iOS16.1 & iOS16.1.1
[Had to Change for iOS16.0, 16.0.1, 16.0.2, 16.0.3] Connection Interval for Product: Min 15ms - Max 30ms
However, with the release of iOS16.1 in November, our original connection interval parameters work again. Does anyone know what Apple changed for iOS16.1 for the connection intervals? Why does iOS16.1 accept 7.5-15ms intervals when iOS16.0 doesn't? There are no changes to the connection interval requirements on the Apple Design Guidelines as of the last revision Oct26th,2022.
Would really appreciate if anyone can share more info on the BLE change logs for iOS16.1.
Thanks for the help!
On iOS 16.0, I added accessories via the MTRDeviceController class in the Matter.framework, and it worked fine.
But when I will phone upgrade to the latest version of the iOS (iOS 16.1.1), after I call "MTRDeviceController" class "pairDevice: onboardingPayload: error:" method. I get an error like this:
CHIP: [BLE] BLE:Error writing Characteristics in Chip service on the device: [The specified UUID is not allowed for this operation.]
According to the error message, I guess that the characteristics of a certain Bluetooth cannot be read and written. After trying to verify it, I find that the characteristics uuid of the Matter accessory: "18EE2EF5-263D-4559-959F-4F9C429F9D12" cannot be read.
So, my question is what can I do in iOS 16.1.1 to make my app work as well as it does on iOS 16.0.
This is happening Mac M1 Monterey OS .Environment supports both IPv4 and IPV6.
When a http client calls gettaddrinfo() it is returning both IPv6,IPv4 IPs . first v6 IPs and then v4 IPs.
We need to have a way to sort gettaddrinfo() output to get v4 ip first and then v6.
We tried changing DNS order with scutil by putting v4 DNS first , but still getaddrInfo() listing v6 IPs first .
In linux there is a way to control gettaddrinfo() o/p with /etc/gai.conf https://man7.org/linux/man-pages/man5/gai.conf.5.html . In Mac I did not find any option like this , scutil changing order DNS is not effective . can you tell us what is way to do this in MAC OSx ?
I'm new to Xcode cloud - working with a Mac OS app, build is working great. Now I am trying to add a Test action; the testing target builds but won't run, and the error indicates it can't find the testing bundle in the expected build output. There's also mention of a code signing error, but I have automatic code signing enabled with the same settings on test target as the app.
I am only running the unit test (XCTest) scheme, not the UI tests. When I run it locally from the IDE it works fine, either selecting the test scheme explicitly or as the test step of the app scheme.
I notice the XCTest target's scheme setup uses Debug builds and expects the test output to be in the Debug .app bundle, I thought perhaps that was the problem (in case only the release app bundle actually gets built in the Xcode Cloud environment). So I created a duplicate scheme and set the build targets to Release - again I can run this fine locally (after creating a release build), but it fails with the same error in Xcode cloud.
I also tried changing the code signing certificate from "Development" to "Sign to run locally" to see if that made a difference, but I get the same error. (It's using my developer account Team, and "Automatically manage signing".)
Can anyone relate the proper way to set up an XCTest scheme so that the tests will actually run in a Mac OS Xcode Cloud workflow? I'm using Xcode 14.0.1.
Here's the full error output, with [AppName] and [TestTargetName] substituted for the actual:
[AppName] (....) encountered an error (Failed to load the test bundle. If you believe this error represents a bug, please attach the result bundle at /Volumes/workspace/resultbundle.xcresult. (Underlying Error: The bundle “[TestTargetName]” couldn’t be loaded. The bundle couldn’t be loaded. Try reinstalling the bundle. dlopen(/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName], 0x0109): tried: '/Volumes/workspace/TestProducts/Debug/[TestTargetName]' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/[TestTargetName]' (no such file), '/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName]' (code signature in <....> '/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName]' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?))))
Thanks!
This issue has cropped up many times here on DevForums. Someone recently opened a DTS tech support incident about it, and I used that as an opportunity to post a definitive response here.
If you have questions or comments about this, start a new thread and tag it with Network so that I see it.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
iOS Network Signal Strength
The iOS SDK has no general-purpose API that returns Wi-Fi or cellular signal strength in real time. Given that this has been the case for more than 10 years, it’s safe to assume that it’s not an accidental omission but a deliberate design choice.
For information about the Wi-Fi APIs that are available on iOS, see TN3111 iOS Wi-Fi API overview.
Network performance
Most folks who ask about this are trying to use the signal strength to estimate network performance. This is a technique that I specifically recommend against. That’s because it produces both false positives and false negatives:
The network signal might be weak and yet your app has excellent connectivity. For example, an iOS device on stage at WWDC might have terrible WWAN and Wi-Fi signal but that doesn’t matter because it’s connected to the Ethernet.
The network signal might be strong and yet your app has very poor connectivity. For example, if you’re on a train, Wi-Fi signal might be strong in each carriage but the overall connection to the Internet is poor because it’s provided by a single over-stretched WWAN.
The only good way to determine whether connectivity is good is to run a network request and see how it performs. If you’re issuing a lot of requests, use the performance of those requests to build a running estimate of how well the network is doing. Indeed, Apple practices what we preach here: This is exactly how HTTP Live Streaming works.
Keep in mind that network performance can change from moment to moment. The user’s train might enter or leave a tunnel, the user might walk into a lift, and so on. If you build code to estimate the network performance, make sure it reacts to such changes.
But what about this code I found on the ’net?
Over the years various folks have used various unsupported techniques to get around this limitation. If you find code on the ’net that, say, uses KVC to read undocumented properties, or grovels through system logs, or walks the view hierarchy of the status bar, don’t use it. Such techniques are unsupported and, assuming they haven’t broken yet, are likely to break in the future.
But what about Hotspot Helper?
Hotspot Helper does have an API to read Wi-Fi signal strength, namely, the signalStrength property. However, this is not a general-purpose API. Like the rest of Hotspot Helper, this is tied to the specific use case for which it was designed. This value only updates in real time for networks that your hotspot helper is managing, as indicated by the isChosenHelper property.
But what about MetricKit?
MetricKit is so cool. Amongst other things, it supports the MXCellularConditionMetric payload, which holds a summary of the cellular conditions while your app was running. However, this is not a real-time signal strength value.
But what if I’m working for a carrier?
This post is about APIs in the iOS SDK. If you’re working for a carrier, discuss your requirements with your carrier’s contact at Apple.
The api url :https://deviceservices-external.apple.com/deviceservicesworkers/escrowKeyUnlock
The document url: https://developer.apple.com/documentation/devicemanagement/device_assignment/activation_lock_a_device/creating_and_using_bypass_codes
We use the api for past 1+ years, it works well.
The api returns 404 not found response since 2022.12.02
<title>404 Not Found</title>
</head>
<body>
<center>
<h1>404 Not Found</h1>
</center>
<hr>
<center>Apple</center>
</body>
</html>
We contact apple support via email, but no useful response;
Hello. I took a closer look at the data I'm getting back for hourly forecasts and I'm baffled by results I'm seeing.
For example, it's Dec 19, 2022 8:00am PT and I'm asking for the weather for Orchard Park NY (lat 42.766437 long -78.743855) for Dec 23, 2022. The daily forecast tells me they're expected to have 5.9" of snow. However, the hourly forecast with the most snow that day is reported as 0.071" (1.8mm). The Apple Weather app on iOS shows that hour as having 0.6".
I wrote a 'for' loop to print the results of my call to WeatherService.shared.weather.
print(oneHour.precipitationAmount.formatted())
print(oneHour.precipitationAmount.description)
print(oneHour.precipitationAmount.unit)
print(oneHour.precipitationAmount.value)
0.071 in
1.8 mm
<_NSStatic_NSUnitLength: 0x2010b0178> mm
1.8
I'm using the iOS simulator with a StoreKit configuration file. I can see that there have been transactions while the app has been closed, but my StoreKit 2 listener is never called with those updates to be able to finish them When I open my app from a cold start.
I've added a listener on application(_:didFinishLaunching:launchOptions:) like this:
func startObservingTransactions() {
task = Task(priority: .background) {
for await result in Transaction.updates {
if case .verified(let transaction) = result {
await transaction.finish()
}
}
}
}
But the Transaction.updates loop never gets called (have added breakpoints to check). It's only ever called when a purchase is made, or subsequent transaction renewals when the app is open. Only then it will get the previously unfinished transactions.
Steps to reproduce:
Create an app with a StoreKit config file (with sped up transactions) to purchase an item
Make a purchase then quit the app
Wait for a bit for more transactions to be made while the app is closed.
Open the app from a cold start and none of the transactions will be finished by the listener in your app. Cancel the subscription via the transaction manager.
Close and open the app from a cold start. The first transaction will be finished by the listener but none of the others will be.
In Apple's docs it says
If your app has unfinished transactions, the listener receives them immediately after the app launches
Why is this not the case?
In main app, I can override dark/ light theme based on user preference, so that I can retrieve correct color information based on named color.
if (user preference) {
overrideUserInterfaceStyle = .light
} else {
overrideUserInterfaceStyle = .dark
}
// Dark theme/ light theme automatic aware color.
SwiftUI.Color("purpleColor")
However, how can I override the theme of a WidgetKit, so that my WidgetKit can interpret named color correctly?
I know in WidgetKit, I can read what is current system wide theme settings using
@Environment(\.colorScheme)
But, that is not what I want.
I want the ability to override theme of a WidgetKit based on user preference, then able to retrieve correct named color.
Thanks.
Hi.
A couple of days ago I've released my new iOS app version update including subscription(in-app-purchase).
App is successfully updated and deployed on store but App Store Connect says subscription is still waiting-for-review, and users cannot subscribe our paid features.
(API says it's an error; invalid product id)
On App Store Connect, it says
"A subscription has been returned and is highlighted in the table below."
in subscription section.
But there's no clue what am I supposed to do next to fix this.
I even have received the E-Mail says app update and subscription is successfully reviewed.
I am so confused can anyone help me with this?
Hi there,
This may be a dumb question but I'm trying to confirm this before we go down this road. Essentially, we are looking to have one premium subscription available to users within our app. A yearly subscription and that's it.
Since our app is brand new, we are looking to offer some "early adopter pricing" where early users can sign up for premium and lock in their yearly subscription at a fraction of what we will eventually charge. Will we be able to preserve pricing for select users while also making sure that new users aren't able to access that price?
I was reading some articles and saw mention of "unpreserving users subscription pricing" so I figured there must be the functionality to preserve then?
Thanks for the help!
I have a CoreData model, in a Swift Package with tests.
I can successfully run the tests, when I load the model using NSPersistentContainer, however attempting this with NSPersistentCloudKitContainer always fails in the call to loadPersistentStores(completionHandler block: @escaping (NSPersistentStoreDescription, Error?) -> Void)
The error is : [CK] BUG IN CLIENT OF CLOUDKIT: Not entitled to listen to push notifications. Please add the 'aps-connection-initiate' entitlement.
This issue is described on StackOverflow however, the accepted solution does not appear to work in my case.
I have tried adding the aps-connection-initiate key to my App Info.plist, the Test Info.plist and the SPM bundle. No change. (NB. adding this to the entitlements file just breaks auto signing).
I have enabled App entitlements for App Groups, Remote Notifications background mode, Push Notifications and iCloud CloudKit with a store identifier.
I have checked my model. All relationships have inverses. No unique constraints, etc. etc.
I am sharing a Bundle ID with a previous version of the App, that also uses CoreData+CloudKit, each version has it's own Model and container identifier, each container identifier is available in the provisioning profile.
The new version of the model has two NSPersistentStoreDescriptions, one is configured for CloudKit, the other is a local cache.
I am completely stuck, suggestions would be very welcome.
I can build the SimpleFirewall application (https://developer.apple.com/documentation/networkextension/filtering_network_traffic ) using xcode:
After I run the application, seems can't block any traffic.
I find there is some logs from network extension process:
networkd_settings_read_from_file Sandbox is preventing this process from reading networkd settings file at "/Library/Preferences/com.apple.networkd.plist", please add an exception.
Any step I am missing ?
I maintain a cross-platform client side network library for persistent TCP connections targeting Win32, Darwin and FreeBSD platforms. I recently upgraded to a Mac Studio w/ M1 Max (Ventura 13.1) from a late 2015 Intel Macbook Pro (Monterey 12.6.2) and I've encountered a discrepancy between the two.
For secure TCP connections my lib uses WolfSSL across all platforms but also supports use of system provided Security libraries. On Darwin platforms this is SecureTransport. Yes I am aware SecureTransport is deprecated in favor of Network. I intend to attempt to integrate with Network later but for now my architecture dictates that I use similar C-style callbacks akin to WolfSSL, OpenSSL, MBedTLS etc.
On the first call to SSLHandshake the SecureTransport write callback generates 151 bytes for my TLS 1.2 connection to example.com:443 on both platforms. However, while on Intel MBP I am able to continue with the full handshake I immediately receive 0 bytes with EOF. In Wireshark on the Intel MBP the 151 bytes are observed as a TLS 1.2 client hello while on M1 it is observed as an SSL continuation message and that is the last message observed.
During scanning, I got this error and scanning process immediately quips without any output. I wonder what this error means and what caused it. Thanks.
if #available(iOS 16.0, *) {
print("donated")
let intent = BasicIntent()
IntentDonationManager.shared.donate(intent: intent)
}
Trying to test if donations work with the new App Intents framework.
Donating the shortcut once a user taps a button.
The shortcut is not appearing on the lock screen.
Everything else is working as expected. The Shortcut is appearing in the Shortcuts App and is working via Siri.
In developer settings I have
Display Recent Shortcuts -> On
Display Donations on Lock Screen -> On
Allow Any domain -> On
Allow Unverified sources -> On
Running iOS 16.2, iPhone 11.
I can't find any useful help about the content described in the title on Apple's official website. The relevant help on its official website is almost all based on OC language, and even their sample programs are written in OC language. Can I ask if SWIFT can only use the COM port through the bridge of OC-SWIFT?
Hi,
I have 2 questions:
the api for L2CAP is only for BLE or can also work for BR/EDR? (currently didn't manage to connect with BR/EDR)
I use https://github.com/bluekitchen/CBL2CAPChannel-Demo on iPhone with le_credit_based_flow_control_mode from blue kitchen and the throughput was very low. I also tried to use L2TEST from Bluez (which uses L2CAP BASIC MODE) but it failed to connect
Can anybody help how to increase throughput? The best result I received was 18 kilobyte/second.
Thank you