ios10

Springboard crashing when adding a lot of triggers to UNUserNotificationCenter

半腔热情 提交于 2019-11-29 15:21:01
问题 Save yourselves from hours of debugging, because I've just wasted 2 weeks after bug hunting mysterious app crashes. It turns out, if you're adding a lot o (see answer for more details) notification requests to the UNUserNotificationCenter , it will abruptly crash the Springboard. I haven't found a way around this yet, as the same code worked fine for iOS 9 and below. You can't seem to bulk-add notification requests like before either. Following is the crash I receive every single time (and so

Request authorization to Media Library programmatically fails

余生长醉 提交于 2019-11-29 14:29:29
问题 iOS 10 now requires the user's permission to access the Media Library. We check if we have access to the Media Library before we use it, and if not we then use [MPMediaLibrary requestAuthorization: to request authorization again from the user. I'm expecting this to show the same popup request to access the Media Library that we get at app startup, but nothing happens. It is simply returning with the MPMediaLibraryAuthorizationStatusDenied status from before. The docs for requestAuthorization

Get the filename of image saved to photos album

大憨熊 提交于 2019-11-29 13:39:05
Gain a huge bounty with this seemingly easy question that has no attention. In modern iOS (2017), here's actually the only way I know to save an image to the iOS photos system, and get the filename/path. import UIKit import Photos func saveTheImage... () { UIImageWriteToSavedPhotosAlbum(yourUIImage, self, #selector(Images.image(_:didFinishSavingWithError:contextInfo:)), nil) } func image(_ image: UIImage, didFinishSavingWithError error: NSError?, contextInfo: UnsafeRawPointer) { guard error == nil else { print("Couldn't save the image!") return } doGetFileName() } func doGetFileName() { let fo

Video requiring asp.net authentication not working on iOS 10

坚强是说给别人听的谎言 提交于 2019-11-29 13:28:03
问题 On Safari in iOS 10 my video doesn't work, only showing the play-icon. I serve the video via an asp.net server, which checks to make sure the user has logged on and have access to the video. Only, on iOS 10 the server will respond with 401 Unauthorized! Doing some testing with the code below, I found that safari on iOS 9 sends the ".ASPXAUTH" cookie - but safari on iOS 10 doesn't! <video crossorigin="use-credentials" controls autoplay="autoplay"> <source src="/Server/GetVideo.ashx?id=123"/> <

Facebook login issue with iOS 10

≡放荡痞女 提交于 2019-11-29 12:41:14
问题 I use facebook to login into my application. Trying to login using Facebook on iOS 10 , iPhone simulator 6s. -canOpenURL: failed for URL: "fbauth2:/" - error: "The operation couldn’t be completed. (OSStatus error -10814.)" 10814 : kLSApplicationNotFoundErr -10814 No application in the Launch Services database matches the input criteria. I am using facebook sdk version 4.13.1. Before XCode 8, same code was working perfectly. Any Help ? Thanks in advance. 回答1: Error status 10814 occurs

How I can set a notification which UserNotifications Framework

混江龙づ霸主 提交于 2019-11-29 12:30:51
I can set a notification in a time interval but I don't know how make it in a specific time and date, I try this but don't work let center = UNUserNotificationCenter.current() func notificationSender(){ center.requestAuthorization([.sound, .alert]) { (granted, error) in // We can register for remote notifications here too! } var date = DateComponents() date.hour = 13 date.minute = 57 let trigger = UNCalendarNotificationTrigger.init(dateMatching: date , repeats: false) let content = UNNotificationContent() // edit your content let notification = UNNotificationRequest(identifier: "myNotification

Swift 2 to 3 Migration dispatch_get_global_queue [duplicate]

南笙酒味 提交于 2019-11-29 12:26:50
This question already has an answer here: How do I dispatch_sync, dispatch_async, dispatch_after, etc in Swift 3, Swift 4, and beyond? 6 answers I have the following code that I've been trying to translate into swift 3 from swift 2. Here is what I have so far. DispatchQueue.async(group: DispatchQueue.global(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),execute: { self.controllerDelegate?.codeToRun(progressWindowViewController: self) }) I am getting an error that says Cannot invoke 'global' with an argument list of type (int,int). I know that the global queue needs this though unless they changed it in

WKWebView vs UIWebView

北慕城南 提交于 2019-11-29 12:22:57
I've an app/project with deployment target version - iOS 10. I had used UIWebView , which is deprecated now and replaced by WKWebView . So, I want to replace UIWebView with WKWebView in my project also. It force me to either use UIWebView (with iOS 10) or change deployment target to iOS 11. I cannot change deployment target but as a middleware solution, I added code (programatically) support for both. I mean, if user's device OS is iOS 11 (or above) then use WKWebView else use UIWebView (for iOS 10 or below). Issue statement: Storyboard's view controller does not support both versions, I mean,

iOS “thread-id” doesn't group push notifications

我的未来我决定 提交于 2019-11-29 10:40:49
From the documentation : thread-id | string | When displaying notifications, the system visually groups notifications with the same thread identifier together. For remote notifications, the value of the threadIdentifier property is set to the value of this request header. Our push notification payloads: { aps = { alert = { body = "Leeroy J asked you: Test Push Notification"; }; badge = 12; sound = default; "thread-id" = 9150; }; n = "6kQ/0x6556"; r = 9150; } { aps = { alert = { body = "Leeroy J re: Test Push Notification"; }; badge = 13; sound = default; "thread-id" = 9150; }; n = "6l8/0x6582"

Leaks in Swift 3 / iOS 10

白昼怎懂夜的黑 提交于 2019-11-29 10:37:11
When I'm running instruments and check for leaks, it's showing leaks mainly consisting of: _ContiguousArrayStorage<String> _NativeDictionaryStorageOwner<Int, CGFloat> _NativeDictionaryStorageOwner<String, AnyObject> This is when I'm using Swift 3 and testing on devices using iOS 10. The leaks only show up in iOS 10 while on iOS 9.x everything seems to be normal. On top of that, in iOS 10 UISwitch doesn't seem to deallocate either. Currently I've been creating all kinds of workarounds trying to avoid using dictionaries and in some cases arrays, making it really annoying to code. Question: