Keychain Sharing with watchOS 2 - All about project settings? - ios

I am using Xcode 7.0 (7A220), targeting iOS 9.0 and watchOS 2.0.
I haven't gotten keychain sharing to work in a watchOS 2 app of my own, but it works in this example project, which is part of my question.
There is a good talk from NatashaTheRobot (here) where she goes over keychain sharing with watchOS.(Working code from github here), see for yourself that her iOS app and watch app are able to share via keychain in the simulator.
Here's what I have done to her project and it still works:
Removed the access group string from the KeychainItemWrapper init method. This makes sense because the simulator isn't code signed and the access group gets deleted in KeychainItemWrapper initWithIdentifier: (checkout the comment in initWithIdentifier:)
Removed the identifier string from KeychainItemWrapper initWithIdentifier in both view controllers
Removed the keychain-access-groups key from both entitlements that specifies a keychain access group key
You can remove these three things and keychain sharing still works in the simulator for this project. Why? Shouldn't entitlements at least be necessary?
The thing that finally breaks this project is changing the development team/provisioning profile, which makes me think project settings are the real key to this issue.
In my own project I have added a watchOS 2 extension, added the keychain sharing capability to both targets, added appropriate access groups even with my bundle seed ID, I have tried creating separate provisioning profiles for the iOS app, watchkit app, and watchkit extension. I'm sure I am forgetting things I've already tried, I have been attempting to solve this for about a week to no avail. What am I missing?
Apple's docs on creating capabilities are not super specific on project settings. It says to click and turn on capabilities in the project. Done that.
Apple's other docs on generic keychain use didn't clear it up for me either. They have a project with 2 targets that share a keychain, but as far as I can tell my project settings and theirs aren't significantly different.
This answer goes over the useyourloaf article from 2010 on keychain sharing, but like I mentioned before, it seems like the simulator completely ignores those keychain access group identifiers.
I keep thinking there must be something obvious I have missed throughout all of this. Any pointers would be greatly appreciated.

Since watchOS 2.0 it is not possible to share a keychain item between the watch and its paired device.
https://forums.developer.apple.com/thread/5938

Related

Bundle ID not listed App store connect new app list (Xcode 11.4.1)

I have created a developer account for two weeks, and now I want to submit my first App. However, when I click new app, the bundle ID list does NOT show the project I would like to submit, but It do show some projects I used to practice. I have look up a variety of solutions on internet, including sign out and log in again, or clean up my Safari data. I have suspected some reason, but I'm not quite sure if it right?
First doubt : some SDK import?
The Bundle ID shows on the list are some small project I used to practice when I was a beginner. Recently, I have tried to use some SDK like Facebook SDK and Firebase. Facebook and Firebase works fine on my simulator and iPhone devices. So I'm not quite think this might be the reason, nut just type on in case I missed something
Second doubt : Xcode version?
When I tried to using Firebase, since iOS 13.3.1 seems not to support, so I update my iPhone to iOS 13.4.1. However, the Xcode should also be updated to 11.4.1, otherwise it cannot connect to my devices. When I look up the bundle IDs listed on App Store Connect, I think those projects are created before I updated Xcode. The project created after updated not showed on the list. But I have created too many projects to practice, so I'm not quite sure I remembered right. I suspect this might be the reason, anyone else met the same problem after updated Xcode?
By the way, there is also a strange thing confused me. I have deleted some projects I used to practiced on my MAC, but they stilled shown on the list... I have manually deleted on my Apple Developer Web.
1) Go to https://developer.apple.com/account and set up the app with its explicit bundle ID.
2) Then go to https://appstoreconnect.apple.com > "Create new app" > Select the previously created bundle ID.
This does not really have anything to do with SDK usage or Xcode setup. (Automatic code signing might do some steps for you, but the most bullet-proof way is mentioned above)

iOS - Missing CFBundleIconName in Xcode 9.2

I am uploading build to release app using Xcode 9.2 built with iOS 11 SDK. Binary is archived and uploaded successfully, but I get the following email back.
Dear developer,
We have discovered one or more issues with your recent delivery for
"". To process your delivery, the following issues must be corrected:
Missing Info.plist value - A value for the Info.plist key
CFBundleIconName is missing in the bundle ''. Apps that provide icons
in the asset catalog must also provide this Info.plist key. For more
information see
http://help.apple.com/xcode/mac/current/#/dev10510b1f7. Once these
issues have been corrected, you can then redeliver the corrected
binary.
Regards,
The App Store team
I found a solution.
Missing CFBundleIconName in Xcode9 iOS11 app release
But i need little bit more. I don't want to use *.xcassets file for app icon. I want to use image in xCode project folder for app icon.
Is it possible in xCode 9.2? if yes then how?
Haven't seen this listed on any of the other posts but this was my issue.
Make sure to check the target membership of your assets directory! If you do not correctly link the membership here, you will get this same super-generic error(Apple should do something about the error messages).
The target membership should correlate directly to targets for which you are using the icons. For example, I use this single directory for both my main app, and watch app assets, you must specify this by selecting the appropriate member.
There is a direct option not to use app icon from Assets

iOS App Groups Issue

