I have widgets providing their timeline using the .atEnd reload policy, i.e.:
// AppIntentTimelineProvider:
return Timeline(entries: entries, policy: .atEnd)
// TimelineProvider
let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline)
I can't seem to find any information on what happens after the end of the timeline. So, let's say I've got two days worth of entries, the dev docs for the reload policy say, "A policy that specifies that WidgetKit requests a new timeline after the last date in a timeline passes."
Great! But how does it request the new timeline? Does iOS launch my app in the background and simply re-run the timeline to generate another two days worth of entries? I doubt it.
I figure I need to implement some sort of background task, and the dev docs say how to do it with an Operation, but then I read that this is an old way of doing it? I've found some info online saying to use something like this, so this is what I've implemented:
let kBackgroundWidgetRefreshTask = "my.refresh.task.identifier" // This has been registered in the info.plist correctly
class SchedulingService {
static let shared = SchedulingService()
func registerBackgroundTasks() {
let isRegistered = BGTaskScheduler.shared.register(forTaskWithIdentifier: kBackgroundWidgetRefreshTask, using: nil) { task in
print("Background task is executing: \(task.identifier)") // This does print "true"
self.handleWidgetRefresh(task: task as! BGAppRefreshTask)
}
print("Is the background task registered? \(isRegistered)")
}
func scheduleWidgetRefresh() {
let request = BGAppRefreshTaskRequest(identifier: kBackgroundWidgetRefreshTask)
// Fetch no earlier than 1 hour from now - test, will be two days
request.earliestBeginDate = Date(timeIntervalSinceNow: 60 * 60)
do {
try BGTaskScheduler.shared.submit(request)
print("Scheduled widget refresh for one hour from now")
} catch {
print("Could not schedule widget refresh: \(error)")
}
}
private func handleWidgetRefresh(task: BGAppRefreshTask) {
// Schedule a new refresh task
scheduleWidgetRefresh()
// Start refresh of the widget data
let refreshTask = Task {
do {
print("Going to refresh widgets")
try await self.backgroundRefreshWidgets()
task.setTaskCompleted(success: true)
} catch {
print("Could not refresh widgets: \(error)")
task.setTaskCompleted(success: false)
}
}
// Provide the background task with an expiration handler that cancels the operation
task.expirationHandler = {
refreshTask.cancel()
}
}
func backgroundRefreshWidgets() async throws {
print("backgroundRefreshWidgets() called")
definitelyRefreshWidgets()
}
}
As I've commented above, the line print("Background task is executing: \(task.identifier)") does print true so the task has been registered correctly.
I've put the app into the background and left it for hours and nothing is printed to the console. I've implemented a logger that writes to a file in the app container, but that doesn't get anything either.
So, is there something I'm misunderstanding? Should I change the reload policy to .after(date)? But what makes the timeline reload?
As a second but linked issue, my widgets have countdown timers on them and the entire timeline shows that every entry is correct, but the widgets on the Home Screen simply fail to refresh correctly.
For example, with timeline entries for every hour for the next two days from 6pm today (so, 7pm, 8pm...) every entry in the preview in Xcode shows the right countdown timer. However, if you put the widget on the Home Screen, after about five hours the timer shows 25:12:34 (for example).
No entry in the timeline preview ever shows more than 24 hours because the entires are every hour, and the one that shows a timer starting at 23:00:00 should never get to 24:00:00 as the next entry would kick in from 0:00:00, so it should never show more than 23:59:59 on the timer. It's like the 23:00:00 timer is just left to run for hours instead of being replaced by the next entry.
It's as though the widget isn't refreshing correctly and entries aren't loaded? Given this is the Simulator - and my development device - and both are set to Developer Mode so widget refresh budgets aren't an issue, why is this happening? How do you get widgets to refresh properly? The dev docs are not very helpful (neither is the Backyard Birds example Apple keep pushing).
Thanks!
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.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
My app AirCompare has been in the app store and successfully using WeatherKit to fetch weather since it became available. Now some (not all) users are encountering the following errors:
Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
Encountered an error when fetching weather data subset; location=<+42.40865786,-88.96911526> +/- 0.00m (speed -1.00 mps / course -1.00) @ 6/23/25, 2:56:47 PM Central Daylight Time, error=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors 2 Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
Others are reporting this same problem here in the forums. We need a solution!
We have a subscription WeatherKit app which has been on the App Store since December 2023.
I am getting intermittent JWT auth failures on customer devices. In the great majority of cases, the request succeeds, but sometimes it fails, and sometimes it fails and never recovers. I’m working with a customer right now who is unable to get any weather data at all, and the logs he sends me show
WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors error 2
The app uses the WeatherKit SDK (we are not using the REST API directly). We know we have the project setup as it has been working since launch, and I can verify weatherkit using
security cms -D -i embedded.mobileprovision
It it not a problem with the specific query, since I can get data for the dates and locations they are requesting. I can’t replicate the problem on my test devices.
In case there is a rate limit issue: this app is a bit unusual and downloads an unusual amount of data at once using multiple queries in parallel using a TaskGroup. When the user creates a location, the app downloads a 10 day block of weather (7 days in the past + 3 day forecast) using
WeatherService.shared.weather(
for: location,
including: WeatherQuery.daily(
startDate: startDate,
endDate: endDate
),
WeatherQuery.hourly(
startDate: startDate,
endDate: endDate
)
)
It also downloads about 2 months of daily precipitation data using multiple parallel calls to dailySummary in 10 day blocks:
WeatherService.shared.dailySummary(
for: location,
forDaysIn: DateInterval(start: startDate, end: endDate),
including: .precipitation
)
In almost every case, including on my test devices, this works. But some users get WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors error 2 on every request.
The two users yesterday that had this problem were both on iOS 18.5 for what that's worth, though the app supports 17.2+
Is anyone else seeing this? And can anyone suggest anything else to explore? It's obviously a terrible experience for customers who pay for the service and are unable to get any data.
I did submit this info to Apple as FB18276275
I have an app using weatherkit and its currently live and up on the app store, recently I had some users report to me that they had been receiving errors loading weather data, I had error handling built in and it reported an issue with apples authentication server
Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "(null)"
I have not come across this during the development lifecycle of my project, there where no codebase changes, it just stopped functioning.
The app entitlements are valid and correct, Weatherkit is enabled in both xcode and across my Certs, identifiers and profiles.
I was not experiencing this issue until I reinstalled the app from the app store completly by first removing it and then re-installing fresh.
Hard reboots do not help and I do not want to start suggesting to my users to factory reset their devices.
We are using WeatherKit in both our main app and widget, relying entirely on Apple’s framework for authentication and token management.
We do not generate or inject our own JWT tokens; all token handling is managed by WeatherKit.
We have implemented a debug menu with the following actions:
Clear WeatherKit JWT tokens from the keychain
Clear all related UserDefaults key
Clear all app group data and all UserDefaults.
Perform a “nuclear” cache clear (removes all app data, keychain, and cached files).
We log all WeatherKit fetch attempts and failures, including authentication errors, both in the app and widget and get nothing but code 2.
We have attempted all of the above steps, but continue to experience issues with WeatherKit JWT authentication
We would appreciate any guidance or insight into what else could be causing persistent WeatherKit JWT/authentication issues, or if there are any additional steps we should try.
P.S. - Tested and experiencing the same issues on an iPhone 15 Pro Max and iPhone 15
The Pro Max is on the iOS 26 Beta // and the 15 is on the latest iOS 18
Hi All,
requirement - "Search (placeholder) in (myApp)".
When user speaks this strings, Siri should open the app and pass the placeholder.
This worked for me only when i used an AppEnum (with specific defined set) with AppEntity.
I want the placeholder to be dynamic and not defined via the AppEnum.
Have observed this feature working fine with Youtube, Spotify & Whatsapp apps.
Is there anything else that these app add specifically to make this work. ?
Also in these app's Siri settings, there is a toggle named - 'Use with Ask Siri'.
Could someone please help in understanding, how this option is enabled ?
I created a ShieldConfigurationExtension in Xcode 14.3 with File > New > Target > ShieldConfigurationExtension. This created the extension with all the necessary Info.plist values (correct NSExtensionPrincipalClass, etc.), with the extension included in embedded content in the host app target.
No matter what I try, the extension is not getting invoked when I shield applications from my host app. The custom UI does not show as the shield, and looking at the debugger, an extension process is never invoked.
I am shielding categories like this:
let managedSettings = ManagedSettingsStore()
...
managedSettings.shield.applicationCategories = .all()
And my extension code overrides all the ShieldConfigurationDataSource functions.
class ShieldConfigurationExtension: ShieldConfigurationDataSource {
override func configuration(shielding application: Application) -> ShieldConfiguration {
return ShieldConfiguration(
backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial,
backgroundColor: UIColor.white,
icon: UIImage(systemName: "stopwatch"),
title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow)
)
}
override func configuration(shielding application: Application, in category: ActivityCategory) -> ShieldConfiguration {
return ShieldConfiguration(
backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial,
backgroundColor: UIColor.white,
icon: UIImage(systemName: "stopwatch"),
title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow)
)
}
override func configuration(shielding webDomain: WebDomain) -> ShieldConfiguration {
return ShieldConfiguration(
backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial,
backgroundColor: UIColor.white,
icon: UIImage(systemName: "stopwatch"),
title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow)
)
}
override func configuration(shielding webDomain: WebDomain, in category: ActivityCategory) -> ShieldConfiguration {
return ShieldConfiguration(
backgroundBlurStyle: UIBlurEffect.Style.systemThickMaterial,
backgroundColor: UIColor.white,
icon: UIImage(systemName: "stopwatch"),
title: ShieldConfiguration.Label(text: "You are in a Present Session", color: .yellow)
)
}
}
What am I missing?
Topic:
App & System Services
SubTopic:
General
Tags:
Extensions
Managed Settings
Family Controls
Device Activity
Hello,
I think it is quite a common use-case to open the parent app that owns the ShieldActionDelegate when the user selects an action in the Shield.
There are only three options available that we can do in response to an action:
ShieldActionResponse.none
ShieldActionResponse.close
ShieldActionResponse.defer
It would be great if this new one would be added as well:
ShieldActionResponse.openParentApp
While finding a workaround for now, the problem is that the ShieldActionDelegate is not a normal app extension. That means, normal tricks do not work to open the parent app from here.
For example, UIApplication.shared.open(url) does not work because we can’t access UIApplication from the ShieldActionDelegate unfortunately.
NSExtensionContext is also not available in the ShieldActionDelegate unfortunately, so that’s also not possible.
There are apps however, that managed to find a workaround, in my research I stumbled across these two:
https://apps.apple.com/de/app/applocker-passcode-lock-apps/id1132845904?l=en-GB
https://apps.apple.com/us/app/app-lock/id6448239603
Please find a screen recording (gif) attached.
Their workaround is 100% what I’m looking for, so there MUST be a way to do so that is compliant with the App Store guidelines (after all, the apps are available on the App Store!).
I had documented my feature request more than 2 years ago in this radar as well: FB10393561
In iOS 18, the requestValue method no longer works when the parameter it is called on is not included in the parameterSummary of an AppIntent. This issue causes the app to fail to present a prompt for the user to select a value, resulting in an error with the message:
Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 40685 on anonymousListener or serviceListener was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid."
Steps to Reproduce:
Create a simple AppIntent with the following code:
import AppIntents
struct Intent: AppIntent {
static let title: LocalizedStringResource = "Intent"
static var parameterSummary: some ParameterSummary {
Summary("Test \(\.$category)") {}
}
@Parameter(title: "Category")
private var category: CategoryEntity?
@Parameter(title: "Hidden Category")
private var hidden: CategoryEntity?
@MainActor
func perform() async throws -> some ReturnsValue<CategoryEntity?> {
var result: CategoryEntity?
do {
result = try await $hidden.requestValue("Select category") // Doesn't work since iOS 18 as $hidden is not set in parameterSummary
} catch {
print("\(error)")
}
return .result(value: result)
}
}
Run the code on a device with iOS 18.
Observe that the requestValue method fails to present the selection prompt and instead throws an error.
Expected Results:
The app should successfully present a prompt for the user to select a value for the hidden parameter using requestValue, even if the parameter is not included in the parameterSummary.
Actual Results:
The app fails to present the selection prompt and throws an error, making it impossible to use requestValue for parameters not included in parameterSummary.
Version/Build:
iOS 18.0
Configuration:
Tested on various devices running iOS 18.
Is there a change in the API that I might have missed?
A message filter extension is only forwarded SMSs by the OS for filtering, iMessages aren't.
But what is the situation with RCS messages? Will they be filterable by a message filtering extension?
I work on a macOS application that functions as a daemon. To test it, I:
Compile executables.
Use pkgbuild and productbuild to build an application bundle.
Use codesign and notarytool to sign and notarize the app.
Install the app with /usr/sbin/installer -target LocalSystem -pkg .... This often overwrites the previous version of the app.
Sometimes, the installation fails at the postinstall stage, when it can not find the application's install directory. We explicitly check for this error in our script:
if ! [ -d "$APP_INSTALL_DIR"/Contents ]; then
echo "directory ${APP_INSTALL_DIR}/Contents is missing"
exit 1
fi
This is unexpected!
Even worse, some of our customers have occasionally seen the same issue!
We use a postinstall script in order to install files into the /Library/LaunchDaemons and /Library/ LaunchAgents directories, and start the agent with launchctl bootstrap.
Our preinstall script makes sure that the previous version of our application is fully uninstalled (so there is no confusion), and we wonder if that is part of the problem.
While researching this error, I ran across a discussion of a similar issue on Stackoverflow: <https:// stackoverflow.com/questions/19283889>. One of the commenters there wrote:
It appears that the OS X installer uses information about already installed packages and application bundles in order to decide where and if to install new packages. As a result, sometimes my installer did not install any files whatsoever, and sometimes it just overwrote the .app bundle in my build tree. Not necessarily the one used to build the installer, but any .app bundle that OS X had found. In order to get the installer to install the files properly I had to do two things:
Tell OS X to forget about the installed package. sudo pkgutil --forget <package id> Not sure if this is needed for you nor in my case, but it is probably a good idea anyway.
Delete all existing .app bundles for the app. If I didn't do this, the existing app bundle was overwritten on install instead of the app being placed in /Applications. Maybe there is a way to prevent this while building the installer package, but I haven't found it.
On the other hand, the man page for pkgutil says not to use --forget from an installer:
Discard all receipt data about package-id, but do not touch the installed files. DO NOT use this command from an installer package script to fix broken package design.
What is the correct approach to fix this problem?
Topic:
App & System Services
SubTopic:
General
My iOS app get access to Calendars on iPhone and iPad (iOS 17) bey when running on Mac (designed for iPad) the app gets the ".notDetermined" authorizationStatus after a call to EKEventStore.authorizationStatus(for: .event).
What should I do so that my App gain access to Calendars ?
I have downloaded the ShinyTV example to test simplified sign-in on tvOS since it is not working in my own app, and I am having the same issue there.
After assigning my team to the sample app, the bundle ID updates with my team id. I copy the bundle ID into a file entitled "apple-app-site-association" with this format:
{
"webcredentials": {
"apps": [ "{MyTeamID}.com.example.apple-samplecode.ShinyTV{MyTeamID}" ]
}
}
I upload the file to my personal site, ensuring that the content type is application/json. I adjust the Associated Domain entitlement to:
webcredentials:*.{personal-site.com}?mode=developer
using the alternate mode to force it to load from my site, not the CDN.
When I run the build on tvOS, and click the Sign In button, it fails with these errors:
Failed to start session: Error Domain=com.apple.CompanionServices.CPSErrorDomain Code=205 "Failed to prepare authorization requests" UserInfo={NSMultipleUnderlyingErrorsKey=(
"Error Domain=com.apple.CompanionServices.CPSErrorDomain Code=205 \"Missing associated web credentials domains\" UserInfo={NSLocalizedDescription=Missing associated web credentials domains}"
), NSLocalizedDescription=Failed to prepare authorization requests}
Session failed: Error Domain=com.apple.CompanionServices.CPSErrorDomain Code=205 "Failed to prepare authorization requests" UserInfo={NSMultipleUnderlyingErrorsKey=(
"Error Domain=com.apple.CompanionServices.CPSErrorDomain Code=205 \"Missing associated web credentials domains\" UserInfo={NSLocalizedDescription=Missing associated web credentials domains}"
), NSLocalizedDescription=Failed to prepare authorization requests}
ASAuthorizationController credential request failed with error: Error Domain=com.apple.AuthenticationServices.AuthorizationError Code=1004 "(null)" UserInfo={NSMultipleUnderlyingErrorsKey=(
"Error Domain=com.apple.CompanionServices.CPSErrorDomain Code=205 \"(null)\""
)}
Failed with error: Error Domain=com.apple.AuthenticationServices.AuthorizationError Code=1004 "Failed to prepare authorization requests" UserInfo={NSMultipleUnderlyingErrorsKey=(
"Error Domain=com.apple.CompanionServices.CPSErrorDomain Code=205 \"Missing associated web credentials domains\" UserInfo={NSLocalizedDescription=Missing associated web credentials domains}"
), NSLocalizedDescription=Failed to prepare authorization requests}
What am I missing here?
app packged with Xcode16 crashed on iOS12 certainly. My question is:
is it known issue for Apple team?
to resolve this issue, what can we developers do?
This is
The contacts app has fields for Phonetic and Pronunciation. My app adds phonetic data to the phonetic field to help Siri better understand contacts stored in Greek, Cyrillic, or Georgian. However, using the phonetic field causes the sorting order of contacts to be messed up. For example, Greek B (beta) is represented as a phonetic sound of V, resulting in a completely incorrect sorting order.
The pronunciation field doesn’t seem to affect the sorting order, but I’m not sure what it does or should do.
My questions are:
Do we understand the difference between phonetic and pronunciation, and how Siri actively uses them?
If the phonetic field is the correct one to use, how can we raise a feature request with Apple to add an option to sort contacts based on phonetic fields or not?
Here’s a test you can try:
Create a new contact with the following details:
First name: test
Last name: test
Phonetic first name: Billy
Phonetic last name: Idol
Ask Siri to show the contact Billy Idol. It will return the “test test” contact.
Switch from the phonetic to the pronunciation fields. Now, Siri won’t find Billy Idol.
My app features two kinds of widgets, let's call them kind A and kind B.
I have both A and B widgets on my Home Screen. When I tap the button on widget A (associated with App Intent), I expect widget B to also reload.
However, if you call WidgetCenter.shared.reloadAllTimelines() inside the perform() method of the AppIntent, the timeline of widget B does not reload immediately. This issue only occurs on a physical device and is not consistently reproducible. On a simulator, however, widget B reloads as expected.
FB13152293
Hello.
Background: Most learning resources are for leaning Swift/Objective-C. I'm pretty sure I need something different. I'm already an experienced software engineer, just new to iOS/MacOS development. My problem is not learning the language, but rather how to learn modern best practices. I cannot find examples for what I'm looking for. So much seems to be sparse on implementation details, out of date, or both.
I'm trying to write an app that has a few distinct parts. The UI portion will be mostly a menu bar app, which I am not having a problem discovering resources for how to implement. The app will also have a daemon and utilize network extensions. This is where I am having trouble.
What's the current best practices on how to write and launch a daemon?
Should the daemon be its own library/package which is them imported into the main app? If so, which Xcode template do I use for this? Are there any Hello World! examples of this?
What is the best way for a UI app to communicate with a daemon?
Are there any Hello World! repositories on how to implement network extensions? Should this be done in the main UI app, or in a separate library/package?
TIA
Topic:
App & System Services
SubTopic:
General
Tags:
Network Extension
Service Management
Background Tasks
Hiya 👋! While loading some data, I'm having issues decoding arrays of basic types, specifically Int and Bool – they return nil. My app has existing data (live on the App Store for years) that is saved and loaded using NSKeyedArchiver. I'm updating to support a newer iOS version, which requires me now to adhere to NSSecureCoding. As I understand, NSSecureCoding needs strict type definitions, and it will return nil if things are ambiguous (for security reasons).
Essentially as I load data, it all works when I use strict types, like Int and Bool, because the methods themselves are strict: decodeInteger(forKey:) and decodeBool(forKey:). However, if I want to decode something more complex, like NSDate or basic type arrays (in my case [Int], [[[Int]]], [Bool] and [[Bool]]), I assume I have to decode an object: decodeObject(of:forKey:). While I was able to make NSDate work by forcing the type (decodeObject(of: NSDate.self, forKey: "modifyDate")! as Date), getting arrays to decode is proving difficult. They always return nil.
I've now tried forcing the type to different arrays, including NSArray, and listing array types. I also tried decodeArrayOfObjects(ofClass:forKey:), but no luck.
Example:
Here are some data items I might have:
var id: Int?
var isModified: Bool?
var modifyDate: Date?
var myIntegers: [Int]?
var myEmbedIntegers: [[[Int]]]?
var myBooleans: [Bool]?
var myEmbedBooleans: [[Bool]]?
Here's how I encode them:
encode(id!, forKey: "id")
encode(isModified!, forKey: "isModified")
encode(modifyDate!, forKey: "modifyDate")
encode(myIntegers!, forKey: "myIntegers")
encode(myEmbedIntegers!, forKey: "myEmbedIntegers")
encode(myBooleans!, forKey: "myBooleans")
encode(myEmbedBooleans!, forKey: "myEmbedBooleans")
This is how Int, Bool and Date are apparently successfully decoded (where Date is forced to search for NSDate type):
decodeInteger(forKey: "id")
decodeBool(forKey: "isModified")
decodeObject(of: NSDate.self, forKey: "modifyDate")! as Date
Here are attempts with Int (same with Bool) arrays, which are erroneously decoded (these all either get compiler errors or return nil):
decodeObject(forKey: "myIntegers") as! [Int] // This used to work before NSSecureCoding, but now returns nil.
decodeObject(of: [NSArray.self], forKey: "myIntegers") as! [Int] // Returns nil.
decodeObject(of: [Int.self], forKey: "myIntegers") // Compiler error about value type conversion.
decodeArrayOfObjects(ofClass: Int.self, forKey: "myIntegers") // Compiler error complaining that Int doesn't conform to NSSecureCoding.
decodeArrayOfObjects(ofClass: NSArray.self, forKey: "myIntegers") as! [Int] // Returns nil.
The funny thing is I don't even remotely need security. My data is for song compositions in an entertainment app, so it's strictly loaded and saved to device by my own code without networking, hashing or anything else being involved. Nevertheless I'm now stuck on this 😥.
How do I decode arrays (without returning nil)?
I'm using Live Activity features in my app, but I want to customize the user experience across different Apple devices. Specifically, I'd like to:
Keep Live Activity enabled and functioning on the iPhone Disable or prevent Live Activity from appearing on the connected Apple Watch
Is this level of device-specific control possible with Live Activity? If so, what's the best approach to implement this functionality? What I've tried:
I've looked through Apple's documentation on Live Activity, but couldn't find specific information about device-level control. I've experimented with ActivityKit, but haven't found a clear way to distinguish between iPhone and Apple Watch when pushing updates.
We are planning to use our internal IdP (PingFederate) for authentication of end users in their iOS apps using ASWebAuthenticationSession. Initial tests are successful, but the user is prompted for every login (and logouts) with a consent dialogue box:
“AppName” wants to use “internal domain-name” to Sign In
This allows the app and website to share information about you.
Cancel Continue”
Let’s say that our top-level domain is “company.no”, where our IdP is placed at “idp.company.com”. I have seen examples where the Associated domains entitlement points to the idp as a webserver for serving the JSON output AASA file. In this case that would be:
authsrv: idp.company.com
Anyone with experience implementing this structure with the IdP as webserver for serving the JSON output?
Our problem is that trying to use the IdP as webserver for this purpose is that it is very complicated to modify the IdP’s webserver configuration. Also, this modification needs to be re-done every time we need to upgrade the IdP.
My question is therefore also related to the options of which webserver to install the AASA file on. Has anyone installed the file on a generic webserver on the toplevel domain like
“webserver.company.com” ?
In my Catalyst app I use
func setupMailComposer() {
// Check if the device can send email
guard MFMailComposeViewController.canSendMail() else {
print("Mail services are not available")
showMailErrorAlert()
return
}
// Create and configure the mail composer
let mailComposeVC = MFMailComposeViewController()
mailComposeVC.mailComposeDelegate = self
// Set the email details
mailComposeVC.setToRecipients(["example@example.com"])
mailComposeVC.setSubject("Subject for your email")
mailComposeVC.setMessageBody("This is the body of the email.", isHTML: false)
// Attach a file (optional)
if let filePath = Bundle.main.path(forResource: "example", ofType: "pdf"),
let fileData = try? Data(contentsOf: URL(fileURLWithPath: filePath)) {
mailComposeVC.addAttachmentData(fileData, mimeType: "application/pdf", fileName: "example.pdf")
}
// Present the mail composer
self.present(mailComposeVC, animated: true, completion: nil)
}
Since I have updated to macOS 15.1 the canSendMail() function returns false although I have configured Apple Mail (like before in 15.0 where it worked flawlessly).