iOS Share Extension not working after deploy - ios

I have created a Share extension which working fine while I am running it though xcode on device or simulator. But when I creating IPA or using TestFlight, it is not passing my list from host app to extension.
I am creating this extension for posting an image in host app ( without uploading on server just in local sqlite ). For this I have checked, App Group and it is fine, cross checked the provisioning certificate and it is also attached with app group.
If you have any idea please let me know.

The entitlement file needs to have the group id information and same should be reflected in build settings.
For me it was just that entitlement file was missing from build settings under code signing entitlements for release.
In debug the app does not require entitlement file.

Related

How do you distribute a Xamarin Forms iOS archived container app with a share extension?

I'm having problems archiving my Xamarin iOS app which has a Share Extension.
I am using Visual Studio 2022 for Windows paired to a Mac.
I have created:
a distribution profile in App Store Connect
identifiers for app and extension with App Group entitlements
App Store profiles for app and extension
Bundle Signing for Extension:
Manual Provisioning
Distribution: Automatic
Provisioning Profile: No matching profiles found (Why not found?)
Bundle Signing for MainApp:
Manual Provisioning
Distribution: Automatic
Provisioning Profile: MyAppName
In addition, in my Identifiers I have an additional record which I did not add myself:
XC com companyname MyAppName Share (Where has this come from?)
When I try to archive I get the following errors:
Cannot create an IOS archive 'MyAppName'. Process cannot be executed on XMA server.
"ditto" exited with code 1
I've searched for documentation or examples on how to distribute a Share Extension, but can't find anything helpful. I've also been able to successfully upload an archive to the store without the Share Extension attached.
What is going on here?
UPDATE
Just tried to release through VS on Mac, and getting a whole lot of new errors. The Mac VS is horribly designed and seems like it was just thrown out as an afterthought. There is no proper output window for archiving issues; the issue messages are squashed, non-wrapped into the single line status bar at the bottom of the screen in a way that I need to open the application on a large monitor to see; I have no idea whether they are warnings or errors and if the build has stopped or not.
I hope the suggested response is not: release it on VS Mac.
Here, i would like to share the way of publishing my app with share extension using VS for MAC, for the purpose of helping others.
First, create iOS Distribution Certificate in your Apple Developer account. Before doing this, you have to generate a Certificate Signing Request file in your KeyChain.
Second, if you use AppGroup, you should generate an App Group ID, which would be used for your share extension as well as its container app. Then in Xamarin Forms project, for your share extension and its container, both set the App Group ID in the Entitlements.plist.
Third, generate App IDs for both your app and share extensions. In Capabilities, you have to configure to choose your AppGroup in previous step.
Then, generate profiles for both your container and share extension. You should select the proper iOS Distribution Certificate and App ID. Then download and refresh your profiles.
Now in Visual Studio for MAC, you could select profiles for your App and extension respectively in iOS Bundle Signing. Then you can archive them for publishing~

App Center iOS build unable to verify integrity

I'm working on a Xamarin application and I'm doing iOS builds to run and test on different devices using App Center.
Everything was ok, on Apple Developer I created the Ad-Hoc certificate, the provisioning file, and the identifier and it was all good.
During the last implementation, I added on Entitlements the Associated Domain due to enabling the possibility to use the App Link and let the user open the application using a link provided via email.
I updated the Identifier adding the feature also to it and I downloaded it and uploaded it again to the dedicated branch on App Center, but now when I try to download the app to the device I receive this message:
Unable To Install "App Name". This app cannot be installed because its integrity could not be verified.
I tried different ways trying to solve it:
Create a completely new certificate with a new identifier, provisioning, and .p12 file
Checked Entitlement feature list correspond to the identifier list on Apple Developer
Used different versions of SDK and Xcode on App Center
I already searched around on the web but they talk about the provisioning file list but I already checked and it is updated.
Thank you for your help and for your suggestions.

App groups are not working after deployment in release mode

I am working on an ionic iOS application. I have a shared extension in the application, to share information between ionic application and my iOS shared extension I have been using app groups to retrieve the values.
The application works expected when the deployment happens in debug mode.
In release mode user defaults does not work from share extension.
I have the distribution certificate with enabled app groups. All the other configuration looks fine.
There is another similar question asked although I did not see any answers for the same.
iOS Share Extension not working after deploy
When ionic app is created the entitlement needs to be added separately, adding entitlement in both main and shared extension app will have to edited in the build settings as well. Under code signing entitlements release need to add the entitlement file location.
The issue was by default the entitlement file is not provided by ionic when you use the shared extension or app group information sharing.
In my case, app groups were only configured for the debug mode.
By following these steps for both the runner and the share extension, I was able to resolve this issue -
Select Runner / Share Extension under "Targets"
Select "Signing and capabilities" tab
Press "+ Capability" button
Select "App Groups"
Set the correct app group for both release and debug modes

