iOS 13 - FileManager url(forPublishingUbiquitousItemAt:expiration:) not working anymore - ios

I've developed an iOS app that uses the url(forPublishingUbiquitousItemAt:expiration:) method of Apple's FileManager class. Starting with the first Beta of iOS 13 this function stopped working and now it throws an error, stating "This code has been removed. You should switch off of this SPI". But I can't find anything related to this function neither in the release notes of iOS nor in the documentation for this function, and it even states there that it would be supported on Mac Catalyst 13.0+.
This also has nothing to do with Xcode 10 and 11, as it occurs when the app is built using either one of those versions.
Does anyone of you know more about that? It would be great to get new information on that.
Thanks,
Fabian.

This is fixed in iOS 13 beta 6. Updated today and this error magically disappeared!
Had my mind blown when I saw this error message.

Related

Swift warning in Xcode 14 : Method confirm(intent:) conflicts with method confirm(intent:completion:) with the same Objective-C selector

Testing the new widget for iOS 16 with Xcode 14, I'm facing an issue trying to port the iOS 14 widget with the new WidgetFamily like .accessoryInline or .accessoryRectangular.
After adding conditional macros to solve some errors in order to build for watchOS and iOS (cf Apple WWDC 22 video: https://developer.apple.com/videos/play/wwdc2022/10050/), Xcode display no red errors but yellow blocking warnings:
Method 'confirm(intent:)' with Objective-C selector
'confirmConfiguration:completion:' conflicts with method
'confirm(intent:completion:)' with the same Objective-C selector; this
is an error in Swift 6
Any idea how to solve it?
EDITED : Finally works without fix that, see answer below. But I'm still interesting to remove this warning.
Finally, it passed without fixing this warning. I remove the last errors around the extension bundle name (has to be prefixed with the watch app bundle and follow by ".xxxxxx" of your choice without any further dot). I also had a "4" (Apple Watch) value to "Targeted Device Families" in build settings (was previously "1,2" for iPhone, iPad).

Requesting an In App Purchase in iOS 13 fails

I use SwiftyStoreKit to request In App Purchases and get only this error with iOS 13:
Error: Optional(Error Domain=ASDErrorDomain Code=507 "Error decoding object" UserInfo={NSLocalizedDescription=Error decoding object, NSLocalizedFailureReason=Attempted to decode store response})
I cannot request information about the products, nor make purchases with a sand box account. However, it works fine in iOS 12.1 on my device. It does not work with the iPhone 11 simulator or an actual device with iOS 13.
I have found a lot, that the Xcode 11 GM seed 1 beta simulator had this problem, but have not found a solution yet. I also tested it with the new released Xcode 11 GM seed 2 version, but there was no fix for me.
Does anyone have a solution on how I can request and purchase In App Purchases again with iOS 13 installed?
Restarting Xcode and simulator did the trick: now my in-app purchases load properly in iOS 13 simulator.
EDIT: This happens in release Xcode 11 too. And happens once in a while, but restarting Xcode and simulators still helps.
EDIT 2: In Xcode 12 beta this bug is also present. But the solution is to create new StoreKit Configuration file (in File -> New menu)
Then add all your products there. Use the same product id's as in AppStore Connect.
Then add this file to Run Scheme configuration.
I had the same issue, iOS13 Simulators produced the same error, iOS12 Simulators were working well.
I then tried out on the iPhone with iOS13 installed, there the calls were working flawlessly too.
Hoping that it'll be fixed soon in Xcode Simulators, I guess until then we are stuck with the error.
Edit:
Now it seems to work also in iOS 13 Simulator Devices.
Note: I've updated the answer, read the Edit part.
To share my experience, it seems that this problem does not exist any more in Xcode 11.1 GM Seed. There's no need to restart Simulators or Xcode to make in-app purchases work anymore.
I had submitted an app for review and it was rejected because of that particular error. As it turns out, it was rejected for a stupid reason as it wasn't my app's bug, however I spent hours trying to get around it.
So, just update to Xcode 11.1 GM Seed and run again. Everything will be okay.
EDIT
The issue still exists in Xcode 11.1 and apparently I was just lucky that it didn't happen to me again. However, I had a second rejection for the exact same reason. What eventually worked and made my app get approved was this:
I had to update my IAP record on App Store by editing and saving it again.
So, I recommend you to try the same; change something temporarily in your IAPs, save and then revert your changes (and save again) so records on the App Store to be refreshed.
FYI, after the second rejection Apple invalidated my IAP and therefore showed me the way. It looks like to be a known issue to them at the end.
For details read this discussion I wrote on Reddit.
For those that has this issue in iOS 14.0, you still need to create the storekit configuration file as per #silvansky answer. Rather than adding it to the target, we can actully start an SKTestSession before making any product request in order to avoid the error.
if #available(iOS 14.0, *) {
do {
let session = try SKTestSession(configurationFileNamed: "Your_StoreKit_Configuration_File_Name")
session.disableDialogs = true
} catch {
// catch error here
}
// Start your product request here
let productIdentifiers = Set(["product_identifier_1", "product_identifier_2"])
let productsRequest = SKProductsRequest(productIdentifiers: productIdentifiers)
productsRequest.delegate = self
// Run the request
productsRequest.start()
}
You can refer to Apple's documentation for SKTestSession for more info: https://developer.apple.com/documentation/storekittest/sktestsession

