ios11

How to handle shouldAddStorePayment for In-App Purchases in iOS 11?

被刻印的时光 ゝ 提交于 2019-12-05 03:44:21
I'm trying to implement that new paymentQueue(_:shouldAddStorePayment:for:) method so my app can handle IAPs directly from the App Store. I'm using the itms-services:// url to test it, like it says here . The thing is, my SKPaymentTransactionObserver is a specific view controller, and if it's not visible when I open the itms-services:// link the delegate method won't be called. What can I do about that? I think I'd have to detect if the user is coming from the App Store to push the right view controller, but I don't know how. The only other option I can think of right now is to make the App

What causes iOS 11 iPad recent apps dock icon to be grayed out?

元气小坏坏 提交于 2019-12-05 02:05:28
I have an app that I have "inherited" to maintain. Since the iOS 11 update, on two separate iPads (iPad Air and iPad 5th gen), I have a problem. Both devices are running iOS 11.0.2. When the app is installed and launched for the first time, the app icon shows up in the "Recent apps" section of the dock, but the icon is grayed out and cannot be tapped (it can be dragged, but long-pressing does nothing). For any subsequent app launches the dock icon remains unchanged, unless any process occurs that causes the app icon to go away from the "Recent apps" section (opening a few other apps or

iOS 11 Prevent Screen Record like Netflix

ε祈祈猫儿з 提交于 2019-12-04 23:05:53
问题 I have video playing in my application which I don't want to be recorded. What Netflix application do is that they let the audio capture but not the video while screen is being recorded. Anyone have idea how to implement this feature? 回答1: You can listen for a UIScreenCapturedDidChange notification. NotificationCenter.default.addObserver(self, selector: #selector(screenCaptureChanged), name: NSNotification.Name.UIScreenCapturedDidChange, object: nil) This is called when iOS 11 screen

Firebase notifications not working in iOS 11

霸气de小男生 提交于 2019-12-04 22:32:54
I'm developing an app that uses Firebase push notifications. It worked well until I tried in iOS 11. Using an iphone with ios 11 the notifications don't arrive. Here's my code: - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^) (UIBackgroundFetchResult))completionHandler { //Manage notification } - (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler{ //Manage

Xcode 9 / iOS 11 “CALayer bounds contains NaN: [nan 0; nan 0]” when popping view controller with nested UINavigationController and UITabBarController

房东的猫 提交于 2019-12-04 21:18:36
问题 I am updating my application for Xcode 9, Swift 4, iOS 11 and the iPhone X. It seems to go relatively smooth all the way but whenever I hit the back button my application crashes. I can go forward 3-4 screens without any problem but the first back button crashes the application, always. It doesn't require the simulator to run as an iPhone X. It doesn't seem to dip into my code in the stack trace so this is in my opinion the redraw phase of the view controller I'm popping to but I'm not sure.

In xcode 9 with iOS 11 - issue with loading of Map tiles on first run

爷,独闯天下 提交于 2019-12-04 18:14:46
问题 --Updated with new findings -- Tested in both simulator and on device. Maps are not loaded correctly when the app is run from a cold start. Tiles are not being displayed. mapViewDidFinishLoadingMap is not being called. So something is going wrong for the map not to finish, but I am getting no errors. The map is loaded fine if I just briefly go out of the app and then in again. Meaning that the maps are loaded if app is opened from background. Any ideas what has change? Worked just fine in iOS

Search bar overlaps with status bar on iOS 11

风流意气都作罢 提交于 2019-12-04 17:34:15
问题 I am using a UISearchController and a UISearchResultsController to implement search functionality. MySearchResultsController implements UISearchResultsUpdating and UISearchBarDelegate: override open func viewDidLoad() { super.viewDidLoad() self.edgesForExtendedLayout = []; self.automaticallyAdjustsScrollViewInsets = false; } I display the searchbar in the tableHeader like this in MyTableViewController: - (void)viewDidLoad { [super viewDidLoad]; self.searchController = [[UISearchController

Xcode 9 - no iOS 11 simulator

十年热恋 提交于 2019-12-04 17:26:50
问题 When I open up the new Xcode 9 and go to Preferences > Components I don't see an option to download iOS 11 simulators. I'm 100% sure I have the latest Xcode 9 beta 4 I did some research and found out that Xcode downloads an index to determine what it is able to download. For me that was: https://devimages-cdn.apple.com/downloads/xcode/simulators/index-9.0.0-CA351AD8-3176-41CB-875C-42A05C7CDEC7.dvtdownloadableindex Basically one is able to use it for any Xcode version by determining the

iOS 11 : Cellular Signal strength

狂风中的少年 提交于 2019-12-04 16:27:57
I was fetching Cellular Signal Strength(iOS < 11) as mentioned below, but in iOS 11 , signalStrength is always 0 let statusBarView = UIApplication.shared.value(forKey: "statusBar") as? UIView if let foregroundView = statusBarView?.value(forKey: "foregroundView") as? UIView { let subiews = foregroundView.subviews var dataNetworkItemView:UIView? for subview in subiews { if subview.isKind(of: NSClassFromString("UIStatusBarSignalStrengthItemView")!) == true { dataNetworkItemView = subview break } } var signalStrength = 0 var signalStrengthBars = 0 if let view = dataNetworkItemView { signalStrength

Auto Layout iOS 11 Toolbar UIBarButtonItem with customView

谁说胖子不能爱 提交于 2019-12-04 15:52:39
Recently in our project there was a problem with a UIBarButtonItem that was using a customView. Before iOS 11 we did the layout via flexible spacing items. This didn't work anymore and so nothing was displayed. Because I didn't find an answer here on SO that really solved the issue for me, I looked into it and came up with a (admittedly kind of hacky) solution I wanted to share with you. Maybe it can help you or you have some feedback. This is mixed objc and swift code, hope you don't mind. As shown in the WWDC Video Updating Your App for iOS 11 : "And so now in iOS 11, UI toolbar and UI