iOS app upload to iTunes Connect results in Invalid Signature issue

I'm working on a hybrid mobile app project (Ionic framework) and releasing to Android, iOS and web. This issue concerns only releasing the application on iOS.
I ran into an issue whereby I suddenly started getting the following email from iTunes Connect after building, archiving and uploading my iOS app to App Store from Xcode.
App Store Connect: Your app "YourAppName" (Apple ID: XXXXXXXXXX) has
one or more issues
Dear Developer,
We identified one or more issues with a recent delivery for your app,
"YourAppName". Please correct the following issues, then upload again.
Invalid Signature - A sealed resource is missing or invalid. The file
at path [YourAppName.app/YourAppName] is not properly signed. Make sure you
have signed your application with a distribution certificate, not an
ad hoc certificate or a development certificate. Verify that the code
signing settings in Xcode are correct at the target level (which
override any values at the project level). Additionally, make sure the
bundle you are uploading was built using a Release target in Xcode,
not a Simulator target. If you are certain your code signing settings
are correct, choose "Clean All" in Xcode, delete the "build" directory
in the Finder, and rebuild your release target. For more information,
please consult
https://developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html
Best regards,
The App Store Team
I tried everything I could find on the internet regarding this issue:
Checking over my certificates, provisioning profiles, recreating them, updating Xcode, building the project again, made sure I'm using a distribution certificate not an ad-hoc certificate, verified the code signing settings in Xcode were correct, verified the bundle was built using the Release target, tried the "Clean All" option, deleted the "build" directory in the finder and rebuilt the release. In short - I tried everything I could find by Apple regarding this issue, also looked up the same issue in StackOverflow and tried a huge variety of the recommended solutions. I tried all of those options multiple times over to make sure I didn't miss anything.
Nothing worked...
Also a note that I was able to upload to App Store without any problems before. There hasn't been any changes to the project which could result in this Invalid Signature issue arising - no certificates have expired, no new ones have been created, no new provisioning profiles have been created. The same profiles and certificates were used which worked just fine some time ago. iTunes Connect just suddenly started responding with this issue.
What else can I try?
I was sceptical at first when I tried this solution but this actually solved my issue.
Find a spare USB stick or an external hard drive.
If your Mac's filesystem is APFS format the external volume using a HPFS Mac OS Extended (Journaled) file system. Move your project over to the freshly formatted HPFS external volume and rebuild it over there. This is important as if you build it on your Mac's APFS volume and then move it over to your HPFS external volume to archive and upload in Xcode this will not work!
The project needs to be built, signed, archived and uploaded ON the HPFS volume.
The uploading to App Store should now work again. It worked for me, hope it works for you as well.
See more information on the solution here

Trying to Upload App to Mac App Store, Invalid Binary?

I'm getting ready to upload my Mac application to the Mac App Store, I've created the Application certificate and the installer certificate. When I go to validate my app, Xcode says the app has been validated and is ready to upload to the store. Every time I upload my app to iTunes Connect everything goes smoothly and the app uploads. Then the problem starts, in iTunes Connect my app state is listed as "Invalid Binary" and I receive an email from iTunes Connect saying my app was improperly signed. I really don't think I'm doing anything wrong. Right now, I have the project and the target in my app code signed, is this necessary or do I just need to sign one of them? Also, I've been having a strange issue that when I code sign the target my app builds but it doesn't run. It does not cause any error though. When only my project is signed, the app runs normally. I'm pretty confused on all of this so any help would be greatly appreciated. This is my first App Store submission so I'm excited to get an app up for sale.
Thanks for your time,
Sam
Edit: Just tried uploading the app with application loader. It uploaded to iTunes Connect but I still get the same invalid binary error. Also, I shared my archived application as a .pkg and tried to install it. I got an error saying that "This application cannot be installed on this computer". Any idea why this would happen?
You can do a:
codesign -dvvv *.app
on an app bundle directory from the Terminal command-line to see how the app you are trying to upload is signed.
Any Target setting overrides the identical Project setting for that target build. You should use a different build configuration for Distribution than for Release or Debug and running the app.

Resources