Posts under App & System Services topic

Post

Replies

Boosts

Views

Activity

Product.SubscriptionInfo.status(for:) is sometimes empty even though a subscription has been registered
My app calls Product.SubscriptionInfo.status(for:) to get the subscription status when the app starts. Users with multiple Apple IDs have reported that every few days they get an unpurchased status, and when I checked that, the Product.SubscriptionInfo.status(for:) result array was empty. (When the app is restarted, Product.SubscriptionInfo.status(for:) gives the correct result.) StoreKit.Transaction.currentEntitlements, which is executed immediately after Product.SubscriptionInfo.status(for:), seems to be getting the correct result, so I am trying to check the subscription status with this result. Is it a bug that Product.SubscriptionInfo.status(for:) returns an empty result for the purchaser? There is a mismatch between Product.SubscriptionInfo.status(for:) and StoreKit.Transaction.currentEntitlements. Is it possible for a mismatch to occur?  And In such a case, which result should be adopted?
1
0
925
Oct ’24
Local Network Privacy FAQ-2
This post is part of the Local Network Privacy FAQ. What operations require local network access? The general rule is that outgoing traffic to a local network address requires that the user grant your app local network access. Common scenarios include: Making an outgoing TCP connection — yes Listening for and accepting incoming TCP connections — no Sending a UDP unicast — yes Sending a UDP multicast — yes Sending a UDP broadcast — yes Connecting a UDP socket — yes Receiving an incoming UDP unicast — no Receiving an incoming UDP multicast — yes Receiving an incoming UDP broadcast — yes These TCP and UDP checks are done at the lowest levels of the system and thus apply to all networking APIs. This includes Network framework, BSD Sockets, NSStream, and NSURLSession, and any other protocols that you layer on top of those. IMPORTANT Receiving an incoming UDP multicast or broadcast does not currently require local network access but, because we hope to change that in a future update, our advice right now is that you write your code as if did (r. 69792887, 70017649). Resolving link-local DNS names (those ending with local, per RFC 6762) requires local network access. Again, this check applies to a wide variety of APIs including <dns_sd.h>, <net_db.h>, Network framework, NSStream, and NSURLSession. Finally, all Bonjour operations require local network access: Registering a service with Bonjour — yes Browsing for Bonjour services — yes Resolving a Bonjour service — yes Again, these checks apply to all APIs that use Bonjour, including <dns_sd.h>, Network framework, NSNetService, and Multipeer Connectivity. Note You must declare the Bonjour service types you use in your Info.plist. See FAQ-14 How do I map my Multipeer Connectivity service type to an entry in the Bonjour services property? for details. Bonjour-based services where you don’t see any details of the network do not require local network access. These include: AirPlay — no Printing via UIKit — no Back to the FAQ
0
0
7.9k
Oct ’24
Battery Displays for Custom Hardware
I am having difficulty figuring out two indicators for a custom piece of battery hardware. Firstly, on the home screen, scrolling all the way to the left in the widget screen, you can see the battery for connected wireless devices, electronic pencils, etc. Additionally, when you use Apple battery packs, you can see the battery for it on the top right of your phone I am wondering where I should look to see how I could integrate both of these. I have searched the documentation for a while, and I am having a hard time knowing where to start. If anyone can point me to something, it would be very appreciated. Thank you!
0
0
518
Oct ’24
Need Help! ANCS Client
Hi I am looking for examples where a BLE Device (ESP32 or Arduino) can be a BLE Client and subscribe to iPhone ANCS Services. Unfortunately my code is UNABLE TO FIND my iPhone device even after scanning for nearby BLE Devices. ANCS Documentation (Not helpful): https://developer.apple.com/library/archive/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Specification/Specification.html I am able to create a BLE Device as a server but I am looking to subscribe to incoming call notifications. PLEASE HELP if you have done this before. Thanks
2
0
444
Sep ’24
Set a repeating notification that starts at a future date
I would like to do exactly this but the API doens't seem to allow it. Was wondering if there were any creative workarounds? Basically, I have a reminder app that needs to send reminders at a certain time each day (there are several of these reminders per day). Each reminder has a couple of follow-ups scheduled at 5 min intervals. If a user takes action on the task before the reminder is sent however, I would like to unschedule that notification (and follow ups) until the next day. The unscheduling part is easy, but there seems to be no reliable way to re-schedule it for the next day and continue repeating. Looked into background tasks and they don't seem intended for these purposes nor do they seem reliable. The user isn't guaranteed to take action on notifications nor open the app within a 24-hour period after they have taken action on their task.
1
0
359
Oct ’24
Inquiry Regarding Data Migration Using Quick Start
I am currently developing an iOS app with a new feature that utilizes Quick Start for data migration between devices. We are testing this in a test environment using an app distributed via TestFlight. However, we are encountering an issue where the app installed on the pre-migration device (distributed via TestFlight) does not transfer to the post-migration device. Could this issue be related to the fact that the app was distributed via TestFlight? Is there any restriction where only apps released via the App Store can be migrated using Quick Start? We would appreciate it if you could provide some insights into the cause of this issue and any alternative testing methods.
1
0
562
Oct ’24
Battery issue on replaced phone
I recently bought a new iPhone SE and transferred all of my data. I want to keep the old iPhone and have removed most of the Apps. However when I charge it fully at night, the battery is almost dead the following morning. This was not the case before I bought the new phone. When I check the battery app, it doesn't indicate any use that would explain why the battery is almost exhausted.
1
0
448
Oct ’24
ClassKit App Freezing Issue
Hello Apple Developer Team, I hope you’re doing well. I’m writing to report an issue with the Schoolwork app and ClassKit integration. We’ve implemented the ClassKit framework according to the documentation, and while it works fine when the app is terminated, we encounter a problem when the app is in the background. When accessing a student’s profile in the Schoolwork app and clicking the START and CONTINUE buttons, the Sample ClassKit app opens via the deep link. However, the app freezes after about 3 seconds and remains unresponsive until we receive the Student Progress Alert, which takes approximately 15 seconds. We’re only experiencing this issue and would greatly appreciate your technical support to resolve it. Thank you for your assistance, and I look forward to your response. Steps to Reproduce the Issue: Open the Sample ClassKit app. Open the Settings app. Navigate to Developer and select ClassKit API. Choose Teacher. Open the Schoolwork app. Click on Create New Assignment. A popover view titled New Assignment will appear. Click the Add Activities button (blue background) and search for the app named Sample ClassKit. Ensure the necessary symbol for Student Progress is checked. If not available, terminate all apps and reopen the Sample ClassKit project, then repeat step 1. Click on the app. Find and select the exercise titled Explore In 3D. Click the + icon and then the Done button in the top right corner. Enter the title and assign it as needed. Return to the Settings app: Navigate to Developer and select ClassKit API. Choose Student. Open the Schoolwork app: Click on the student assignment. Click either the Start or Continue button. The Sample ClassKit project will open. Click on Gallery 3 to 4 times. You will notice that the Student Progress Alert does not appear, and the app freezes if the Sample ClassKit project is coming from background to active mode. Note: The issue does not occur if the Sample ClassKit app is terminated before clicking Start or Continue; in that case, the alert appears immediately.
2
0
405
Sep ’24
SensorKit Visit Data Inconsistencies Across Devices
Hello, I am currently developing an application using SensorKit to retrieve visit data. While the data retrieval works smoothly on one iPhone (iPhone 14, iOS 18.0.1), it fails on other devices, including: iPhone 15 Pro Max with iOS 18.1 Beta Another iPhone 14 with iOS 18.0 I’ve verified that the entitlements are configured properly, and the app has the necessary SensorKit visit permissions across all devices. Despite these steps, only one of the phones is able to retrieve the visit data correctly. Is there any minimum hardware requirement or compatibility issue with certain models or configurations that I should be aware of for using SensorKit visits? Any guidance or insight would be greatly appreciated! Thank you.
0
0
383
Oct ’24
Apple Cash not setting up since IOS 18
Hey, I’m curious as to if anyone else is having this issue since iOS 18 came out, my 15 pro and my sisters 13 have un Set up Apple Cash and will not set Up. We’ve set up through Apple Wallet, Apple Wallet Settings, turned the phones off and on, removed the Apple IDs and signed back in but still wont set up. It’ll say set up Apple Cash we proceed with the process but just keep saying set up Apple Cash even after the set up steps are finished.
1
0
444
Sep ’24
ControlWidget jump deep link and custom icon error
When i use Xcode16 Beta4, I finish some code for example @available(iOS 18.0, *) struct Test001ControlWidget: ControlWidget { let kind: String = "Test001ControlWidgetKind" var body: some ControlWidgetConfiguration { StaticControlConfiguration(kind: kind, content: { ControlWidgetButton(action: Test001ControlAppIntent(), label: { HStack { Image("controlcenter_point") Text("Test001") } }) }) .displayName("Test001") } } @available(iOS 18.0, *) struct Test001ControlAppIntent: AppIntent { static let title: LocalizedStringResource = "Open Demo Some Page" static var isDiscoverable: Bool = false static var openAppWhenRun: Bool = true func perform() async throws -> some IntentResult & OpensIntent { let defaultIntent = OpenURLIntent() guard let url = URL(string: Test001JumpType.sohuWatchPoint.jumpLink()) else { return .result(opensIntent: defaultIntent) } return .result(opensIntent: OpenURLIntent(url)) } } The icon can be displayed normally and icon type is png. And deep link also jump normally.(Note: The control widget file target membership are main app and widgetExtension) But iOS18 RC code is no working and icon show "?" How do I deal with these issues? I hope to hear from you soon. Tks a lot...
1
0
568
Sep ’24
Issue with WebSocket Secure (wss) connection on iOS (works on Node.js, fails on iOS app)
Hello everyone, I’m developing an iOS application that uses WebSocket Secure (wss) to connect to a backend server, which is working correctly. The server is hosted on Render.com and accepts connections over https and wss. Context: • I can connect to the backend without issues using HTTPS from both the app and a web browser. • Using Node.js and the Socket.IO client, the WebSocket connection to the server works correctly over wss://. • The server is configured with a valid SSL certificate (the HTTPS connection is verified and works in a browser). • The problem occurs when I try to connect from the iOS client (using Socket.IO in Swift) to the server through wss://social-gamer-backend.onrender.com. The connection consistently fails on iOS. The Issue: Even though the URL is correctly configured, and I can connect via Node.js, when I attempt to connect from the iOS app, I get connection-related errors. The most common error is: Error while connecting to the socket: Tried emitting when not connected • The server URL is correct (wss://social-gamer-backend.onrender.com). • The JWT token is being sent correctly in the headers. • There are no visible SSL certificate issues since the HTTPS connection works fine. • I’ve tried enabling and disabling App Transport Security (ATS) in the Info.plist. • From Node.js, the same connection code works fine, indicating that the WebSocket server is active and operational. Current iOS Configuration: let manager = SocketManager(socketURL: url, config: [ .log(true), .compress, .reconnects(true), .forceWebsockets(true), .extraHeaders(["Authorization": "Bearer (token)"]) ]) What I’ve tried so far: 1. I’ve tested the connection on different networks, including Wi-Fi and mobile data. 2. I’ve checked the iOS device restrictions and disabled potential network limitations. 3. I’ve enabled detailed logs in Crashlytics, but I can’t find any relevant information indicating why the connection is failing. 4. The same URL with wss:// works on Node.js, so it’s not an issue with the WebSocket server. Question: What could be preventing the iOS app from establishing a successful connection to the WebSocket server over wss://? Is there anything else I should configure in the app or server to allow iOS to handle secure WebSocket connections? I would appreciate any help or suggestions to resolve this issue. Thank you in advance.
1
0
742
Oct ’24
How to handle to WiFi networks with same SSIDs?
Hello Everyone, I have developed an iOS/iPadOS app in which I am checking if the device is connected to a particular WiFi network. I am able to check that using the CNCopyCurrentNetworkInfo dictionary and the value of the key "kCNNetworkInfoKeySSID". So, while doing that I was wondering what will happen if there is another WiFi network with same SSID. Is there another way to identify a WiFi network uniquely?
2
0
269
Oct ’24
How to use 'appStoreReceiptURL' to obtain players' paid purchase information and the purchased version
The application has changed from paid purchase to free use. We need to obtain the previous player's purchase records to unlock the paid content. //Here is the code for the client to obtain the player's payment information: NSURL * receiptURL = [[NSBundle mainBundle] appStoreReceiptURL]; if ([[NSFileManager defaultManager] fileExistsAtPath:[receiptURL path]]){ NSData *receiptData = [NSData dataWithContentsOfURL:receiptURL]; NSString *receiptUrlString = [receiptData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed]; NSLog(@"requestAppStoreReceipt receiptUrlString = %@", receiptUrlString); } else { // 如果凭证为空,则再发一次凭证请求 SKReceiptRefreshRequest *refreshReceiptRequest = [[SKReceiptRefreshRequest alloc] initWithReceiptProperties:@{}]; refreshReceiptRequest.delegate = self; [refreshReceiptRequest start]; NSLog(@"requestAppStoreReceipt 如果凭证为空,则再发一次凭证请求!"); } //The following is the server-side parsing code: Path filePath = Path.of("SubscriptionKey_ABCDEFGHIJ.p8"); String encodedKey = Files.readString(filePath); Environment environment = Environment.SANDBOX; AppStoreServerAPIClient client = new AppStoreServerAPIClient(encodedKey, keyId, issuerId, bundleId, environment); String appReceipt = "MIIcs..."; ReceiptUtility receiptUtil = new ReceiptUtility(); String transactionId = receiptUtil.extractTransactionIdFromTransactionReceipt(transactionReceipt); System.out.println(transactionId); if (transactionId != null) { long now = System.currentTimeMillis(); TransactionHistoryRequest request = new TransactionHistoryRequest() .sort(TransactionHistoryRequest.Order.DESCENDING) .revoked(false) .productTypes(List.of(TransactionHistoryRequest.ProductType.CONSUMABLE)); HistoryResponse response = null; List<String> transactions = new LinkedList<>(); do { String revision = response != null ? response.getRevision() : null; response = client.getTransactionHistory(transactionId, revision, request, GetTransactionHistoryVersion.V2); transactions.addAll(response.getSignedTransactions()); } while (response.getHasMore()); Set<InputStream> rootCAs = Set.of( new FileInputStream("AppleComputerRootCertificate.cer"), new FileInputStream("AppleIncRootCertificate.cer"), new FileInputStream("AppleRootCA-G2.cer"), new FileInputStream("AppleRootCA-G3.cer") ); Long appAppleId = 1234567899L; // appAppleId must be provided for the Production environment System.out.println(transactions.size()); SignedDataVerifier signedPayloadVerifier = new SignedDataVerifier(rootCAs, bundleId, appAppleId, environment, true); for (String notificationPayload : transactions) { try { AppTransaction payload = signedPayloadVerifier.verifyAndDecodeAppTransaction(notificationPayload); System.out.println(payload); } catch (VerificationException e) { e.printStackTrace(); } } } //Return result analysis: JWSTransactionDecodedPayload{originalTransactionId='2000000641683476', transactionId='2000000641683476', webOrderLineItemId='null', bundleId='', productId='', subscriptionGroupIdentifier='null', purchaseDate=1719566962000, originalPurchaseDate=1719566962000, expiresDate=null, quantity=1, type='Consumable', appAccountToken=null, inAppOwnershipType='PURCHASED', signedDate=1728885967093, revocationReason=null, revocationDate=null, isUpgraded=null, offerType=null, offerIdentifier='null', environment='Sandbox', storefront='CHN', storefrontId='143465', transactionReason='PURCHASE', price=6000, currency='CNY', offerDiscountType='null', unknownFields=null} We have develop according to the following document on our end: https://developer.apple.com/documentation/foundation/nsbundle/1407276-appstorereceipturl#4098404 https://developer.apple.com/documentation/appstoreserverapi/get_transaction_info/ https://developer.apple.com/documentation/appstoreserverapi/data_types We would like to know if the solutions in the document can be used to solve the problems we encountered? Is there a problem with our method of parsing bills that prevents us from obtaining the necessary information?
0
0
601
Oct ’24
Inconsistent Live Caller ID Lookup Performance
I've noticed delays with the Live Caller ID Lookup feature, taking around 3 to 6 seconds to complete, even on repeated lookups. This seems odd since there's no server activity during these repeats, suggesting the information might be coming from a cache. Most of the time, it’s fast, but there are cases when it's unexpectedly slow, and I haven’t quite figured out the pattern yet. Is anyone else seeing this issue? FB number FB15372765 - with sysdiagnose and video demonstrating the delay.
0
0
448
Oct ’24