Post

Replies

Boosts

Views

Activity

Console app not showing info and debug logs
I have a Swift 3 Cocoa application that uses Apple's Unified Logging, like this: - import os class MyClass { @available(OSX 10.12, *) static let scribe = OSLog(subsystem: "com.mycompany.myapp", category: "myapp") func SomeFunction(){ if #available(OSX 10.12, *){ os_log("Test Error Message", log: MyClass.scribe, type: .error) } if #available(OSX 10.12, *){ os_log("Test Info Message", log: MyClass.scribe, type: .info) } if #available(OSX 10.12, *){ os_log("Test Debug Message", log: MyClass.scribe, type: .debug) } } }Within the Console application, both Include Info Messages and Include Debug Messages are turned on.When os_log is called, only the error type message is visible in the Console application.Using Terminal, with the command, all message types are visible in the Terminal output: -sudo log stream --level debugI've tried running the Console app as root, via sudo from the command line and the same issue occurs; no debug or info messages can be seen, even though they're set to being turned on under the Action menu.Setting system-wide logging to be debug, has no effect on the Console application output:sudo log config --mode level:debugPlease can someone tell me what I'm missing and how can I view debug and info messages in the Console application?
32
0
34k
Jul ’17
Disk not ejected properly
Since upgrading my iMac to High Sierra Beta I somtimes got the 'Disk not ejected properly' from my Thunderbolt 2 raid (still HFS filesystem).After now connecting my USB 2 external disk to back up after about a minute or two it started to constantly connect and disconnect (Hole list of "Disk not ejected properly" in notifications).Connecting both disk to my Sierra MacBook Pro does not show this behavior. Any idea what is triggering this?
53
1
85k
Jul ’17
Update UIDragPreview during DragInteraction
Hey,during my drag, I need to update the UIDragPreview of the dragged item depending on it's location. I'm currently doing that by setting a new previewProvider each time the preview needs to be updated. When doing this, the current preview gets scaled down a little bit and the new one scales up, which looks a bit weird.Is there a better way to update the DragPreview? Or is there at least a way to get rid of the scaling?Best,Klemens
2
0
1.2k
Aug ’17
Voip Push notifications missed delay
Hi all,In our application we Use VoIP Type push notifications to give a heads-up for the mobile phone.This allows the mobile phone to:1) If the application is killed, start it in background2) If the application is in Background, start running the application statemachine3) If the Phone is in deep sleep, Wake up and start the application in BackgroundDue to the above, our application arrives in a state where we can receive an incoming voip Call.It has been observed that there is a delay in the push notification arrival at the mobile phone.Delayed arrival/delivery of Push notification has been measured of about 6 sec or sometimes never arrives.This espicially is the case when we have an iPhone without sim-card.Note :- This was tested on a controlled setup with large number of iterations with good WiFi and internet connectiviy)- We ensured during testing that the push was actually dispatched to APNS.It is unknown as to what exactly causes a variation in the arrival of the voip notification.Can someone explain why :- Voip messages arrive late depite they should be 'instant' ?- What could explain the difference in measurments with/without sim card ?Best regards.
7
0
6.7k
Jan ’18
On FTP
Questions about FTP crop up from time-to-time here on DevForums. In most cases I write a general “don’t use FTP” response, but I don’t have time to go into all the details. I’ve created this post as a place to collect all of those details, so I can reference them in other threads. IMPORTANT Apple’s official position on FTP is: All our FTP APIs have been deprecated, and you should avoid using deprecated APIs. Apple has been slowly removing FTP support from the user-facing parts of our system. The most recent example of this is that we removed the ftp command-line tool in macOS 10.13. You should avoid the FTP protocol and look to adopt more modern alternatives. The rest of this post is an informational explanation of the overall FTP picture. This post is locked so I can keep it focused. If you have questions or comments, please do create a new thread with the Network tag and I’ll respond there. Don’t Use FTP FTP is a very old and very crufty protocol. Certain things that seem obvious to us now — like being able to create a GUI client that reliably shows a directory listing in a platform-independent manner — are not possible to do in FTP. However, by far the biggest problem with FTP is that it provides no security [1]. Specifically, the FTP protocol: Provides no on-the-wire privacy, so anyone can see the data you transfer Provides no client-authenticates-server authentication, so you have no idea whether you’re talking to the right server Provides no data integrity, allowing an attacker to munge your data in transit Transfers user names and passwords in the clear Using FTP for anonymous downloads may be acceptable (see the note below) but most other uses of FTP are completely inappropriate for the modern Internet. IMPORTANT You should only use FTP for anonymous downloads if you have an independent way to check the integrity of the data you’ve downloaded. For example, if you’re downloading a software update, you could use code signing to check its integrity. If you don’t check the integrity of the data you’ve downloaded, an attacker could substitute a malicious download instead. This would be especially bad in, say, the software update case. These fundamental problems with the FTP protocol mean that it’s not a priority for Apple. This is reflected in the available APIs, which is the subject of the next section. FTP APIs Apple provides two FTP APIs: All Apple platforms provide FTP downloads via NSURLSession Most Apple platforms (everything except watchOS) support CFFTPStream, which allows for directory listings, downloads, uploads, and directory creation. All of these FTP APIs are now deprecated: NSURLSession was deprecated for the purposes of FTP in the 2022 SDKs (macOS 13, {i{,Pad},tv}OS 16, watchOS 9) [2]. CFFTPStream was deprecated in the 2016 SDKs (macOS 10.11, {i{,Pad},tv}OS 9). CFFTPStream still works about as well as it ever did, which is not particularly well. Specifically: There is at least one known crashing bug (r. 35745763), albeit one that occurs quite infrequently. There are clear implementation limitations — like the fact that CFFTPCreateParsedResourceListing assumes a MacRoman text encoding (r. 7420589) — that will not be fixed. If you’re looking for an example of how to use these APIs, check out SimpleFTPSample. Note This sample has not been updated since 2013 and is unlikely to ever be updated given Apple’s position on FTP. The FTP support in NSURLSession has significant limitations: NSURLSession only supports FTP downloads; there is no support for uploads or any other FTP operations NSURLSession does not support resumable FTP downloads [3] NSURLSession background sessions only support HTTP and HTTPS, so you can’t run FTP downloads in the background on iOS If Apple’s FTP APIs are insufficient for your needs, you’ll need to write or acquire your own FTP library. Before you do that, however, consider switching to an alternative protocol. After all, if you’re going to go to the trouble of importing a large FTP library into your code base, you might as well import a library for a better protocol. The next section discusses some options in this space. Alternative Protocols There are numerous better alternatives to FTP: HTTPS is by far the best alternative to FTP, offering good security, good APIs on Apple platforms, good server support, and good network compatibility. Implementing traditional FTP operations over HTTPS can be a bit tricky. One possible way forward is to enable DAV extensions on the server. FTPS is FTP over TLS (aka SSL). While FTPS adds security to the protocol, which is very important, it still inherits many of FTP’s other problems. Personally I try to avoid this protocol. SFTP is a file transfer protocol that’s completely unrelated to FTP. It runs over SSH, making it a great alternative in many of the ad hoc setups that traditionally use FTP. Apple does not have an API for either FTPS or SFTP, although on macOS you may be able to make some headway by invoking the sftp command-line tool. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" [1] In another thread someone asked me about FTP’s other problems, those not related to security, so let’s talk about that. One of FTP’s implicit design goals was to provide cross-platform support that exposes the target platform. You can think of FTP as being kinda like telnet. When you telnet from Unix to VMS, it doesn’t aim to abstract away VMS commands, so that you can type Unix commands at the VMS prompt. Rather, you’re expected to run VMS commands. FTP is (a bit) like that. This choice made sense back when the FTP protocol was invented. Folks were expecting to use FTP via a command-line client, so there was a human in the loop. If they ran a command and it produced VMS-like output, that was fine because they knew that they were FTPing into a VMS machine. However, most users today are using GUI clients, and this design choice makes it very hard to create a general GUI client for FTP. Let’s consider the simple problem of getting the contents of a directory. When you send an FTP LIST command, the server would historically run the platform native directory list command and pipe the results back to you. To create a GUI client you have to parse that data to extract the file names. Doing that is a serious challenge. Indeed, just the first step, working out the text encoding, is a challenge. Many FTP servers use UTF-8, but some use ISO-Latin-1, some use other standard encodings, some use Windows code pages, and so on. I say “historically” above because there have been various efforts to standardise this stuff, both in the RFCs and in individual server implementations. However, if you’re building a general client you can’t rely on these efforts. After all, the reason why folks continue to use FTP is because of it widespread support. [2] To quote the macOS 13 Ventura Release Notes: FTP is deprecated for URLSession and related APIs. Please adopt modern secure networking protocols such as HTTPS. (92623659) [3] Although you can implement resumable downloads using the lower-level CFFTPStream API, courtesy of the kCFStreamPropertyFTPFileTransferOffset property. Revision History 2024-04-15 Added a footnote about FTP’s other problems. Made other minor editorial changes. 2022-08-09 Noted that the FTP support in NSURLSession is now deprecated. Made other minor editorial changes. 2021-04-06 Fixed the formatting. Fixed some links. 2018-02-23 First posted.
0
0
4.6k
Feb ’18
PDFKit memory issue
I have a loop that iterates all pages in a PDF and saves parts of its content into core data. Problem seems to be that each PDFPage takes up around 30mb+ of memory. This memory is not retuned when the loop moves to ther next page. with large enough PDF in can cause out of memory crash.At first I thought it was something in the loop holidng a reference. However when I dont run the loop, or attempt to save any of the PDFPage contents and simply swipe through the PDFPages of the PDF, the memory still goes up 30mb + per page. So my question is how to clear the previous page from memory when no longer the page in view?I would add code but seems you cant pste into here so jist know its basic PDFKit code to load a pdf url
4
0
2.3k
Feb ’18
Battery statistical issue for Packet Tunnel Provider
Hi guys,I'm developing a custom VPN client with NEPacketTunnelProvider which tunnels all device traffic. All is going well so far but I've noticed that iOS battery statistics (Settings -> Battery) is claiming that our client has consumed a significant amount of energy (10%~30%). I though it was true for a while, but then I conducted some basic testing which suggested this is more likely a statistical issue.I set up my device (rebooted with clean battery cosumption statistics) with ~80% battery capacity and started to watch "NASA Live" channel in Youtube app with 1080p60 quality, for 3 hours, and taking notes every hour. I cross referenced the data of the same scenario (same device as well) collected with our custom VPN provider enabled and disabled. I made sure when the VPN client is enabled, I can actually see the Youtube traffic tunneled. Actually the video feed can generate ~1GiB traffic per hour pretty stably. I can provide detailed numbers if necessary, but generally, after 3 hours, both scenarios showed an overal of ~50% battery consumption (from the battery indicator on the status bar on top of the phone screen), there was no significant difference in the battery consumption. However when I looked at the statistics in Settings -> Battery, the scenario without our VPN client was showing 100% battery consumption from Youtube app (which is expected), and the scenario with VPN was showing 68% for Youtube, and 32% for our VPN client app!32% battery consumption in statistics is scaring. But what confuses me is that the actual device battery consumption didn't increase. My theory is that without the VPN client, individual apps are sending out their traffic on their own so the battery consumption are calculated on their head. But now with our VPN client, we are actually sending out traffic for every applications so iOS will blame us for that part of energy consumption. I'm not sure if the theory is true but it certainly explains the behavior.I'm wondering if Apple can look at the issue at if proved to be a statistical issue then fix it. Because 10%+ battery consumption on our app would be enough to scare away our customers. We can explain to them there is no actual extra energy consumption but customers will be suspicious. Whenever they feel their phone's having a shortened battery life they'll come to see the list and they will blame us.Thanks in advance!
12
0
2.3k
Mar ’18
Constant "Your session has expired" (error 1100)
Trying to do a CLI build with XCode (using NativeScript).Was working fine a couple days ago. However, now I cannot get past this error when trying to build:DTDeviceKit: deviceType from 7c64d8a014fd573ca3623ef80b158e57e7aea7c5 was NULL2018-05-07 11:57:54.696 xcodebuild[14808:865317] DVTPortal: Service '<DVTPortalViewDeveloperService: 0x7fe4e17686d0; action='viewDeveloper'>' encountered an unexpected result code from the portal ('1100')2018-05-07 11:57:54.696 xcodebuild[14808:865317] DVTPortal: Error:Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload=<CFBasicHash 0x7fe4e242ed70 [0x7fff9115faf0]>Whenever I open XCode and to go preferences->account, my team account already reports "Session has expired". I log in successfully, then close Xcode, then login again, and once again it says the "Session has expired".Enabled two factor authentication hasn't helped. I get the identical error from two separate machines (Mac Mini and MacBook Air). Using latest High Sierra OS and XCode.My developer accounts logs in fine to the developer portal on Apple's Developer site, iTunes connect, etc..
15
0
36k
May ’18
Safari favicons don't support updating
I use the Gmail 'unread count' favicon labs option, which updates the favicon to reflect the unread message count in my inbox. It's an essential part of my browsing experience / daily workflow. The icon is correct when the tab is first loaded, but it never updates after that. Chrome and Firefox both implement this feature.
5
7
3.2k
Jun ’18
Dynamically resize Annotation's callout
Hi,I've got annotations on a MKMapView and I added a custom view inside the detailCalloutAccessoryView. This custom view performs a request and should present various amount of data depending on the request's reply. Basically, I can show 1 or 2 rows of data.Sometimes, when I touch an annotation and the result is only one row, the callout is not resized. However, if I dimiss the annotation and select it once again, it is rendered correctly.What is the "right" way to make it work? Using a intrinsicContentSize, or calling layoutIfNeeded (already tried, did not work)Thanks for your help.
1
0
1k
Jun ’18
iMessage has merged 2 conversations of 2 different contacts
Hi all,I've 2 separate conversations with 2 different contacts (not the same phone number, nothing in commun).On my MacBook (High Sierra) everything works fine.But on my iPhone X running iOS 12 beta 3 (since beta 2 I've this bug), these 2 conversations are merged.When I write to one or another of these 2 contacts, it displays the 2 conversations in one screen. It merges them.When I try to create a new message, when I enter one of the 2 contacts, I don't know who receive the message, it's not always the same one that receive the message.That's really annoying.Does anyone have this issue too?I filled a bug reporter for that.Regards,Alexandre
21
2
43k
Jul ’18
Major Screen Time Bug
As a parent I was so excited to hear about Screen Time, so much so that I upgraded my sons phone to iOS Beta 2 when it came out.As a parent I setup his access on my phone for his phone and set it so that he could not longer browse the web, watch YouTube etc after 10 PM at night. As before I would go in his room at night and he would be watching videos at 1 am.... (grr)Anyways Screen Time was a blessing until the other night when I heard him up at 1 am and went into his room and there he was watching videos on his phone. For some reason Screen Time wasn't shutting of his app access at 10 PM like it was supposed to.I asked my son how he was able to get around screentime and he told me... (and I consider this a big bug!)When Screen Time kicks in and shuts his apps off, he goes into Settings > General > Date & Time and then turns off "Set Automatically" and then changes the time to a time which he is not restricted by Screen Time, which then unlocks all the apps again.I thought that was smart of him to figure that out and I have not found a way to restrict him from changing his date and time settings.Last night, again he was on his phone after bed time... and I caught him. He said he found an easier way to defeat Screen Time, and he did that by setting the Time to 24 Hour Time, for some reason Screen Time does not understand 24 hour time.I hope this can be fixed by Apple, as if it can't it negates the entire reason for parents to have Screen Time.Thanks,Scott
10
3
25k
Jul ’18
Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.
My Parent app IS signed correctly. I have verified in every screen. Has anyone seen this?Thanks!XCode 10.0 beta 6---------------error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's. Embedded Binary Signing Certificate: Software Signing Parent App Signing Certificate: - (Ad Hoc Code Signed)
8
0
20k
Aug ’18
iOS 12 VPN "Update Required"
Hi Guys,we have developed an VPN application for iOS 10, that basically just installs a VPN profile (developed using NETunnelProviderManager) that sets a special DNS for evey request to block malicious websites system-wide, that's it.Out can worked great under iOS 10 and even under iOS 11. But since updating the OS of the device to iOS 12, there is a "Update required" directly on the VPN profile:My question now is, did anybody else faced that problem?Because we already updated XCode, compiled the app for Deployment Target iOS 12, updated the application through the App Store, we already talked to the Apple Supported, that saif we should try using the develop forums so, can anybody htell us WHAT we should update to get rid off this message? The VPN profile itself still works, meaning the malicious websites still get blocked. But the label "Update Required" should vanish, but what should we do?Kind Regards,Mario
9
1
8.1k
Oct ’18
Use a HTTP Proxy with WkWebView
Hi,We have a need in our Swift app for using a HTTP proxy with WKWebView. We want to route all HTTP(S) traffic through a proxy running Privoxy, which strips the http(s) traffic of tracking scripts and ads (for HTTPS traffic we obviously cannot see the content and strip the ads, but we can still block the requests going to hostnames that are known for serving ads). That is basically our product to our costumers. Anonymous (through proxy), ad and tracking free browsing, where no one is monitoring what you are buying or browsing with the purpose of profiling you and selling the information about you to others.With the now deprecated UIWebview, we were able to setup a HTTP proxy through the NSUrlProtocol, but since its deprecated now, continouing using it seems like a risky idea in anything but the short term.We have not found any way, by which we can setup a HTTP proxy in the WKWebView, since it seems to be doing the networking out-of-process of the app... Sources like this post on this forum seems to back this up: https://forums.developer.apple.com/thread/74572.However, Ssome sources seems to indicate that WkWebView was made more user-friendly with IOS 11 and IOS 12 - which is after the above post, so maybe it is possible now. As said, we have tried without luck recently, but maybe we are missing something?We hope someone can help or otherwise just give us some clarity, as the core part of our product depends on this feature, so any help and/or clarity is appreciated.NB:We have considered other options such as using a VPN to send all our data through our own servers. This requires that we change our full infrastructure setup though. And it seems that there is no split-tunneling options in IOS (on non-managed IOS), so if we use the VPN approach, our VPN connection (meant just for some casual browser surfing) will become a general VPN connection on the device. That means we would have to carry the full load of the users' network usage suddenly, which would likely force us to triple our monthly subscription fee to be rentable...Hope to get an answer, and sorry for the slightly long post! (Hopefully it showed we have done our homework and are not asking you to do it for us atleast!).Best,Jonas
13
0
13k
Oct ’18
Programmatically Connecting to WiFi in iOS
Hi,I create application "Connecting to WiFi in iOS"Code to connecting:Swiftlet configuration = NEHotspotConfiguration.init(ssid: "SSIDname", passphrase: "Password", isWEP: false)configuration.joinOnce = trueNEHotspotConfigurationManager.shared.apply(configuration) { (error) in if error != nil { if error?.localizedDescription == "already associated." { print("Connected") } else{ print("No Connected") } } else { print("Connected") }}and Xamarin[assembly: Dependency(typeof(WifiConnector))]namespace WiFiManager.iOS{ public class WifiConnector : IWifiConnector { public void ConnectToWifi(string ssid, string password) { var wifiManager = new NEHotspotConfigurationManager(); var wifiConfig = new NEHotspotConfiguration(ssid, password, false); wifiManager.ApplyConfiguration(wifiConfig, (error) => { if (error != null) { Console.WriteLine($"Error while connecting to WiFi network {ssid}: {error}"); } }); } }}Everything works fine but iOS always asks a question "Wants to Join Wi-Fi Network".Is there any possibility that it would not ask? For my application, this popup is a problem. Maybe list of preferred network?Thank you in advance!
9
0
14k
Nov ’18
iOS NSCoreDataCoreSpotlightDelegate, how to reindex all items
I have implemented NSCoreDataCoreSpotlightDelegate, and I missed out the part where the default expirationDate is 1 month, now items that I have added 3 months ago are not showing up in the search index.How do I get NSCoreDataCoreSpotlightDelegate to reindex all the items?I used to be able to call this:mcdcsd.searchableIndex(CSSearchableIndex.default(), reindexAllSearchableItemsWithAcknowledgementHandler: {})And the first time, it will reindex all the items, but if I re-run the app with the above line uncommented again, it will not reindex.If I uninstall the app, install back, then uncomment the above line, then it will index all again for the first time.How do I get it to reindex everything again?
2
0
1.8k
Apr ’19
Why isn't the user data being returned every time?
I am implementing Sign in with Apple using the JS framework.When the user (me, right now) signs in for the first time, I get data I need!The parameters look like thisParameters:{"state"=>"[state]", "code"=>"[code]", "id_token"=> "[jws token]", "user"=>"{\"email\":\"[the email I need]\"}"}My scope is just "email," I don't need (or want) their name.Next, I try signing in again (same everything)But, I get this optionWhen I click "continue" the data looks like thisParameters:{"state"=>"[state]", "code"=>"[code]", "id_token"=> "[id token]"}As you can tell, there is no user object, no email, nothing I can use!If I do the code response and get an access token, I can't use it. There's no public, known endpoints to just get the email they used. There's no point in storing the email if I can never check for it the next time they sign in.This is happening on multiple browsers on macOS 10.14.4.On my iPhone running iOS 13 developer beta 3, every time I click the button, I get the option to "share" or "hide" my email (even though, as shown above, I've sign in before), and sharing the email actually shares it, while hiding it.. well hides it.However, the user data is always there.This bug(?) only appears when clicking Continue, which I can assume appears on devices that aren't running iOS 13. It's quite a problem on devices that aren't this small set of devices, so I hope this is either known, easily fixable, or something! Thanks for any help you can provide.
40
1
27k
Jul ’19
Custom keyboard extension not showing iOS 13
My Custom keyboard extension doesn't appeared in "Settings -> General -> Keyboards -> Add new keyboard-> Third party keyboards" on simulator and real device. My keyboard extension has been working on previous versions.I tested on Xcode11 - beta2 1. File -> new -> Project... -> iOS -> Single View App 2. File -> new -> Targets... -> iOS -> Custom Keyboard Extension 3. Run on iPhone simulator iOS13 4. Go to Settings -> General -> Keyboard -> Keyboards -> Add new keyboard on Simulator. I couldn't find 3rd party keyboards. I tested same thing on xcode10 on iOS 12 simulator. It was fine and I was able to select 3rd party keyboard.It's strange that gboard and swiftkey are normally working on iOS13. Is There something that I miss new configuration or AppReview requirements?
7
1
3.4k
Aug ’19