Why is "CarPlay.app" text shown in Location Services? All other app listings display an icon instead of text - so this looks suspicious. It may be a bug though. Has anyone else seen this?
I’ve filed this via Apple Feedback app but no response from Apple yet.
Device is running iOS 16.2beta.
General
RSS for tagDelve 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
When I tap on one of the buttons in the ShieldAction extension I want to close the shield and open the parent app instead of the shielded app. Is there any way of doing this using the Screen Time API?
class ShieldActionExtension: ShieldActionDelegate {
override func handle(action: ShieldAction, for application: ApplicationToken, completionHandler: @escaping (ShieldActionResponse) -> Void) {
// Handle the action as needed.
let store = ManagedSettingsStore()
switch action {
case .primaryButtonPressed:
//TODO - open parent app
completionHandler(.defer)
case .secondaryButtonPressed:
//remove shield
store.shield.applications?.remove(application)
completionHandler(.defer)
@unknown default:
fatalError()
}
}
}
I've added a background downloads extension to my app and added device console logging to every method in the placeholder code created by XCode, and Setting a breakpoint, then installed the app to the phone.
When I run the following command:
xcrun backgroundassets-debug --app-bundle-id com.myCompany.myApp --device-id 00008110-001E0DDA0AB8801E --simulate --app-update
prompt: Application was updated event was sent for app identifier: (com.myCompany.myApp).
But the break point did not enter。Nothing is sent, and there is no log output
How do I set breakpoints in the extension for debugging?
How to play gif in widget? "网易云音乐" and "one widget" can play gif in the widget. can anyone guide me. Thank you
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
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.
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'd like to build an AppIntent where the parameters are included in the initial invocation.
First-party example "Set a timer for 10 minutes" immediately sets new timer using the parameter 10 minutes.
Is this possible via AppIntents? Or do we have to invoke with "Set a timer" then give parameters via dialog: "for how long"? with user replying "10 minutes."
After the Screen Time permissions have been provided by the user, when I create a label with the user's selected ApplicationToken or CategoryToken, it's often (not always!) show like this:
I instantiate the label like this, where app is an ApplicationToken or CategoryToken:
Label(app)
.labelStyle(.iconOnly)
After the app is killed and reloaded, the icons show up fine.
Any suggestions on how to fix this? Is this an issue with the Screen Time API, or am I instantiating the label in the wrong way?
I'm writing an app that uses text to speech. On the physical Iphone 12 it works but on the simulator I don't get any speech from my app.
I tried the following to enable.
Settings -> Accessebility -> "Spoken Content" -> "Speak Selecton" to ON (green)
in Voices I added the German Anna that I use on my Iphone with the downloaded enhancements.
The speech test works in this menu but not in my app. What am I missing ?
Cheers,
Gerhard
I’ve created a single-target watchOS app in Xcode 14, but I can’t seem to get ClockKit complications working.
I’ve added a CLKComplicationDataSource class to my watch target, and in the Info pane for my target I have set the CLKComplicationPrincipalClass key to MODULE-NAME.ComplicationController
I haven’t yet added Complication placeholder images to my Assets.xcassets, but as far as I am aware, that shouldn’t be a problem while I am still testing.
However, when I run it on a watchOS simulator, the complications never show up on the watch complications list when adding a complication.
All of the tutorials I can find for ClockKit complications reference older two-target WatchKit apps. Do the newer single target apps no longer support ClockKit? If so, how can I make a two-target WatchKit app with Xcode 14?
Unfortunately I cannot use WidgetKit for my complications because I need to support watchOS 7 at least, and WidgetKit only supports watchOS 9+
Thanks for your help
My pipeline broke today as new fields were added for the current weather dataset:
cloudCoverLowAltPct
cloudCoverMidAltPct
cloudCoverHighAltPct
I presumed new fields would only be released in a new version of the API? Is there any way to use a specific version of the API that will not be subject to change?
The current weather REST API docs are here, which don't include these fields: https://developer.apple.com/documentation/weatherkitrestapi/currentweather/currentweatherdata
currently when I try to set several schedules to the same activity the latest schedule I set is the only one
I understand I can have only 1 schedule for activity. ?
I thought about setting a new schedule on the intervalDidEnd but, I get no interval did start if the current time is in the middle of the interval I set
For example, now it is 15:00, and my previous interval started at 14:00 and ends at 16:00 but the user sets a new interval from 14:30 - 16:40
I call the deviceActivityCenter.stopMonitoring([someActivityName]) and get noIntervalDidEnd event
Then I set the new interval successfully with deviceActivityCenter.startMonitoring(someActivityName, during: deviceActivitySchedule)
and get no intervalDidStartEvent
So how can I achieve several intervals?
If I had gotten the events of the start and end it would be possible
Thanks for the help
Hi, I'm developing an app that reads the NFC tags. So far so good, everything worked as expected, the app reads the passports and the IDs, until we encountered the french ID issued after March 2021. My app has the following entitlements:
<dict>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>TAG</string>
</array>
</dict>
And this additional entries in the .plist:
<key>NFCReaderUsageDescription</key>
<string>NFC usage to scan ID chip</string>
...
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000002471001</string>
<string>A0000002472001</string>
<string>00000000000000</string>
</array>
According to an article which I cannot link on this forum because the domain is not permitted, iOS started supporting this specific ID from version 16. When I look at the docs, I can see the .pace polling mode was added. I tried specifying this additional polling mode in my app like so:
var pollingOptions: NFCTagReaderSession.PollingOption = [.iso14443]
if #available(iOS 16, *) {
pollingOptions.insert(.pace)
}
self.session = NFCTagReaderSession(pollingOption: pollingOptions, delegate: self, queue: nil)
But when I try to start the session it gets instantly invalidated with this message: Missing required entitlement. I'm pretty confident the message is misleading and something else is missing somewhere, my bet would be on the .plist entry com.apple.developer.nfc.readersession.iso7816.select-identifiers missing one of the cryptic numbers, but I have no idea where this can be taken from.
How do I implement this .pace polling mode, can someone give me some guidance?
3.5 weeks ago I submitted form https://developer.apple.com/contact/request/family-controls-distribution to get Family Controls entitlement for my app.
I still not received any feedback at all...
Contacting Support also doesn't help...
Is there any time limits for this request or any average time of waiting for feedback?
Hi,
I've been attempting to implement a customised shield based on the WWDC contents and documentation; however, while my configuration appears correct only the default "Restricted - You cannot use X app because it's restricted" ever displays.
A quick summary of what I have done:
Created a ShieldConfigurationExtension
Ensured suitable Info.plist values - below
Defined custom Shield within the configuration() methods - application example below
Any suggestions on what might not be implemented correctly?
Info.plist
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.ManagedSettingsUI.shield-configuration-service</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ShieldConfigurationExtension</string>
</dict>
</dict>
</plist>
Configuration
import ManagedSettings
import ManagedSettingsUI
import UIKit
class ShieldConfigurationExtension: ShieldConfigurationDataSource {
override func configuration(shielding application: Application) -> ShieldConfiguration {
// Customize the shield as needed for applications.
return ShieldConfiguration(
backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial,
backgroundColor: UIColor.white,
icon: UIImage(systemName: "stopwatch"),
title: ShieldConfiguration.Label(text: "No app for you", color: .yellow),
subtitle: ShieldConfiguration.Label(text: "Sorry, no apps for you", color: .white),
primaryButtonLabel: ShieldConfiguration.Label(text: "Ask for a break?", color: .white),
secondaryButtonLabel: ShieldConfiguration.Label(text: "Quick Quick", color: .white)
)
}
}
Hello,
I used to have running campaigns in mostly all regions, but recently I got this message on some of the countries that were previously added and have recently become ineligible. It shows a yellow triangle with an exclamation mark next to them saying "This campaign is no longer eligible to run in one or more countries or regions.".
However I think my app respects and complies with all Policies, so I don't think I am in Violation with them.
Do you know how to apply/request a manual review on advertising in these countries.
P.S I was in contact with Apple Support but they only responded by giving directions to the Policy and Guidelines sections, which is not a helpful response in any ways.
I’m working on an independent watchOS app which is primarily designed to to collect and periodically send location updates to a server. The UI features a toggle that allows the user to turn this capability on or off at their discretion. The typical use case scenario would be for the user to turn the toggle on in the morning, put the app in the background and then go about their day.
Given the limitations and restrictions regarding background execution on watchOS, in an ideal situation, I would be able to upload the stored location updates about every 15-20 minutes. With an active complication on the watch face, it’s my understanding that this should be possible. I’ve implemented background app refresh and indeed, I do see this reliably being triggered every 15-20 minutes or so.
In my handle(_:) method, I process the WKApplicationRefreshBackgroundTask like this:
func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) {
backgroundTasks.forEach { task in
switch task {
case let appRefreshBackgroundTask as WKApplicationRefreshBackgroundTask:
// start background URL session to upload data; watchOS will perform the request in a separate process so that it will continue to run even if our app gets
// terminated; when the system is done transferring data, it will call this method again and backgroundTasks will contain an instance of
// WKURLSessionRefreshBackgroundTask which will be processed below
startBackgroundURLSessionUploadTask()
scheduleNextBackgroundAppRefresh()
appRefreshBackgroundTask.setTaskCompletedWithSnapshot(false)
case let urlSessionTask as WKURLSessionRefreshBackgroundTask:
// add urlSessionTask to the pendingURLSessionRefreshBackgroundTasks array so we keep a reference to it; when the system completes the upload and
// informs us via a URL session delegate method callback, then we will retrieve urlSessionTask from the pendingURLSessionRefreshBackgroundTasks array
// and call .setTaskCompletedWithSnapshot(_:) on it
pendingURLSessionRefreshBackgroundTasks.append(urlSessionTask)
// create another background URL session using the background task’s sessionIdentifier and specify our extension as the session’s delegate; using the same
// identifier to create a second URL session allows the system to connect the session to the upload that it performed for us in another process
let configuration = URLSessionConfiguration.background(withIdentifier: urlSessionTask.sessionIdentifier)
let _ = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
default:
task.setTaskCompletedWithSnapshot(false)
}
}
}
And here is how I'm creating and starting the background URL session upload task:
func startBackgroundURLSessionUploadTask() {
// 1. check to see that we have locations to report; otherwise, just return
// 2. serialize the locations into a temporary file
// 3. create the background upload task
let configuration = URLSessionConfiguration.background(withIdentifier: Constants.backgroundUploadIdentifier)
configuration.isDiscretionary = false
configuration.sessionSendsLaunchEvents = true
let backgroundUrlSession = URLSession(configuration: configuration, delegate: self, delegateQueue: nil)
let request: URLRequest = createURLRequest() // this is a POST request
let backgroundUrlSessionUploadTask = backgroundUrlSession.uploadTask(with: request, fromFile: tempFileUrl)
backgroundUrlSessionUploadTask.countOfBytesClientExpectsToSend = Int64(serializedData.count) // on average, this is ~1.5 KB
backgroundUrlSessionUploadTask.countOfBytesClientExpectsToReceive = Int64(50) // approximate size of server response
backgroundUrlSessionUploadTask.resume()
}
Note that I'm not setting the .earliestBeginDate property on the backgroundUrlSessionUploadTask because I'd like the upload to start as soon as possible without any delay. Also, this same class (my WatchKit application delegate) conforms to URLSessionTaskDelegate and I have implemented urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:) and urlSession(_:task:didCompleteWithError:).
In my testing (on an actual Apple Watch Ultra running watchOS 9.3.1), I've observed that when the system performs the background app refresh, I always receive a callback to myhandle(_:) method. But when I start the background URL session upload task (in startBackgroundURLSessionUploadTask()), I was expecting that when the upload completes, I'd receive another call to myhandle(_:) method with an instance of WKURLSessionRefreshBackgroundTask but this doesn't seem to happen consistently. Sometimes I do see it but other times, I don't and when I don't, the data doesn't seem to be getting uploaded.
On a side note, most of the time, startBackgroundURLSessionUploadTask() gets called as a result of my code handling a background app refresh task. But when the user turns off the toggle in the UI and I stop the location updates, I need to report any stored locations at that time and so I call startBackgroundURLSessionUploadTask() to do that. In that specific case, the upload seems to work 100% of the time but I definitely don't see a callback to my handle(_:) method when this occurs.
Am I wrong in expecting that I should always be getting a callback to handle(_:) when a background URL session upload task completes? If so, under what circumstances should this occur? Thanks very much!
Universal links stopped working lately. Nothing has changed in our code nor in the "apple-app-site-association" file.
We use it for years and it suddenly stopped working.
Any ideas?