I'm sending local push notifications and want to show specific content based on the id of any notification the user opens. I'm able to do this with no issues when the app is already running in the background using the code below.
final class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate {
let container = AppContainer()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
let center = UNUserNotificationCenter.current()
center.delegate = self
return true
}
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: () -> Void) {
container.notifications.handleResponse(response)
completionHandler()
}
}
However, the delegate never fires if the app was terminated before the user taps the notification. I'm looking for a way to fix this without switching my app lifecycle to UIKit.
This is a SwiftUI lifecycle app using UIApplicationDelegateAdaptor.
@main
struct MyApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
I’m aware notification responses may be delivered via launchOptions on cold start, but I’m unsure how to bridge that cleanly into a SwiftUI lifecycle app without reverting to UIKit.
Overview
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello it’s my first time to signup on apple developers account .I followed all the necessary instructions an email was sent to my mail box that payment deductions will be done in the next 48hrs since that was on Friday 8 days down the line no deductions have been made kindly advise me on the right actions to take...email..mgariservices@gmail.com
SKStorefront.countryCode always returns "US" in TestFlight and sandbox,
even when sandbox Apple ID is set to a different country.
Is this expected behavior?
Is SKStorefront guaranteed to return the correct storefront
only for production App Store builds?
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
StoreKit Test
StoreKit
In-App Purchase
TestFlight
Hello everyone, I achieved my MacOs app and distributed for "App Store Connect" and I already have setup the Product In App Purchase in the App Store connect, and I even tested the purchase flow using the local .storekit file using the "Edit Schema". And now, when I remove the edit scema's storekit file and archieved the app and used the Internal testing and installed the app using Testflight, I see that the product is not showing, an empty product array is being returned and there is no option to purchase.
I don't want to sumit the full app until I test the StoreKit integration in real test
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
StoreKit
App Store Connect
In-App Purchase
TestFlight
I'm using StoreKit 2 with Product.products(for:) to fetch my auto-renewable subscriptions. It works in the Xcode simulator with a local StoreKit configuration file, but returns an empty array (no error) in TestFlight.
iOS 15+, using async/await API
Products are configured in App Store Connect
Paid Apps agreement is active
Sandbox tester account set up
Has anyone experienced this? What am I missing?
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
StoreKit Test
StoreKit
TestFlight
I don't understand why elevation data is not stored in the sample using a standard length unit. Why is it stored in HKQuantityTypeIdentifier.flightsClimbed (which is 10 feet)?
Surely it is not a memory usage issue.
Treadmill GATT provides elevation in meters.
Using HKMetadataKeyElevationAscended for the total elevation gain throws away a lot of data.
Why is there no support for weighted vest or backpack? Changing body weight is not the same and provides incorrect energy. Users want to compare workouts with different weights. I don't see any metadata key for carried weight.
Topic:
App & System Services
SubTopic:
Health & Fitness
Hey everyone, I really need help. My app versions keep getting approved for distribution and my subscriptions and business agreements are all approved. Yet, when the paywall in my app appears, and someone clicks the subscribe button to pay, the IAP isn't appearing. It just loads forever. When I tested in Xcode it just kept saying products not found. Id's are the same, bundle id is the same, ive done everything. Can someone help pls.
After adding furhter IAP Items to my app, none of the products are available for purchase an more on iOS. But it works just fine on the Mac Catalyst app.
Logging the request shows that all product IAP IDs are "invalid", even those who already were on sale.
Any idea what this can be caused by?
Ive already double checked the obvious things like the product IDs on appstoreconnect, bundle ID, tested on different devices, Test Flight etc...
Has anyone experienced this already?
I'm experiencing a contradictory validation issue with DeviceActivityReportExtension that creates an impossible situation:
The Problem:
Without NSExtensionPrincipalClass in Info.plist → App Store Connect rejects upload with: "Missing Info.plist values. No values for NSExtensionMainStoryboard or NSExtensionPrincipalClass found"
With NSExtensionPrincipalClass → Local install fails with: "defines either an NSExtensionMainStoryboard or NSExtensionPrincipalClass key, which is not allowed for the extension point com.apple.deviceactivityui.report-extension"
Setup:
Extension point: com.apple.deviceactivityui.report-extension
Using SwiftUI with @main attribute and DeviceActivityReportExtension protocol
Xcode 16.2, iOS 17.6 deployment target
Code structure:
@main
struct SpoolReport: DeviceActivityReportExtension {
var body: some DeviceActivityReportScene {
// Report scenes here
}
}
The extension builds and runs perfectly without NSExtensionPrincipalClass, but cannot be uploaded to App Store Connect. Adding the key allows upload but breaks local installation.
Is this a known issue? Is there a workaround or correct Info.plist configuration for DeviceActivityReportExtension?
Thank you!
Hello!
I'm making a list of app icons for users to choose, but when I increase or decrease the font size, the image is still in the same spot and isn't centered vertically with the text. I have it initialized with a frame with hard-coded values, but I was wondering if there was a better way of doing it, such as with constraints or some sort of image scaling.
I've provided code blocks and an image of what is happening.
ImageView Configuration
// App Icon Image
UIImageView *appIconImageView = [[UIImageView alloc] initWithFrame: CGRectMake(12.5, 17, 22.5, 22.5)];
// Configurations
UIImageSymbolConfiguration *multicolorConfiguration = [UIImageSymbolConfiguration configurationPreferringMulticolor];
UIImageSymbolConfiguration *sizeConfiguration = [UIImageSymbolConfiguration configurationWithScale: UIImageSymbolScaleSmall];
UIImageSymbolConfiguration *appIconConfiguration = [multicolorConfiguration configurationByApplyingConfiguration: sizeConfiguration];
appIconImageView.preferredSymbolConfiguration = appIconConfiguration;
appIconImageView.contentMode = UIViewContentModeScaleAspectFill;
self.appIconImage = appIconImageView;
[appIconImageView release];
ImageView Constraints
[self.appIconImage.firstBaselineAnchor constraintEqualToAnchor: self.contentView.firstBaselineAnchor constant: 5.0],
[self.appIconImage.leadingAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.leadingAnchor],
// Label
[self.colorLabel.leadingAnchor constraintEqualToAnchor:self.appIconImage.trailingAnchor constant: 10],
[self.colorLabel.trailingAnchor constraintEqualToAnchor:self.contentView.layoutMarginsGuide.trailingAnchor],
[self.colorLabel.topAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.topAnchor],
[self.colorLabel.bottomAnchor constraintEqualToAnchor: self.contentView.layoutMarginsGuide.bottomAnchor],
Image
Hello everyone,
I am developing an iOS application that relies on accelerometer data for precise motion and reaction-time measurements.
Based on practical testing, it appears that third-party iOS applications receive accelerometer data at a maximum rate of approximately 100 Hz, regardless of hardware capabilities or requested update intervals.
I would like to ask for clarification on the following points:
Is there an officially supported way for third-party iOS apps to access accelerometer data at sampling rates higher than ~100 Hz?
If the hardware supports higher sampling rates, is this limitation intentionally enforced at the iOS level for third-party applications?
Are there any public APIs, entitlements, or documented approaches that allow access to higher-frequency sensor data, or is this restricted to system/internal components only?
Thank you in advance for any clarification.
Topic:
App & System Services
SubTopic:
Hardware
Hi,
I am building a new app in the App Store - the app is not live yet.
I have setup an annual subscription product in AppStore Connect. Our problem is that we are unable to retrieve the product from our app - we've made sure that there are no missing metadata (e.g. price, availability).
Has anyone encountered before? Appreciate any help provided.
Thanks
Hi, Submitted Family Controls entitlement requests yesterday for a
digital wellness app (main app + 3 extensions).
For those who've been through this:
How long did approval take?
Did Apple ask for more info?
Any tips?
Thanks!
Hello,
Our app is approved for the Advanced Commerce API and we are currently testing in the Sandbox environment only.
We have created generic product identifiers and have already submitted them via the Advanced Commerce API Access form.
However, the generic product status in App Store Connect is still “Ready to Submit.”
For Sandbox testing, is this status expected, or do we need to submit an app build or the generic product for review before Advanced Commerce works correctly?
Thank you.
Topic:
App & System Services
SubTopic:
StoreKit
Tags:
Subscriptions
In-App Purchase
Advanced Commerce API
Hello!
I have a web extension I've written to Google Chrome and Mozilla Firefox. It's made up of simple files.
The extension (content.js)
A manifest (manifest.json) file which explains the extension
The icon (icon.png)
Apple has developed App Store Connect / Xcode Cloud specifically for this.
I upload those three files as a zip. I move it over to TestFlight for testing and then select Distribution to put it through Apple Review.
This is my entire process.
I have been doing this for 4+ months and Apple reviewed my application and put it up. I have then gone through 13 subsequent reviews (ALL POSITIVE) and have gone through version upgrades for months, no issue.
On the 15th review, they want me to change the name of my application.
I have done that in the content.js, the manifest.json, and anywhere that allows me to change it in App Store Connect.
There is apparently one more place they want it changed. This is on the App Information / General Information tab, specifically the "BundleID". The tip on that field says:
The bundle ID must match the one you used in Xcode. It can't be changed after you upload your first build.
Or, I am not understanding what their issue is or what else I can change. I was told by Review team I must use XCODE to change this.
I tell them I don't use XCode (they demand now I use Xcode, which seems completely irrelevant here and a red herring
The tooltip itself says I can't change it anyway?
Has anyone been told after they released their application they have to change their name later on in life?
I have a project, and I prepared an app icon. But I don't know where to drag the .icon, please help me out!
I am a developer, and I first launched the tvOS app. Users purchased it from the Apple Store and can use the tvOS app. Then, I uploaded the iOS app again, but some users (those who did not use the promotional code) were unable to download it due to the "purchased" status displayed on the Apple Store. How can I solve this problem? At present, it has been tested to restart, exit with ID, and log in again.
Another question to ask, does a promotion code correspond to a platform? Can't it be universally used across all platforms, right?
Topic:
App Store Distribution & Marketing
SubTopic:
General
I’m having an issue installing my TestFlight build on a Mac. The build (v1.0 build 1) uploads successfully and shows as “Complete” in App Store Connect. I can also open the build details page, and my Apple ID / tester access / group setup looks correct.
However, on TestFlight (macOS), when I tap Install/Load, I get this error:
Unable to install. The requested app isn’t available or can’t be found.
Notes:
The app is an iOS app (iPhone + iPad), and I enabled availability for Mac (Designed for iPad) in App Store Connect. The Mac is Apple Silicon, running macOS Tahoe 26.1.
Could you help me understand why TestFlight shows this message on Mac, and what I should change in Xcode/App Store Connect to make the build compatible?
"In iTunes IAP space"
Give a monthly subscription with 7 days freeTrail, what would be sequence of iTunes V2 notification for the following behaviour?
When an end user purchases a subscription that includes a free trial.
When the user transitions from the free‑trial period to the paid subscription period.
Hey everyone I just ran into an issue where I couldn't sync the model below fully by using CloudKit,
enum LinkMapV3_1: VersionedSchema {
static let versionIdentifier: Schema.Version = .init(3, 1, 0)
static var models: [any PersistentModel.Type] {
[AnnotationData.self, GroupData.self, Item.self, Deployment.self, History.self]
}
// MARK: - Data
@Model
class AnnotationData {
var name: String = ""
var longitude: Double = 0.0
var latitude: Double = 0.0
var order: Int = -1
var level: Int = 1
var detail: String = ""
@Relationship(deleteRule: .nullify, inverse: \GroupData.annotation)
var groups: [GroupData]?
@Relationship(deleteRule: .nullify, inverse: \AnnotationData.to)
var from: AnnotationData?
var to: AnnotationData?
var history: History?
}
// MARK: - History
@Model
class History {
var id: UUID = UUID()
var timestamp: Date = Date()
@Relationship(deleteRule: .nullify, inverse: \AnnotationData.history)
var annotations: [AnnotationData]?
@Relationship(deleteRule: .nullify, inverse: \GroupData.history)
var groups: [GroupData]?
@Relationship(deleteRule: .nullify, inverse: \Item.history)
var items: [Item]?
@Relationship(deleteRule: .nullify, inverse: \Deployment.history)
var deployment: Deployment?
var formattedDate: String {
let formatter = DateFormatter()
formatter.dateStyle = .medium
formatter.timeStyle = .short
return formatter.string(from: timestamp)
}
var timeAgo: String {
let formatter = RelativeDateTimeFormatter()
formatter.unitsStyle = .abbreviated
return formatter.localizedString(for: timestamp, relativeTo: Date())
}
}
}
So when trying to sync with the code in documentation
let modelContainer: ModelContainer
init() {
let config = ModelConfiguration()
typealias vs = LinkMapV3_1
do {
#if DEBUG
// Use an autorelease pool to make sure Swift deallocates the persistent
// container before setting up the SwiftData stack.
try autoreleasepool {
let desc = NSPersistentStoreDescription(url: config.url)
let opts = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.name.Endsunset.LinkMap.SwiftData.v1")
desc.cloudKitContainerOptions = opts
// Load the store synchronously so it completes before initializing the
// CloudKit schema.
desc.shouldAddStoreAsynchronously = false
if let mom = NSManagedObjectModel.makeManagedObjectModel(for: [vs.AnnotationData.self, vs.GroupData.self, vs.Item.self, vs.Deployment.self, vs.History.self]) {
let container = NSPersistentCloudKitContainer(name: "LinkMap", managedObjectModel: mom)
container.persistentStoreDescriptions = [desc]
container.loadPersistentStores {_, err in
if let err {
fatalError(err.localizedDescription)
}
}
// Initialize the CloudKit schema after the store finishes loading.
try container.initializeCloudKitSchema()
// Remove and unload the store from the persistent container.
if let store = container.persistentStoreCoordinator.persistentStores.first {
try container.persistentStoreCoordinator.remove(store)
}
}
}
#endif
modelContainer = try ModelContainer(for:
vs.AnnotationData.self,
vs.GroupData.self,
vs.Item.self,
vs.Deployment.self,
vs.History.self,
configurations: config)
} catch {
fatalError(error.localizedDescription)
}
}
The output is
Console Output
Where you can see
Output Extract
Optional arrays with @Relationship are missing, and the entry of record types on cloudkit database container are also missing it.
When I attempt to insert an annotation, I got
SwiftData/PersistentModel.swift:559: Fatal error: This KeyPath does not appear to relate AnnotationData to anything - \AnnotationData.groups
It gets more suspicious when restart the app and try again, the above error end with "AnnotationData.history", and if I tried again the above error end with "AnnotationData.from"... and so on.
No matter how my app stop working.