Post

Replies

Boosts

Views

Activity

Background Transfer Service and Client Certificates
I can't get NSURLSession background tasks to use client certificates.I have a simple app that creates an NSURLSessionDownloadTask from an NSURLSession that uses NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier(...).I have a custom delegate that implements:"func URLSession(session: NSURLSession, didReceiveChallenge challenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void)". For NSURLAuthenticationMethodServerTrust, I accept any server. For NSURLAuthenticationMethodClientCertificate, I have a hardcoded PKCS12 bundle with a single certificate and key from which I successfully create an NSURLCredential (using SecPKCS12Import), then pass that credential to the completion handler with .UseCredential.At runtime, I get the didReceiveChallenge callback for ClientCertificate, then another for NSURLAuthenticationMethodServerTrust, then URLSessionDidFinishEventsForBackgroundURLSession right away without completing the TLS handshake.If I change the NSURLSessionConfiguration to use NSURLSessionConfiguration.defaultSessionConfiguration(), the client cert is presented correctly and the download proceeds.Both tests are done with the app in the foreground.
16
0
7.5k
Dec ’15
BLE Peripheral disconnects every 30 seconds
I am having an issue with CoreBluetooth on iOS. My app is serving as a central that connects to one physical bluetooth peripheral. I have no issues discovering, connecting, and reading data from the peripheral. The particular information I need is provided through a notification. I can begin recieving the info after setting the notify value:devicePeripheral.setNotifyValue(true, forCharacteristic: dataCharacteristic)I am also keeping a strong reference to my devicePeripheral after discovery and to the dataCharacteristic after the peripheral is connected and its characteristics have been discovered.After setting the notify value, I begin receiving the data at a frequent interval. For the app's purpose, I need to collect data from this notification for an extended period of time.The issue I am facing is that the peripheral is automatically disconnected exactly every 30 seconds, even while my notify value is set to true- so in the middle of reading data, I am suddenly forcibly disconnected exactly every 30 seconds. I have added code that upon disconnection, I rescan and reconnect, reset the notify value and carry on capturing data. The problem is that I need to capture data continuously without interruption, and that capture is being interrupted consistently every 30 seconds. This causes a gap of lost data.After exactly 30 seconds, "didDisconnectPeripheral" fires with the following error:Error Domain=CBErrorDomain Code=0 "Unknown error." UserInfo=0x174b6b90 {NSLocalizedDescription=Unknown error.}Can anyone offer any suggestions as to why this might be ocurring, and how I might resolve it?I have also developed an Android client that interacts with this same peripheral, and it does not suffer from the same issue- there is no 30 second disconnect on that platform, and I have no issues collecting data for an extended period of time. I have also tested connecting to my peripheral from OS X. I have not found the 30 second disconnect issue on OS X either- it appears that issue is isolated to iOS.I have tested with a iPhone 5 running iOS 8.4.1, and an iPhone 6S+ running iOS 9.2Thanks
7
0
9.2k
Jan ’16
Problems with APNS (push notifications feedback)
Hello here,I am having issues to connect to 'feedback.push.apple.com:2196' for feedback push notifications. My PHP script has been working perfectly until I have renewed the push notification .pem certificate, but now it gives me this error:PHP Warning: stream_socket_client(): Failed to enable crypto in myscript.php on line 10Fact is: the new certificate works because I am able to send out push notifications to my app users, so, where is the problem??!!Here is the PHP script I am using to connect to the service ( I left out the part working on the returned data which is irrilevant for the connection issue):$passphrase = 'mypw'; $stream_context = stream_context_create(); stream_context_set_option($stream_context, 'ssl', 'local_cert', '/path/to/mycertificate.pem'); stream_context_set_option($stream_context, 'ssl', 'passphrase', $passphrase); $apns = stream_socket_client('ssl://feedback.push.apple.com:2196', $errcode, $errstr, 60, STREAM_CLIENT_CONNECT, $stream_context); if(!$apns) { echo "ERROR $errcode: $errstr\n"; return; } ///Read data here... fclose($apns);Any ideas are very welcome!Thanks to everyone in advance.Fab.
2
1
2.3k
Jan ’16
Text Kit not word-wrapping first/last lines in UITextView
When using an exclusion path with an UITextView, the text view is not properly wrapping the words for the first and last line in the example shown (lower text). It does render properly using word-wrap with Core Text (top example).(Hmm - the image link I provided in the HTML here works with the preview, but not the post. The example image is at: http i.stack.imgur.com/Z91ge.pngHere is the code for the UITextView (both this and the Core Text example use the same size bezier path, and both use the appropriate corresponding font and paragraph settings; wrap by word and centered):NSString *testText = @"Text Kit exclusion paths ..."; / UIBezierPath *viewPath = [UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 280, 280)]; UIBezierPath *shapePath = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(10, 10, 265, 265)]; viewPath.usesEvenOddFillRule = true; shapePath.usesEvenOddFillRule = true; [shapePath appendPath:viewPath]; NSMutableAttributedString *title = [[NSMutableAttributedString alloc]initWithString:testText]; UIFont *font = [UIFont fontWithName:@"BradleyHandITCTT-Bold" size:14]; [title addAttribute:NSFontAttributeName value:font range:NSMakeRange(0, title.length)]; [title addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(0, title.length)]; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; [paragraphStyle setAlignment:NSTextAlignmentCenter]; [paragraphStyle setLineBreakMode:NSLineBreakByWordWrapping]; [title addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, title.length)]; UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0.0, 370.0, 280, 280)]; textView.textContainerInset = UIEdgeInsetsMake(0,0,0,0); textView.textContainer.exclusionPaths = @[shapePath]; [textView.textContainer setLineBreakMode:NSLineBreakByWordWrapping]; textView.contentInset = UIEdgeInsetsMake(0,0,0,0); textView.attributedText = title; textView.backgroundColor = [UIColor clearColor];It is worth noting that the Text Kit is respecting the word wrapping rules except for the first and (possibly last) line where the text does not actually fit. I need this to work with a UITextView because text entry is required, or I would be done with my Core Text example.I have tried everything I can think of to reliably work-around the issue. I don't fully understand how UITextView is working with Core Text (or I would expect to get the same results which I don’t), so any suggestions would be greatly appreciated.
3
0
2.0k
Feb ’16
Supporting IPv6-only Networks
In 2016 Apple announced that, starting June 1, 2016, all apps submitted to the App Store must support IPv6-only networking (see this developer news article). If you have specific follow-up questions about this policy, please feel free to post them to DevForums using the Network tag. Alternatively, if you want private, one-to-one help, you can open a DTS tech support incident. At the end of this post you’ll find answers to some of the frequently asked questions about this announcement. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" #1 — What’s the best way to check that my app works in an IPv6-only environment? You should test your app on an IPv6-only network. If you don’t have one handy, you can set up a test network by following the instructions in the Test for IPv6 DNS64/NAT64 Compatibility Regularly section of the Networking Overview. IMPORTANT If you’re testing with a WWAN-capable device, make sure to turn off WWAN before running your test. That ensures that your device is actually using the IPv6-only Wi-Fi. Note You can turn off WWAN using Settings > Cellular > Cellular Data (for English localisations outside of North America this is Settings > Mobile Data > Mobile Data). #2 — Do I need to remove all references to IPv4-only constructs (things like gethostbyname) from my app? No. It’s fine for your app to reference, and even use, IPv4-only constructs as long as it behaves correctly in an IPv6-only environment. IMPORTANT In our experience it is easier to adopt address-family agnostic APIs than to maintain separate code paths for IPv4 and IPv6, so we encourage you to do that. #3 — Will I need to update my server? That depends on where your server is running: If you have a server running on the wider Internet, the answer is no. Your server will be accessible to IPv6-only devices via DNS64/NAT64. You should update your server to support IPv6 as a matter of course, but that’s something you can do in your own time. If you have a server embedded within your iOS app (for example, a web server that allows users to transfer files to and from your app), you should make sure it works well in an IPv6-only environment. #4 — My app relies on the system’s ability to synthesise an IPv6 address from an IPv4 address. What should I do on older systems? As described in Use System APIs to Synthesize IPv6 Addresses, starting with iOS 9.2 and OS X 10.11.2 you can use getaddrinfo to synthesise an IPv6 address from an IPv4 address. Your app will be tested on a device running the latest released version of iOS, so you can assume that this support is present. WARNING Synthesising IPv6 addresses yourself is not easy. Specifically, it is not safe to form an IPv6 address by combining an IPv4 address with the Well-Known Prefix (64:ff9b::/96). This may work in some NAT64 networks but it is not a general solution to the problem. If you need to synthesise IPv6 addresses, use getaddrinfo on modern systems or see this post [1] for more background to this issue. [1] Sadly, I was unable to find the new destination for this link, at least in the time that I had available to work on it today. If you have any ideas as to what it should be, please get in touch. #5 — My app communicates with a local network-based accessory which requires IPv4 infrastructure. How can I meet this requirement? We strongly recommend that you modify your accessory to work on an IPv6-only network. There are two approaches you can take: Have the accessory support IPv6 Have the accessory support IPv4 link-local addressing (RFC 3927) Either option will allow your app to communicate with your accessory when both devices are placed on an IPv6-only network. If your accessory supports neither of these options, and it’s not possible for you to revise the accessory to do so, your accessory is fundamentally incompatible with the requirement to support IPv6. Please let App Review know about this when you submit your app. This is not grounds for rejection. The above only applies to your app’s communication with your accessory on the local network. Other aspects of your app are expected to work in an IPv6-only environment. Specifically, if your app has a way to talk to an accessory across the wider Internet, it must be willing to do that over IPv6. This will work via DNS64/NAT64 in the same way as your communication with any other IPv4-only server. #6 — App Review rejected my app, apparently for IPv6 compatibility problems. How can I investigate this? The IPv6 and App Review post discusses some of the more common reasons for why your app might encounter networking problems during review. Revision History 2024-02-06 Fixed some broken links. Fixed the formatting. Made other minor editorial changes. 2019-01-29 Refreshed various links. Made other minor editoral changes. 2016-06-23 Added FAQ #6. 2016-06-22 Added a discussion of the Well-Known Prefix to FAQ #4. 2016-05-31 Added FAQ #5. 2016-05-18 Added this change history. Added FAQ #4. Updated FAQ #1 to clarify the term WWAN and explicitly describe how to disable WWAN. 2016-05-17 Adding FAQs #1, #2 and #3. 2016-05-05 First posted.
0
0
41k
May ’16
About popup asking user if they want to continue allowing the app to use location in the background
Hi everyone,I want to ask and to better understand about the popup that iOS will occasionnally ask the user like :"Weather" has been using your location in the background. Do you want to continue allowing this ?How often dose this occur nad how do they determine when to ask ? And is it possible to prevent this to show to the user ?I can't find any documentation, the only explanation i can find is from the presentation from WWDC 2014 video "What's New in Core Location".Thank,Pat.
10
0
11k
Jun ’16
iCloud deleted all my Desktop and Documents files
So I updated a machine with a bunch of files on the Desktop and in the Documents folder, and when I upgraded it asked me if I wanted to store these folders on iCloud as well. I hit YES and it began trying to upload everything. Now, I guess I had a large file in one of the folders because the total upload was almost 9GB (i have 200GB of available iCloud space). It failed the upload and has just been stuck on 57kb of 8.89GB uploaded for over a day. I've tried restarting and it hasn't moved. I haven't found a way to quit it either. This has been making my machine incredibly slow and has caused the fans to speed up like crazy. Anytime I try to access an Open or Save dialog, the app I'm using crashes, whether it's Preview, Xcode, Photoshop, or even Safari. So I went to the iCloud system preferences and unchecked the "Desktop and Documents" item. I figured it wouldn't delete things that were still locally saved on my disk. But I was wrong and now every single file on both my Desktop and in my Documents is gone. Not in the trash, nowhere to be found. Gone.Can any one help me with this? Has anyone experienced something similar? The iCloud upload is still there and still isn't progressing at all (not sure what its trying to upload anyways since the files were all deleted). My computer is unusable and my files are all gone. I have a Time Machine backup from last week, but I will not have access to for almost 2 more weeks so if there's a way to recover my files sooner and kill this upload task, that would be amazing.Thanks.
46
5
160k
Jun ’16
Dirty shutdown "shutdown -u"
Hi, For some reason, dirty shutdown is no longer working for me under 10.12 betaI have a script running that switches of my Mac Pro 5,1 at midnight every day. Since I travel a lot, I can remotely switch on my Mac Pro with an remotely controlled power plug switch off/switch on. Works like charm - until now. Looks like something has changed with 10.12... Anybody has an idea? Is it still working for you?Steps to reproduce:1) shutdown via terminal "shutdown -u now"2) wait until shutdown and a few minutes3) unplug the power plug and replug. Computer should start.Please note: if you do a regular shutdown, and then unplug and re-plug, computer will not start.
2
0
1k
Jun ’16
Notes App Self Scrolls
I just filed a bug report for the Notes app as follows:Area: Notes Summary: When opening Notes with content that is larger than the open Notes App window, and attempting to edit the note, the entire note content scrolls automatically to the top although the cursor remains where text editing was inserted. Typing on the Smart Keyboard will allow text entry however the note insistently keeps scrolling to the top regardless of how often or how much text is entered into the note. Scrolling the note manually with your touch will stop the action from occurring, however that is intermittent and sometimes will scroll automatically as well. This issue will occur on both iPad and iPhone and regardless of the app is used full screen on the iPad or in Split Screen. When the Notes window is not focused and the user is engaging an app in the other split screen window, the Note window does not scroll, only when it is the focused App. Steps to Reproduce: 1. Open Notes2. Begin to edit the note by scrolling down and selecting text or placing your cursor to enter text.3. More likely to happen with a note which has enough text to enable scrolling of the note.Expected Results: The note body of text should not scroll while editing or entering text and should remain where placed either by scrolling to the place of entry with using touch or with moving the cursor with the direction keys of the Smart Keyboard. Actual Results: The note scrolls on its own without intervention. Version: IOS Beta 10.0(14A5261v) Configuration: iPad Pro 12.9" and iPhone 6S both with iOS beta 10.0
35
2
19k
Jun ’16
Using MKTileOverlay and MKPolyLine lose tiles at zoom.
If I have a mapview with a tileoverlay and polyline, the view works until I zoom in close. When zoomed in, the tiles under the polyline don't render, but other tiles not under the polyline do. Xcode 7.3.1 targeting ios 9.3.Below is the minimal test case I have come up with to show this. Any ideas how to debug further? If I remove the polyline overlay, zoom works perfectly fine for all tiles. class MyController: UIViewController, MKMapViewDelegate { @IBOutlet weak var mapView: MKMapView! var overlay:MKTileOverlay = MKTileOverlay(URLTemplate: "https://services.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer/tile/{z}/{y}/{x}.jpg"); override func viewDidLoad() { mapView.delegate = self mapView.showsUserLocation = true; overlay.maximumZ = 15; overlay.minimumZ = 12; overlay.canReplaceMapContent = true mapView.addOverlay(overlay); var points: [CLLocationCoordinate2D] = [CLLocationCoordinate2D]() points.append(CLLocationCoordinate2D(latitude: 40.7608, longitude: -111.8910)); points.append(CLLocationCoordinate2D(latitude: 40.8894, longitude: -111.8808)); var polyline = MKPolyline(coordinates: &points, count: points.count) mapView.addOverlay(polyline) let region = MKCoordinateRegion(center: points[0], span: MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05)) mapView.setRegion(region, animated: false) } func mapView(mapView: MKMapView!, rendererForOverlay overlay: MKOverlay!) -> MKOverlayRenderer! { if overlay is MKPolyline { var polylineRenderer = MKPolylineRenderer(overlay: overlay) polylineRenderer.strokeColor = UIColor.blueColor() polylineRenderer.lineWidth = 5 return polylineRenderer } else if (overlay is MKTileOverlay) { let renderr = MKTileOverlayRenderer(overlay: overlay) return renderr } return nil } }
1
1
1.1k
Jul ’16
How I can create a custom firmware ?
Hello Guys,So for my iPhone 5 i'm nostalgic and I want to downgrade to the iOS 6.X.X version but is not possible so I've got an idea ! Please how I can create a custom firmware ? (I transfer icons, the design and the wallpapers of the iOS in the .ipsw of the iOS 9.3.3, roughly I have the complete design of the iOS 6 while being under the iOS 9.3.3!)Thanks for reply
0
0
2.0k
Aug ’16
Total number of active IAP subscribers
Hello,We have an iOS app that uses In-App Purchase for auto-renewal subscription. We have Monthly subscriptions and annual subsciptions- all are auto-renewals. In iTunes Connect I can see the total number of subscription transactions being processed each month, but I can't see how many subscribers we're adding / retaining. there's no place where I can see what is the total number of active IAP subscribers.Ideally, we'd like to be able to see:- Total number of active subscribers - How these active subscribers are divided between the diffrent products- How many of them are during their Free Trial, and how many already made the first payment,Any ideas on how to find this info - either from iTunes Connect or a third-party solution (actually I also use App Annie).Thanks,Inon
4
1
2.8k
Aug ’16
XPC Error CoreBluetooth
Hi,I'm currently looking into CoreBluetooth, but I'm already struggeling with the simple setup. On starting the test app github I receive the below error message:Search not started as central isn't powered on! unknown2016-08-12 20:37:18.050489 SwiftBluetooth[1865:574397] [CoreBluetooth] XPC connection invalidThis is happening while I had my bluetooth headphones sucessfully connected to the iPhone.So I would expect that at least the headphones get recognised.Device: iPhone 6 OS: 10.0Thanks for your helpTimo
12
0
26k
Aug ’16
Messages App Extension won't hit breakpoints
Greetings,I've been struggling some time with this issue. I have this App which I'm developing a Messages App Extension. App works fine but I can't debug it. I can add NSLog sentences to check for workflow but when I try to add a breakpoint it won't stop there, even if the NSLog nearby is triggered (i.e. It doesn't stop on a breakpoint in viewDidLoad from my MSMessagesAppViewController subclass). I've tried to create a project from scratch and it works fine. It's just with this project (created from XCode 7) that I'm not able to hit any breakpoint. I've tried deleting the extension and recreating a new one with no success. When I try to debug the App target It works just fine, it's this extension target I cannot reach any breakpointAny ideas?
6
0
3k
Aug ’16
UIGestureGraphEdge Crash
When I clicked the NavigationBar in my App,it crashed.It only crashes in iOS 10 .The console log is:Assertion failure in -[UIGestureGraphEdge initWithLabel:sourceNode:targetNode:directed:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3599.6/Source/GestureGraph/UIGestureGraphEdge.m:25
11
0
3.4k
Aug ’16
iOS Universal Links with Wildcards not working
https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html as per this link Universal links with wildcards working fine, followed steps in this link to apply deep linking to my application but it doesn't work. When clicking on a link in received email, it should navigate to my application but it is opening in safari browser. I have mentioned "*.test.com" as applinks in Associated domains under Capabilities in Xcode and in our web side we have deployed "apple-app-site-association" file in root folder. My server host name like "abc.test.com" and I have mentioned applinks like "*.test.com" this universal links with wildcard feature is not working.I have Enabled ‘Associated Domains’ in my app identifier on developers.apple.com, If I have mentioned applinks like "abc.test.com" then it is working fine. My application Developement target is 9.3.
3
0
3.5k
Sep ’16