I would like to explore developing apps to integrate with Matter, but it seems that there are limited code examples available.
To start with I would like to create a MacOs or iOS application to control a Matter device like a light bulb. I would as an example just like to know how to turn the light on or off.
Where should I start?
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.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
User Initiated a Single Consumable Purchase but Was Charged Twice
A user initiated a single in-app purchase for a consumable item, but they were charged twice. Both transactions have the same purchase token.
Additional details: After the user successfully completed the in-app purchase, the completeTransactions callback was triggered again. This was called at app launch using SwiftyStoreKit.completeTransactions to finish any pending transactions.
Could this be causing the duplicate charge? Any insights would be appreciated.
The crash stack is as follows, and this crash only occurs on this model.
When using the old withTaskCancellationHandler(operation:onCancel:isolation:) to run background tasks, you were notified that the background task gets cancelled via the handler being called. SwiftUI provides the backgroundTask(_:action:) modifier which looks quite handy. However how can I check if the background task will be cancelled to avoid being terminated by the system?
I have tried to check that via Task.isCancelled but this always returns false no matter what.
Is this not possible when using the modifier in which case I should file a bug report?
Thanks for your help
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags:
SwiftUI
Background Tasks
WidgetKit
Our macOS app has one in-app purchase (IAP) implemented using StoreKit 1. It works for us and beta testers but App Review get SKErrorDomain Error Code 0 / ASDErrorDomain Code 500 / AMSErrorDomain 305 on first attempt to make the in-app purchase.
However, the purchase succeeds at second attempt. We've looked through our entire IAP related code and App Store Connect setup but can’t find the reason. It's a standard implementation:
LegacyPaymentQueueObserver for SKPaymentQueue observation.
AppDelegate for initiation of payment queue observation on app launch
LegacyStoreKitPurchasableProduct for initiating a purchase and listening for the result
LegacyStoreKitProductsRequester for how we load the product before user can make in-app purchase. It happens this way:
PreviewResultsViewModelcalls loadProducts()on an instance of StoreKitPurchaseManager, which asks an instance of LegacyStoreKitProductsRequesterto requestProducts(forIdentifiers:)
Any guidance to resolve this would be appreciated.
where can we find documentation on the following fields included in payloads? They're not listed alongside the other fields in the documentation linked below:
https://developer.apple.com/documentation/weatherkitrestapi/hourweatherconditions
precipitationIntensity
snowfallAmount
Or if we can get the data type, unit used, and description here that would be great
We have a PWA app developed by our company. In order to distribute this app to users' iPhones, we put this PWA app inside an XCode app. That means we put a WebView in XCode to display the PWA URL. Everything works perfect, except for location access.
The PWA app access the device location. When the first time the app acess location, it asks for user consent two times, by PWA app and by the XCode app. This is fine. When the user clicks Allow, the XCode app preserves the user choice and never asks again. However, the PWA app keeps on asking user permission every day. If we close the app open again, it will ask one more time. That means twice daily. But if we close and open the app for a third time, it will not ask. It remembers the user choice only for 24 hours.
If we install the PWA app directly in iPhone (that means if we add the URL as bookmark in home screen), it is asking for location permission only once. However, when we put this app inside an XCode app it is asking every day.
This affects the user experience, and as our users are not tech savvy, causing many issues. Is there a way to force the PWA app inside XCode app to remember the user choice?
Any help is very much appreciated.
Thanks,
I want to monitor again from the bellow function of DeviceActivityMonitorExtension. I have the function of startMonitoring like this.
override func eventDidReachThreshold(_ event: DeviceActivityEvent.Name, activity: DeviceActivityName) {
super.eventDidReachThreshold(event, activity: activity)
startMonitoring()
}
public func startMonitoring() {
let startTime = DateComponents(hour: 0, minute: 0, second: 0)
let endTime = DateComponents(hour: 23, minute: 59, second: 59)//DateComponents(hour: 11, minute: 0, second: 0)//
let schedule = DeviceActivitySchedule(
intervalStart: startTime,//DateComponents(hour: 0, minute: 0, second: 0),
intervalEnd: endTime,
repeats: true
//warningTime: DateComponents(minute:1)
)
let selection: FamilyActivitySelection = savedSelection() ?? FamilyActivitySelection()
let center = DeviceActivityCenter()
let selections = self.savedSelection() ?? FamilyActivitySelection()
let applications = selections.applicationTokens
let categories = selections.categoryTokens
let webCategories = selections.webDomainTokens
let store = ManagedSettingsStore()
store.shield.applicationCategories = ShieldSettings.ActivityCategoryPolicy.specific(categories, except: Set())
store.shield.applications = applications
store.shield.webDomains = webCategories
let scheduleHard = DeviceActivitySchedule(
intervalStart: startTime,//DateComponents(hour: 0, minute: 0, second: 0),
intervalEnd: endTime,
repeats: true
//warningTime: DateComponents(minute:1)
)
let event = DeviceActivityEvent(
applications: selection.applicationTokens,
categories: selection.categoryTokens,
webDomains: selection.webDomainTokens,
threshold: DateComponents(minute: 0)//timeLimitToUseApp i.e for 15 mins
)
do {
try center.startMonitoring( .weekend,
during: scheduleHard,
events: [
.weekend: event,
]
)
print("ScreenTime Monitoring Started")
} catch let error {
print(error.localizedDescription)
}
}
Please provide us with a solution about starting monitoring from DeviceActivityMonitoringExtension's eventDidReachThreshold function or if there is any other way.
I've searched all the App Intent and AssistantSchemas related documentation and I can't find anything related to workout, do I still need to use SiriKit?
users download app with Streamlined Purchasing ,but the logic of checking subscription doesn't work. there the code:
func checkSubscriptionStatus() async {
for await entitlement in Transaction.currentEntitlements {
guard case .verified(let transaction) = entitlement else { continue }
if transaction.productID == monthlyProductID || transaction.productID == yearlyProductID {
if transaction.revocationDate == nil && !transaction.isUpgraded {
let activeSubscribed = transaction.expirationDate ?? .distantFuture > .now
if activeSubscribed {
hasActiveSubscription = activeSubscribed
// other operation
}
}
}
}
}
I am creating an iOS app that needs to parse the text from a PDF document. I can read the entire PDF document's text using the string property, but if it's a large PDF document, this could cause delays for users.
From the documentation, I came across the beginFindString function, which seems to asynchronously, with no return?
https://developer.apple.com/documentation/pdfkit/pdfdocument/beginfindstring(_:withoptions:))
Unfortunately I cannot find examples on how to use this function or its intended purpose/functionality, so any guidance would be appreciated.
My goal is to read the PDF document one line at a time, searching for newlines ('\n'), then parsing that line as needed. I'm hoping the beginFindString function will be useful.
Hi, I want to offer an auto-renewable subscription (e.g., $1/month) that grants users (10 document analyses per month), with the count resetting at the start of each billing cycle.
-Unused analyses will not roll over to the next month-
Additionally, any analyses generated while the subscription is active will remain accessible to the user permanently, even if they cancel the subscription.
The paywall, app description, and metadata will clearly state that the subscription grants (10 document analyses per month with no rollover)
We want this to be implemented as an auto-renewable subscription model, not as a consumable service or a token/credit system (which we want to avoid).
Is this model acceptable under Apple’s guidelines, or would it be considered a token/credit system? Any insights or alternative suggestions would be appreciated.. Thanks
We developing an app, It's a Parental control app required to block large number of apps. In child mobile installed more than 200 apps parent has to block and disable these apps but parent cant able to block more than 50 apps. Is there any option is there to block all the 200 apps from child mobile.
Hello everyone,
I’m currently developing an app that uses the Family Controls API, specifically the Screen Time API. However, my current entitlement is limited to development mode, which prevents me from publishing my app on TestFlight.
I have already contacted Apple Developer Support for production access but wanted to reach out to the community as well and I was referenced to FamilyControls API documentation and I couldn't find anything related to my case. Has anyone successfully upgraded their entitlement from development-only to production? Any insights on the process, tips for communicating with Developer Support, or guidance on ensuring full compliance with the Family Controls guidelines would be extremely helpful.
I'm trying to implement live caller id PIR server in python and I have an issue related to evaluation key config. I don't receive the POST /key request even if I try to install the extension on new device and I had this error in device system logs:
error 11:21:30.663022+0200 ciphermld requestData(byKeywords:shardIds:clientConfig:) threw an error: CipherML.CipherMLError.missingSecre t Ke y
I think the reason why the evaluation key is not generated is related to this error but I'm not sure. It might be also related to HE params - I tried with the same params as in swift server example with plaintext_modulus=17 and it works, but for plaintext_modulus=65537 on the same device the system doesn't send me the evaluation key. Is there a limitation that restricts the evaluation key generation for some HE params?
There is how the entire config object that I retrieve looks like:
{
"configs": {
"Live-C aller-ID-Lookup. TestLiveCallerI D.iden tity": {
"pir_config": {
"encry ption_p aram eters": {
"pol ynomial_deg ree": "4096",
"plaint ext_mo dulus": "65537",
"coeff icient_m oduli": [
"134176769",
"268369921",
"268361729"
],
"secu rity_le vel": "SECU RITY LEVEL QUANT UM128",
"h e_sc heme": "H E_SC HEM E_B F V"
},
"shard_configs": [
{
"num_entries": "2",
"entry_size": "55991",
"dimensions": [
"2",
"1"
],
"shard_id": ""
}
],
"keyword_pir_params": {
"num_hash_functions": "2",
"sharding_function": {
"sha256": {}
}
},
"algorithm": "PIR _ALGO RITHM _MUL_PIR",
"batch_size": "2",
"evalu ation_ke config_hash": ""
},
"config_id": ""
}
},
"key_info": [
{
"timestamp": "1738660849",
"key_config": {
"encryp tion_par ameters": {
"polynomial_degree": "4096",
"plaintex t_mo dulus": "65537",
"coeffic ient_m oduli": [
"134176769",
"268369921",
"268361729"
],
"secu rity_level": "SECUR ITY_LEVEL_QU ANTUM128",
"he_sc heme": "HE_SC HEME_BFV"
},
"gal ois_e lements": [
20 49,
40 97
],
"has _rel in_key": true
}
}
]
}
PS evaluation key data is just a placeholder, but anyway it should be skipped cause of expired timestamp
More logs:
```language
default 11:21:30.535865+0200 ciphermld Running rotation task for ["Live-Caller-ID-Lookup.TestLiveCallerID.identity"]
info 11:21:30.535953+0200 ciphermld Skipping groups that manage their own networking: <private>
default 11:21:30.537007+0200 ciphermld Request to fetchConfigs has started for useCases '["Li ve-Caller-ID-Lookup.TestLiveCallerID.identity"]', userId: '<private>', existingConfigIds: '["id"]'
default 11:21:30.542174+0200 ciphermld Request to queries-batch has started for userId: '<private>', length: 28350
default 11:21:30.655914+0200 ciphermld Request to fetchConfigs has finished, response length: 230
default 11:21:30.656182+0200 ciphermld Received configurations: 1 usecase(s), 1 key(s) for group 'Live-Caller-ID-Lookup.TestLiveCallerID.identity'
debug 11:21:30.660868+0200 ciphermld Skipping non-active key: timestamp: 1738660849
key_config {
encryption_parameters {
polynomial_degree: 4096
plaintext_modulus: 65537
coefficient_moduli: [134176769, 268369921, 268361729]
security_level: Quantum128
he_scheme: BFV
}
galois_elements: [2049, 4097]
has_relin_key: true
}
error 11:21:30.662982+0200 ciphermld No key for use-case 'Live-Caller-ID-Lookup.TestLiveCallerID.identity'
error 11:21:30.663022+0200 ciphermld requestData(byKeywords:shardIds:clientConfig:) threw an error: CipherML.CipherMLError.missingSecre t Ke y
default 11:21:30.663824+0200 com.apple.CallKit.CallDirectory <private> XPC request complete, results(0) error:Error Domain=CipherML.CipherMLError Code=32 "missing secre t ke y" UserInfo={NSLocalizedDescription=missing secre t ke y}
default 11:21:30.972372+0200 ciphermld Request to queries-batch has finished response, length: 0
default 11:21:30.974711+0200 com.apple.CallKit.CallDirectory <private> XPC request complete, results(1) error:(null)
default 11:21:36.161964+0200 com.apple.CallKit.CallDirectory <private> Sending XPC request
default 11:21:36.163149+0200 com.apple.CallKit.CallDirectory <private> Sending XPC request
default 11:21:36.169931+0200 ciphermld requestData(byKeywords:shardIds:clientConfig:) method was called
default 11:21:36.170448+0200 ciphermld requestData(byKeywords:shardIds:clientConfig:) method was called
default 11:21:36.174001+0200 ciphermld Cached: 0 / Missing: 1
error 11:21:36.174997+0200 ciphermld No userId or secre t Ke y for use-case '.Lve-Caller-ID-Lookup.TestLiveCallerID.identity'. Running rotation task'
default 11:21:36.175075+0200 ciphermld Running rotation task for ["Live-Caller-ID-Lookup.TestLiveCallerID.identity"]
info 11:21:36.175240+0200 ciphermld Skipping groups that manage their own networking: <private>
default 11:21:36.177700+0200 ciphermld Request to fetchConfigs has started for useCases '["Live-Caller-ID-Lookup.TestLiveCallerID.identity"]', userId: '<private>', existingConfigIds: '["id"]'
default 11:21:36.179914+0200 ciphermld Request to queries-batch has started for userId: '<private>', length: 28350
default 11:21:36.336051+0200 ciphermld Request to fetchConfigs has finished, response length: 230
default 11:21:36.336308+0200 ciphermld Received configurations: 1 usecase(s), 1 key(s) for group 'Live-Caller-ID-Lookup.TestLiveCallerID.identity'
debug 11:21:36.341522+0200 ciphermld Skipping non-active key: timestamp: 1738660849
key_config {
encryption_parameters {
polynomial_degree: 4096
plaintext_modulus: 65537
coefficient_moduli: [134176769, 268369921, 268361729]
security_level: Quantum128
he_scheme: BFV
}
galois_elements: [2049, 4097]
has_relin_key: true
}
error 11:21:36.356497+0200 ciphermld No key for use-case 'Live-Caller-ID-Lookup.TestLiveCallerID.identity'
error 11:21:36.356669+0200 ciphermld requestData(byKeywords:shardIds:clientConfig:) threw an error: CipherML.CipherMLError.missingSecre t Ke y
default 11:21:36.357075+0200 com.apple.CallKit.CallDirectory <private> XPC request complete, results(0) error:Error Domain=CipherML.CipherMLError Code=32 "missing secre t ke y" UserInfo={NSLocalizedDescription=missing secre t ke y}
default 11:21:36.625701+0200 ciphermld Request to queries-batch has finished response, length: 0
default 11:21:36.626749+0200 com.apple.CallKit.CallDirectory
The example database/server provided by Apple for Live Caller ID contains a hardcoded database with a tiny number of pre-defined numbers.
However, its not expected to be representational of an live real world usage server.
But the question is how can that be accomplished if its a requirement that the data be KPIR encrypted?
In real world scenarios, the factors that effect whether a number should be blocked or not are continually changing and evolving on a minute-by-minute basis and new information becomes available or existing information changes.
If the database supports tens of millions or hundreds of millions of constantly changing phone numbers, in order to meet the requirements of the Live Caller ID being KPIR encrypted, that would imply the database has to re-encrypt its database of millions endlessly for all time.
That seems unfeasable and impractical to implement.
Therefore how do the Apple designers of this feature envisage/suggest a real-world server supporting millions of changing data should meet the requirement to be KPIR encrypted?
I am implementing apple pay and the merchant validation is failing with error (error request failed with status code 417). I am using react js in the frontend and node js in backend, this is my code
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
cert: fs.readFileSync(
path.join(__dirname, "../../../certificates/merchant_id_prod.pem")
),
key: fs.readFileSync(
path.join(__dirname, "../../../certificates/merchant_id_prod.key")
),
});
const data = {
merchantIdentifier: "merchantId",
displayName: "Check",
initiative: "web",
initiativeContext: "domain.com",
};
const response = await axios.post(validationURL, data, { httpsAgent });
Hello,
We have a Push-to-Talk (PTT) application that is already well established and widely used. Our app has the proper VoIP entitlement, which we are using to wake up the app and establish a WebSocket connection for real-time communication. We are also using CallKit as a supporting mechanism, but not as the primary interaction upon receiving the VoIP Push, since our use case differs from traditional full-duplex VoIP calls.
While our implementation works correctly in many cases, we have noticed a consistent issue where, after multiple VoIP Push notifications, the system still delivers the push, but prevents the WebSocket from reconnecting.
At this point, all connection attempts return errors such as:
• "Software caused connection abort"
This issue persists until the app is manually relaunched, after which the behavior resets and repeats.
We are aware that VoIP Push was originally designed for full-duplex calls, but since Apple allows its use for other purposes through the entitlement, we would like to understand why this limitation is occurring and how to handle it properly.
Questions:
1. Is iOS enforcing stricter background execution rules after multiple VoIP Push events within a short period?
2. Are there any recommended best practices to ensure reliable WebSocket reconnection in this scenario?
My MacOS swift app [myStuckApp5] refuses to close when running on Monterrey (The app becomes unresponsive after finishing its work, and needs to be forcefully closed). However, it closes as expected when running MacOS 13 and above. How can I troubleshoot this error?
I'm attaching the content of the sys Log related to the app while it was stuck (too long to copy here...)
This is the content of the related sys Log
Topic:
App & System Services
SubTopic:
Core OS
Tags:
Developer Tools
macOS
Custom Apps
Xcode Sanitizers and Runtime Issues
Hello,
We are experiencing slow launch time indicators in our performance monitoring tools(Crashlytics/DataDog/Xcode), and trying to understand what is the best approach to reduce it.
Currently, cold launch takes ~900ms on iPhone 16 Pro , but
~2s on iPhone 11. Profiling app launch detected that most of the time
is spend on loading the libraries. Our app is massive, we use a
total of ~40 3rd parties libraries + 10 internal libraries. We enabled
the "mergeable libraries" XCode new feature however the app
launch is as written above.
We also postponed some of the work in didFinishLaunch, which help a bit...
But maybe we are trying to achieve the impossible?
Could it be that large apps just can't reach the golden 500ms goal?
Currently we are trying to create an "umbrella" library for
all the third parties in order to force them to become part of the
mergeable libraries. We would like to know if, are we on the right
track?