DispatchQueue.main.async availability iOS 10 works on prior iOS

After migration to new swift 3we've got a lot of automatic syntax changes among which:
DispatchQueue.main.async(execute: {
// Do something
})
documentation says that it's available in iOS 10 and later.
So I expected to see unrecognized selector error when running on iOS 8 but it still works.
So I'm just wondering if it would affect some users since our deployment target is iOS 8?
I just tested it on an iPod touch running 8.4 and DispatchQueue.main.async{} works just fine.
The docs are misleading (wrong?)
I went to log a documentation problem, but wait, among lots of other stuff that's been removed from the Xcodebuilt-in documentation system, you can't log issues with the docs anymore!
I suggest filing a radar bug, then.

UIFeedbackGenerator object creation crashes on iOS 10.0

Has anyone else encountered this? Specifically with an iPhone 6 running iOS 10.0 I'm getting consistent reports of the following crashing:
if #available(iOS 10.0, *) {
UISelectionFeedbackGenerator()
}
Where it's not even being used, just created and it causes an EXC_BAD_ACCESS crash. The docs say it just fails silently if the device doesn't support it. Oddly enough if I change the check to iOS 10.0.1 it works fine.
Am I doing something wrong?
I saw a few seemingly random crashes in production when calling this function as well. When reviewing some old logs, I found that this was only occurring on iOS 10.0.0. As users updated past that, I stopped seeing the crash. I imagine it was some sort of internal UIKit bug that was fixed in iOS 10.0.1.

AddressBook not working in iOS9

Recently I have downloaded Xcode beta4 for giving support to iOS 9 in myApp.Now the address book is not working its show blank screen when I select a contact, with following logs.
plugin com.apple.MobileAddressBook.ContactsViewService interrupted
plugin com.apple.MobileAddressBook.ContactsViewService invalidated
I have implemented all major delegate of ABPeoplePicker and put break points its not going in any of them.
Thanks in advance.
UPDATE
This issue has been solved by Apple since Xcode 7 GM , I have confirmed that it works.
ABPeoplePickerNavigationController no longer works on iOS9,
Apple created new library/framework for Contacts in iOS9 ( https://developer.apple.com/library/prerelease/ios/documentation/Contacts/Reference/Contacts_Framework/index.html )
even if application is compiled/built with older Xcode (6) it still behaves like that, in Beta 2 it crashed , in beta 3 it shows black screen,
Apples sample project ( https://developer.apple.com/library/prerelease/ios/samplecode/PeoplePicker/Introduction/Intro.html ) also has the same issue/behavior.
I have opened an issue at bugreport.apple.com ( id - 22001958 ) , saying that it should at least behave like older iOS versions

Resources