Posts

Post not yet marked as solved
8 Replies
843 Views
We have an L3 VPN where we use the NE provided method to read packet objects before tunnelling them. We are currently facing a random crash in NetworkExtension packet object reading and it does not seem to provide much details on whats wrong with packets. Here is the relevant stack trace which isn't pointing anything in my code. Therefore, making it difficult to root cause or fix it. Thread 3 name: Dispatch queue: NEPacketTunnelFlow queue Thread 3 Crashed: 0 libobjc.A.dylib 0x00000001aca1748c objc_msgSend + 44 1 libobjc.A.dylib 0x00000001aca32d40 objc_getProperty + 140 2 NetworkExtension 0x00000001a9b05874 __61-[NEPacketTunnelFlow readPacketObjectsWithCompletionHandler:]_block_invoke + 120 3 NetworkExtension 0x00000001a9b5bf24 NEVirtualInterfaceReadMultiplePackets + 1024 4 NetworkExtension 0x00000001a9b5f478 __NEVirtualInterfaceCreateReadSource_block_invoke_2 + 76 5 libdispatch.dylib 0x00000001982ce280 _dispatch_client_callout + 16 6 libdispatch.dylib 0x0000000198273390 _dispatch_continuation_pop$VARIANT$mp + 412 7 libdispatch.dylib 0x00000001982840ac _dispatch_source_invoke$VARIANT$mp + 1308 8 libdispatch.dylib 0x0000000198276c94 _dispatch_lane_serial_drain$VARIANT$mp + 300 9 libdispatch.dylib 0x00000001982778a8 _dispatch_lane_invoke$VARIANT$mp + 424 10 libdispatch.dylib 0x0000000198281338 _dispatch_workloop_worker_thread + 712 11 libsystem_pthread.dylib 0x00000001e0e7d5a4 _pthread_wqthread + 272 12 libsystem_pthread.dylib 0x00000001e0e80874 start_wqthread + 8 The complete crash log can be found here: Complete crashlog - https://developer.apple.com/forums/content/attachment/a5231252-1252-40a0-94da-0fa90d534b49 The crash happens randomly after transferring several MBs for data. I have checked memory pressure which seems to be well within limits when the crash hits. Any help or hint to figure out the cause of this crash would be highly appreciated.
Posted Last updated
.
Post not yet marked as solved
0 Replies
186 Views
tl;dr: Is there a way to automatically take users back to the application where they were when a notification of our app was displayed and user was brought to our app after tapping on that notification? So, we have a VPN application which adds an on-demand VPN configuration. Whenever user uses an application which sends traffic to one of the match domains of the VPN configuration, the packet tunnel is launched in background and it starts tunnelling the traffic. Sometimes, the packet tunnel extension requires logging-into the VPN application for which it sends a local notification and by tapping the notification, user is taken to our VPN app where they complete the authentication and the PacketTunnel extension establishes the VPN tunnel. Now, after successful tunnel establishment, we want to take the user back to the application where they were when on-demand VPN was triggered so that user can continue accessing the resource that required the VPN. We know that iOS displays a small back button with previous application name on top-left corner but that is bit less noticeable and difficult to reach for most of right handed users. Therefore, we would like to take user back to the previous app automatically/programmatically. Is there any API or suggested way it can be achieved?
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.2k Views
iOS 13 allows changing languages per App from settings and I am able to change and see the update instantly in my App. However, my app also has an app extension which shows local notifications as and when required. Now when I change language for my App to Spanish from English while system settings are still in English, the notifications from my App extension are displayed in English while the App when opened from notification is displayed in Spanish. Extension is using below API to get localized notification content. NSString.localizedUserNotificationString(forKey: titleLocalizationKey, arguments: nil) However, the notification is still displayed in English. When I change system language to Spanish, the notification is displayed in Spanish. So, the App language settings are not applied to App extensions. This is very inconvenient because there is no explicit way to change language for App extensions and normal users do not know the difference between the App and its extensions. When they change the language of App, they would expect all the content related to App being displayed in selected language. Is there any solution to this? Or is this a known issue?
Posted Last updated
.
Post marked as solved
3 Replies
664 Views
I have a VPN application which supports On-Demand L3 VPN profiles/configurations. For the on demand VPN profile we have few match domains as on demand rules to trigger the VPN when user accesses the matching resource.Now, we have a situation where the match domains of the VPN profile may change in the VPN server. To support Split tunnelling In packet tunnel, we call a Rest API to get new match domains every time the VPN Packet Tunnel is launched on-demand.Now, everything is fine except for that we are not able to update the VPN profile with new match domains (we have received in the packet tunnel extension) without opening the containing application. Since its an on-demand VPN, users are not expected to open the App for a long time. However, having stale match domains as on-demand rule is also not an ideal condition, either.So, we thought of updating VPN profiles from packet tunnel extension. However, whenever I call the API to read the profiles from preferences, it simply crashes the packet tunnel. This gives me indication that it is not allowed to access VPN profiles from within the extension.So my question is, whether it's allowed read and update VPN profiles inside packettunnel extension using `NETunnelProviderManager loadAllFromPreferencesWithCompletionHandler` API? If not, is there any other API to do it? Or is it simply not allowed?
Posted Last updated
.
Post marked as solved
6 Replies
1k Views
I was trying to implement FQDN to Address resolution using DNSServiceGetAddrInfo API of DNS_SD. Learning from this thread I wanted to use DNSServiceSetDispatchQueue to get results back asynchronously. Here is how I have implemented it.var result = DNSServiceGetAddrInfo(&dnsServiceRef, kDNSServiceFlagsTimeout, 0, DNSServiceFlags(kDNSServiceProtocol_IPv4|kDNSServiceProtocol_IPv6), hostName.cString(using: .utf8), dnssd_callback, pointer) if result != kDNSServiceErr_NoError || dnsServiceRef == nil { delegate?.didFinishDNSResolution(.failed(.error(from: result))) stopResolution() } else { result = DNSServiceSetDispatchQueue(dnsServiceRef, DispatchQueue.main) if result != kDNSServiceErr_NoError { delegate?.didFinishDNSResolution(.failed(.error(from: result))) stopResolution() } }However, using this implementation I do not get callbacks. If I use DNSServiceProcessResult, I am getting responses successfully. If I call DNSServiceProcessResult after DNSServiceSetDispatchQueue, then also I receive callbacks successfully. But, that is discouraged in the documentation of DNSServiceSetDispatchQueue.> * After using DNSServiceSetDispatchQueue on a DNSServiceRef, calling DNSServiceProcessResult* on the same DNSServiceRef will result in undefined behavior and should be avoided.I tried DNSSDObjects and SRVResolver (with a bit change DNSServiceSetDispatchQueue) samples and they both work pretty fine. But when I use the same in my code, it does not work. So, is it possible that DNSServiceSetDispatchQueue can be used with every DNS_SD API except for DNSServiceGetAddrInfo? Or is there a missing piece?Any help would be greatly appreciated.
Posted Last updated
.