I am trying to setup App Groups for iOS so that I can save data in a host app, to later access the same data from a today extension.
I have followed all of the guides to a T, and still cannot get this working. This is what I have done.
Created the app group on the apple dev portal ("group.com.xxxxxxxxx.app").
Assigned the group to the app id for the host app, as well as the extension.
Enabled App Groups in xcode with the host target selected, and then with the extension selected.
The extension is all checking out okay, but this is what I get when I have the main target selected:
I checked, and the group is added to my app id:
One thing I do notice (possibly not related), is that when I check the group in xcode, it duplicates and looks like this:
That being said, I know for a fact that there is only one app group on the dev portal. When I deselect the app group in xcode, the other disappears:
I have deleted provisioning profiles, and certs. Rebuild the app and tried both automatic and manual signing. I still cannot get the last issue to resolve.
Thank you for looking into it with me!
This happened to me as well, and it turned out somewhere along the line Xcode had nuked the "Team" I had set on my main app target in "General".
If this doesn't solve it for you, I had also cleaned the project and deleted DerivedData before stumbling upon this and setting my Team back to normal, so you may need to follow those steps before going to the "General" tab on your main app target.

app with Objective-C and swift code crash at launch in release mode, debug mode fine

My project is Objective-C based, and have some third party swift code.
The app runs fine at debug mode, however, when I archive the app as release mode, the app will crash at launch screen.
Set swift optimization level to None still has the same issue. I have crashlytics 3.7 installed, but it crashes at launch, it didn't have a chance to upload the crash. I am very desperate. Any ideas?
Update:
I tried to remove all swift stuff and archive, everything is as usual now. However, once I drag the swift files into my Objective-C based project, Run(debug) the app is fine. But if archive(release) and install it on iPhone, immediate crash at launch. Anything what I am missing?
Alright, after thousands of archiving and testing, I found it's being caused by the in-house distribution.
It is mssing one attribute 'OU' in the certificate. I had to re-create a new cert, and now it has 'OU' there. Looks like Apple does not mention it at all when dealing with old projects adopting swift code.
Quote from Enterprise Distribution not playing nice with iOS8 in Swift App
All explained in details in this article :
https://www.airsignapp.com/ios-apps-using-swift-crash-when-signed-with-inhouse-certificate/
We can confirm that after create a new cert and .mobileprovision, no more issues.
We found origins that caused this issue, related to a missing attribute in “Subject” field InHouse Certificates :
BEFORE Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, O=Company Name, C=FR
AFTER Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, OU=269J2W3P2L, O=Company Name, C=FR
I'll post this is an answer, because I don't have the rep to post comments. I've had similar problem, although not related to Swift. Could be worth checking out though.
For me the problem had to do with file deletion in Xcode. I had removed some files from the Xcode project, but they were still present in the folder on my hard drive. When running the project through Xcode it would load these files as if they were part of the project, but when archiving it would not include them. This made the app work perfectly when run through Xcode, but crash when running the archived version, as it tried to load something that didn't exist.
So, one thing to check is that the files that should be loaded when starting the app are visible in the project navigator in Xcode. Hope it can be of help!

iCloud and Core Data not working - URLForUbiquityContainerIndentifier is nil

I am not that familiar with iCloud integration. I read numerous bad reports about the integration in iOS 5 and 6. But now I guess it's better in iOS 7 so I decided to add it in one of the new apps I'm working on.
From what I read and saw in the WWDC 2013 CoreData/iCloud video I thought it was as simple as flipping on iCloud in Xcode and configuring the NSPersistentStoreUbiquitousContentNameKey value to something unique in the addPersistentStore call, to get started. But each time I run the app, in the simulator or on a physical iPhone, the console output shows the iCloud setup failed due to URLForUbiquityContainerIdentifier returning nil.
I am using Xcode 6 beta and the iOS 8 beta 2 SDK. I've made sure iCloud is signed in and otherwise functioning on the simulator and physical devices. I've also made sure that the "Documents/Data" switch is on under iCloud setting and the app IS appearing here. I've also browsed to the simulator application directory and I see the SQLite file in the normal documents directory and in an iCloud directory.
Is there something really simple I'm missing?
There is bug in Xcode 6 beta version , i am using Xcode6 beta 5 and facing same problem.
I changed key com.apple.developer.icloud-container-identifiers to com.apple.developer.ubiquity-container-identifiers" (ubiquity, not icloud). Then add an item to this as "iCloud.$(CFBundleIdentifier)". In "Capabilities" tab Xcode will show error in red mark but don't fix it , leave as it is.
If solved my problem and i am getting Url now.
Not sure what the developer agreements allows to say, but at the time of writing this, it is still beta and most probably is a bug in xcode 6. There may be a few threads on the developer forum on that exact same subject. Search for 'URLForUbiquityContainerIdentifier' and you may find more information.
Try beta 4. My iCloud code is now working.
You didn't mention configuring your app ID for iCloud access and updating your provisioning profile, so that's probably the problem. The device needs to know that your app is allowed to talk to iCloud, and it does that based on the provisioning profile. You'll need to go to the iOS developer site and:
Update the app ID to add the iCloud capability
Regenerate the provisioning profile so that it includes the new capability
Download a new copy of the profile and make sure that you're using it in testing (it's best to delete the old copy first just to be sure).

Resources