Post

Replies

Boosts

Views

Activity

Notification Service Extension is initialized but never triggered
Hi all, I'm attempting to implement a notification service extension for my app, however I'm running into some troubles with triggering the extension. The service extension is successfully installed with the app, and is initialized when a notification is received (which ive confirmed by attaching a debugger to it), however the didReceive method is never called. In the debugger console, the following message is printed: Service extension base class recieved didReceiveNotificationRequest: . I can confirm that the all the payload requirements are met to trigger the extension, and I was able to create an extension that would trigger in a blank application (using the same payload). It's only this app that prints this message to the console, and does not trigger. The extension code is as follows (I've removed all of the intended functionality at this point to try and pinpoint the issue) class NotificationService: UNNotificationServiceExtension { var contentHandler: ((UNNotificationContent) -> Void)? var bestAttemptContent: UNMutableNotificationContent? override init() { self.contentHandler = nil self.bestAttemptContent = nil print("startup!") } func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) async { let logger = Logger(subsystem: "app.revolt.chat", category: "notificationservice") logger.info("Invoked notification extension") debugPrint(request) self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent) guard let bestAttemptContent = bestAttemptContent else { print("content is null") return } bestAttemptContent.title = "beans" if request.content.categoryIdentifier != "ALERT_MESSAGE" { bestAttemptContent.subtitle = "not an alert message" contentHandler(bestAttemptContent) return } contentHandler(bestAttemptContent) } override func serviceExtensionTimeWillExpire() { // Called just before the extension will be terminated by the system. // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used. if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent { contentHandler(bestAttemptContent) } } }
0
0
121
4d
I want to know is this harmful
63 ??? (Foundation + 69644) [0x197ad600c] 63 ??? (com.apple.StreamingUnzipService + 39148) [0x1009a58ec] 60 ??? (com.apple.StreamingUnzipService + 47188) [0x1009a7854] 60 ??? (libsystem_kernel.dylib + 24156) [0x1e1d50e5c] 57 <on behalf of appstored [175] (originated by nsurlsessiond [109])> 3 <on behalf of appstored [175] (originated by appstored [175]), Effective Thread QoS User Initiated, Requested Thread QoS User Initiated> 3 ??? (com.apple.StreamingUnzipService + 47560) [0x1009a79c8] 3 ??? (libsystem_kernel.dylib + 24156) [0x1e1d50e5c] 3 <on behalf of appstored [175] (originated by nsurlsessiond [109])> 28 ??? (libsystem_pthread.dylib + 18680) [0x1f5af38f8] 28 ??? (libdispatch.dylib + 90268) [0x1a0b5409c] 28 ??? (libdispatch.dylib + 88212) [0x1a0b53894] 28 ??? (libdispatch.dylib + 26868) [0x1a0b448f4] 28 ??? (libdispatch.dylib + 29532) [0x1a0b4535c] 28 ??? (libdispatch.dylib + 15828) [0x1a0b41dd4] 28 ??? (libdispatch.dylib + 8508) [0x1a0b4013c] 28 ??? (com.apple.StreamingUnzipService + 74144) [0x1009ae1a0] 28 ??? (com.apple.StreamingUnzipService + 70208) [0x1009ad240] 27 ??? (com.apple.StreamingUnzipService + 70912) [0x1009ad500] 27 ??? (libsystem_kernel.dylib + 24156) [0x1e1d50e5c] 26 <on behalf of appstored [175] (originated by nsurlsessiond [109])> 1 <on behalf of appstored [175] (originated by appstored [175]), Effective Thread QoS User Initiated, Requested Thread QoS User Initiated> 1 ??? (com.apple.StreamingUnzipService + 70820) [0x1009ad4a4] 1 ??? (com.apple.StreamingUnzipService + 64680) [0x1009abca8] 1 ??? (libsystem_kernel.dylib + 26968) [0x1e1d51958] 1 <on behalf of appstored [175] (origi
1
0
135
4d
Xcode provisioning profile doesn't include CallKit directory
I'm trying to use the callkit library on Xcode 15 but I'm getting the errors below. Error 1:Automatic signing failed Xcode failed to provision this target. Please file a bug report at https://feedbackassistant.apple.com and include the Update Signing report from the Report navigator. Error 2: Provisioning profile "iOS Team Provisioning Profile: me.liu.brian.Autocall.CallDirectoryHandler" doesn't include the Com.apple.developer.callkit.call-directory entitlement. I already generated the .entitlements file in both my main app and callDirectoryHandler. When I try to enable the CallKit capability in the Identifiers or Profiles section on apple developer.com, the CallKit Capability simply isn't listed under any of the sections, so I can't enable it. What can I do to use CallKit in my app?
0
0
79
4d
Find My shows gibberish for city/region etc. in eastern europe
When viewing relatives' in Find My back in Europe (Slovenia, Croatia, Serbia) their location shows as some nonsense like " , 18" rather than the town, region, or country they're in. This used to work, but stopped a couple of years ago. I've opened a couple of Feedback tickets over the last couple of years, but they've seen zero activity and after numerous iOS and macOS updates, there's been no improvement in the behavior, so it's been recommended to me that I point out the question here. Here are the links: https://feedbackassistant.apple.com/feedback/12159041 https://feedbackassistant.apple.com/feedback/13500852 Is anyone else seeing this sort of behavior?
2
1
114
4d
Shortcut Execution Speed?
Is there anything that can be done to speed up the execution of a Shortcut? There is a Shortcut that many users opt to use with my app that is only effective if it runs immediately - the reality, though, is that it often takes 1-2 seconds for the Shortcut to trigger, rendering it largely useless (the Shortcut is meant to prevent users from being able to disable Screen Time in Settings). Has anyone had success with this, and/or are there other approaches we could be taking?
0
0
87
4d
Subscription with Stripe
We want to have subscription that exist within user account. With Apple IAP if you buy a subscription once, it cannot be bought again for the same iCloud account. But if our user within our app logged out and created another account (app account not iCloud account) he should have ability to buy subscription for this new account. Does Apple allow to use third-party service to implement subscriptions now (e.g. Stripe)? Because Apple IAP renewable subscription model wont work for our case.
0
0
78
4d
ANCS registration failing repeatedly
We have BLE on a vehicle that acts as a peripheral and pairs with the user's iOS device as a central device. As we understand, the only way for a peripheral to be "remembered" for the next connection is registration with ANCS. If we don't register while being connected and then the user goes away, when he next time is in range, fresh pairing has to happen. Is that the right understanding? Before we register, we are discovering the ANCS on an iOS device, with UID for ANCS and connection handle as arguments. There are times when discovering API returns 0x06 (implying service not available). At times, we are able to discover the service and are able to register. We wanted to know if there is a deterministic way to ensure ANCS to be discoverable from the peripheral side? If not, is there another way (say any other service) by which the peripheral can take some action to be remembered?
1
0
77
4d
Possibilities of HCE with new EEU regulations
We want to use HCE or Wallet to use the iPhone on NFC readers that start EV chargers. They use the same tech as transit systems (MiFare and ISO 14443-4), but the backend systems only use the NFC UID for verification. Is it possible to use HCE (CardSession) or Wallet (Transit card) to transmit a static UID? If so, could our use-case go under either In-store purchase, loyalty programme, or transit? Or are those categories very rigid as to their use case? The new EEU regulation seems to open up this a bit.
1
0
110
4d
accessory kit on IOS18
Hi, we are developing a carpooling app. In our app, once, the car driver enters his car, the app connects automatically in the background to the car. The connection to the car is done either via CarPlay or Bluetooth. Currently, when setting up the app, the user has to define how the connection to the car is established. He can choose between three options: either 1)CarPlay, or 2)Bluetooth or 3)both. Is it correct, that starting with the AccessoyKit of IOS18, the user will only have to choose the device, he wants the app to be connected with? However, he no longer has to define the kind of connection, i. e. CarPlay or Bluetooth by which to connect to the device? So in future, users will be able to connect to their Car, but they do not even know, whether the connection is via Bluetooth or CarPlay? If that is the case, it would make our lives much easier;) Many thanks for your help! Greets, Simon
0
0
53
4d
TCP Fast Open in URLSession
I'm very interested in whether it works and, if so, how the system decides to enable or not TFO when working with the network using URLSession. I didn't find any information in the documentation. For example, for NWConnection we need to manually add additional option: /* Allow fast open on the connection parameters */ parameters.allowFastOpen = true let connection = NWConnection(to: endpoint, using: parameters) /* Call send with idempotent initial data before starting the connection */ connection.send(content: initialData, completion: .idempotent) connection.start(queue: myQueue)
1
0
64
5d
Issue with HTTPS Proxy Configuration in WebKit WebView
Hello, I am trying to apply ProxyConfiguration on the WebKit webview. I referred to the following sources: https://forums.developer.apple.com/forums/thread/110312 and https://developer.apple.com/videos/play/wwdc2023/10002/ import WebKit class WebKitViewModel: ObservableObject { let webView: WKWebView @Published var urlString: String = "https://example.com" init() { webView = WKWebView(frame: .zero) } func loadUrl() { guard let url = URL(string: urlString) else { return } var request = URLRequest(url: url) let endpoint = NWEndpoint.hostPort(host: "127.0.0.1", port: 9077) let proxyConfig = ProxyConfiguration.init(httpCONNECTProxy: endpoint) let websiteDataStore = WKWebsiteDataStore.default() websiteDataStore.proxyConfigurations = [proxyConfig] webView.configuration.websiteDataStore = websiteDataStore webView.load(request) } } However, this configuration only works for HTTP proxies. When I try to use an HTTPS proxy, it does not work. When I use NWConnection to connect to the proxy, it works successfully: import Foundation import Network public class HTTPProxy { private let proxyHost: NWEndpoint.Host private let proxyPort: NWEndpoint.Port private var connection: NWConnection? public init(proxyHost: String, proxyPort: UInt16) { self.proxyHost = NWEndpoint.Host(proxyHost) self.proxyPort = NWEndpoint.Port(rawValue: proxyPort)! } public func sendHTTPRequest(completion: @escaping (Result<String, Error>) -> Void) { let tlsOptions = NWProtocolTLS.Options() let parameters = NWParameters(tls: tlsOptions) connection = NWConnection(host: proxyHost, port: proxyPort, using: parameters) connection?.stateUpdateHandler = { [weak self] state in switch state { case .ready: self?.sendConnectRequest(completion: completion) case .failed(let error): completion(.failure(error)) default: break } } connection?.start(queue: .global()) } private func sendConnectRequest(completion: @escaping (Result<String, Error>) -> Void) { guard let connection = connection else { completion(.failure(NSError(domain: "Connection not available", code: -1, userInfo: nil))) return } let username = "xxxx" let password = "xxxx" let credentials = "\(username):\(password)" guard let credentialsData = credentials.data(using: .utf8) else { print("Error encoding credentials") fatalError() } let base64Credentials = credentialsData.base64EncodedString() let proxyAuthorization = "Basic \(base64Credentials)" let connectString = "CONNECT api.ipify.org:80 HTTP/1.1\r\n" + "Host: api.ipify.org:80\r\n" + "Proxy-Authorization: \(proxyAuthorization)\r\n" + "Connection: keep-alive\r\n" + "\r\n" if let connectData = connectString.data(using: .utf8) { connection.send(content: connectData, completion: .contentProcessed { error in if let error = error { completion(.failure(error)) } else { self.receiveConnectResponse(completion: completion) } }) } } private func receiveConnectResponse(completion: @escaping (Result<String, Error>) -> Void) { connection?.receive(minimumIncompleteLength: 1, maximumLength: 65536) { data, context, isComplete, error in if let data = data, let responseString = String(data: data, encoding: .utf8) { if responseString.contains("200 OK") { self.sendRequest(completion: completion) } else { completion(.failure(NSError(domain: "Failed to establish connection", code: -1, userInfo: nil))) } } else if let error = error { completion(.failure(error)) } } } private func sendRequest(completion: @escaping (Result<String, Error>) -> Void) { guard let connection = connection else { completion(.failure(NSError(domain: "Connection not available", code: -1, userInfo: nil))) return } let requestString = "GET /?format=json HTTP/1.1\r\n" + "Host: api.ipify.org\r\n" + // "Proxy-Authorization: Basic xxxxxxxx\r\n" + "Connection: keep-alive\r\n" + "\r\n" print("Sending HTTP request:\n\(requestString)") if let requestData = requestString.data(using: .utf8) { connection.send(content: requestData, completion: .contentProcessed { error in if let error = error { completion(.failure(error)) } else { self.receiveResponse(completion: completion) } }) } } private func receiveResponse(completion: @escaping (Result<String, Error>) -> Void) { connection?.receive(minimumIncompleteLength: 1, maximumLength: 65536) { data, context, isComplete, error in if let data = data, !data.isEmpty { print ("Data: \(data)") if let responseString = String(data: data, encoding: .utf8) { print("Received response:\n\(responseString)") completion(.success(responseString)) } else { completion(.failure(NSError(domain: "Invalid response data", code: -1, userInfo: nil))) } } else if let error = error { completion(.failure(error)) } if isComplete { self.connection?.cancel() self.connection = nil } else { self.receiveResponse(completion: completion) } } } } This approach works for connecting to the proxy, but it does not help with configuring the proxy for WebKit. Could someone please assist me in configuring a proxy for WebKit WebView to work with HTTPS proxies? Thank you!
6
0
128
5d
I am applying for the NEHotspot API Entitlement with the details below, but Apple has rejected it multiple times. Can you help me understand what I am doing wrong?
I am applying for the NEHotspot API Entitlement with the details below, but Apple has rejected it multiple times. Can you help me understand what I am doing wrong? Q. In how many countries are your hotspots located? A - 1 Q. What is the approximate total number of hotspots you manage? A - 1000 Q. Which of the following best explains the relationship between you, the app publisher, and the users of these hotspots? A - These hotspots are free for anyone to use. Hotspot Helper API usage Q. A hotspot helper must claim the hotspot networks that it supports by setting a confidence value of either .low or .high when responding to the .evaluate command. See Figure 1-1 in Hotspot Network Subsystem Programming Guide for more background on this. When the helper claims a network, its display name (kNEHotspotHelperOptionDisplayName) is shown in Settings &amp;gt; Wi-Fi. What value do you intend to use for this? A - BSSID(MAC) Q. When responding to the .authenticate command, you system must interact with your hotspot to instruct it to pass traffic from the device to the wider internet. What network protocols does it use? A - DNS , HTTP Q. Provide any additional details about your usage to help us understand your planned implementation. A - We are implementing the following functionalities in our project: Connect to a Wi-Fi hotspot with a specified SSID. Remove Wi-Fi configurations for specific SSIDs. Initialize a new hotspot configuration with the specified SSID.
1
0
80
5d
Confirm Hotspot 2.0 (passpoint R2 and R3) support in iOS device
Hello all, I am working on a project to connect to infra-WIFI via hotspot 2.0 (passpoint in WiFi alliance) from a loyalty app (to load trust anchor and client certificate) into iOS device using EAP-TLS. Apple's documentation only describe generic hotspot 2.0 support (probably R1). The UX for loading certificate is not user friendly compare with Android. I wish to confirm if iOS can support Passpoint R2 / R3 from apple to complete the App UX design. Please advise. Thanks. I am not doing EAP-AKA like what mobile telco ATT does for cellular offload to infrastructure WiFi for data traffic. This URL outline what is passpoint well for reference. https://syndicated.wifinowglobal.com/resource/secure-and-seamless-carrier-wi-fi-services-with-passpoint/
0
0
36
5d
"App not responding" in the dock menu
I have a bundled macOS application. This is a non-interactive application where I m performing some task on the worker thread while the main thread waits for this task to be completed. Sometimes this task can be time consuming. I have observed that when I run the application using the bundle( like double click or open command) I can see the OS marking my application as not responding( this is evident as the app icon toggles in the dock and then it states not responding). Although If I run the unix executable in the bundle, the app runs and I do not see the not responding status anywhere. I wanted to understand If this is happening because my main thread is in a waiting state? If yes, what could I do to resolve it because my application logic demands the main thread to wait for the worker thread to complete its task. Is there some way to use some event loop like GCD? Note: I cannot use the delegates(Appkit) event loop because my application will be run in non-GUI context.
5
0
135
5d
pointOfInterestCategory missing on mapkit js placeLookup
const lookup = new mapkit.PlaceLookup() lookup.getPlace(input?.id, (error, place) => { console.log("place", place) ... gives me for example { "id": "I65A54A72CE9E45D6", "alternateIds": [ "IB86C41DA005E0D9B" ], "muid": "7324342225941186006", "_styleAttributes": "4:226,6:16,10:0,82:12,85:12,89:1,164:1,193:1", "name": "The Museum of Modern Art", "region": { "center": { "latitude": 40.7612829, "longitude": -73.9768677 }, "span": { "latitudeDelta": 0.008983199999995861, "longitudeDelta": 0.01186000000001286 } }, "coordinate": { "latitude": 40.7617238, "longitude": -73.9777654 }, "formattedAddress": "11 W 53rd St, New York, NY 10019, United States", "countryCode": "US", "telephone": "+12127089400", "urls": [ "http://www.moma.org" ], "country": "United States", "administrativeArea": "New York", "administrativeAreaCode": "NY", "locality": "New York", "postCode": "10019", "subLocality": "Manhattan", "thoroughfare": "W 53rd St", "subThoroughfare": "11", "fullThoroughfare": "11 W 53rd St", "areasOfInterest": [ "Manhattan" ], "dependentLocalities": [ "Midtown Center", "Midtown East", "Midtown Manhattan", "Midtown", "North Hudson" ], "timezone": "America/New_York", "timezoneSecondsFromGmt": -14400 } Note there is no pointOfInterestCategory. but const place_search = new mapkit.Search() place_search.search( input, (error, result) => { console.log("result_places_0", result?.places?.[0]) ... i get { "id": "I65A54A72CE9E45D6", "alternateIds": [ "IB86C41DA005E0D9B" ], "muid": "7324342225941186006", "_wpURL": "https://maps.apple.com/place?q=The%20Museum%20of%20Modern%20Art&auid=7324342225941186006&address=11%20W%2053rd%20St,%20New%20York,%20NY%20%2010019,%20United%20States&ll=40.7617238,-73.9777654", "_styleAttributes": "4:226,6:16,10:0,82:12,85:12,89:1,164:1,193:1", "pointOfInterestCategory": "Museum", "name": "The Museum of Modern Art", "region": { "center": { "latitude": 40.7612829, "longitude": -73.9768677 }, "span": { "latitudeDelta": 0.008983199999995861, "longitudeDelta": 0.01186000000001286 } }, "coordinate": { "latitude": 40.7617238, "longitude": -73.9777654 }, "formattedAddress": "11 W 53rd St, New York, NY 10019, United States", "countryCode": "US", "telephone": "+12127089400", "urls": [ "http://www.moma.org" ], "country": "United States", "administrativeArea": "New York", "administrativeAreaCode": "NY", "locality": "New York", "postCode": "10019", "subLocality": "Manhattan", "thoroughfare": "W 53rd St", "subThoroughfare": "11", "fullThoroughfare": "11 W 53rd St", "areasOfInterest": [ "Manhattan" ], "dependentLocalities": [ "Midtown Center", "Midtown East", "Midtown Manhattan", "Midtown", "North Hudson" ], "timezone": "America/New_York", "timezoneSecondsFromGmt": -14400 } which gives me "pointOfInterestCategory": "Museum" I think pointOfInterestCategory should also be returned in the placeLookup and might be a mapkit error that its not it would also be cool if search autocomplete gave me the poi so i could tag the search result previews (mapbox does this). Unrelated from this topic but coming from mapbox where everything had a mapbox_id i feel like some things like localities like "columbus, Ohio" should still have a place id but maybe the muid serves that purpose idk and just something i should account for. Lastly on my mind is how to manage rate limiting since im just giving the same mapbox js token to all the clients. Of course for server api I can manage my own system for rate limiting logged in users a bit easier but not sure about mapkit js though I can only dream my project is big enough i need to even worry about that lol.
0
0
111
5d
MacOS bundle's binary can't run
I made a project with MacOS/Bundle/Objective-C. I added main.m as like: #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { printf("Test\n"); } Built it and the generated bundle. I open the bundle with Finder and located the binary in the MacOS directory within the bundle. The file command returned as like: <path...>TestProject: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64] <path...>TestProject (for architecture x86_64):Mach-O 64-bit bundle x86_64 <path...>TestProject (for architecture arm64): Mach-O 64-bit bundle arm64 It apparently generated the Universal binary. Of course, no error were reported on building. I tried to execute the binary with drag&drop the file into Terminal, but shell reported as like: zsh: exec format error: <path..>TestProject These are reproducing my trouble. My target project is so old but it can generate executable x86_64 only binary. I want to be universal binary. My Xcode is 15.4 on Sonoma.
1
0
112
5d