Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xcode12] App Clip #8932

Open
chamons opened this issue Jun 22, 2020 · 15 comments
Open

[xcode12] App Clip #8932

chamons opened this issue Jun 22, 2020 · 15 comments
Labels
iOS Issues affecting iOS
Milestone

Comments

@chamons
Copy link
Contributor

chamons commented Jun 22, 2020

This is a feature released in Xcode 12.

For now, this is what is known: https://developer.apple.com/app-clips/

@chamons chamons added the iOS Issues affecting iOS label Jun 22, 2020
@chamons chamons added this to the xcode12 milestone Jun 22, 2020
@jges42
Copy link

jges42 commented Aug 13, 2020

Is there any news weather or not App Clips will be supported by Xamarin?
The use Case that makes much sense is:
Develop an App clip natively with xcode/swift -> merge it into the xamarin ipa using msbuild/vs

Due to the size restrictions it would be nearly impossible to devlop an app clip beyond hello world in xamarin. But it would be great if an existing Xamarin app could be extended with an native app clip.

@sichy
Copy link

sichy commented Aug 24, 2020

Same here, very interested to know. Have few great ideas for app clips for our apps.

@jges42
Copy link

jges42 commented Sep 11, 2020

We found a workaround:

Prerequisit -> you have a working Xamarin iOS App and you want to add a native appclip written in swift (for size)

Recipe:

  1. Create dummy xcode swift ios app (using certificates and appid of your existing xamarin app)
  2. unpack the ipa of your dummy+appclip app
  3. unpack the ipa of your xamarin ios app
  4. add appclip folder to the unpacked xamarin ios app
  5. repack + sign with your certificates
    upload to testflight using the lates xcode beta application loader

@chamons
Copy link
Contributor Author

chamons commented Sep 16, 2020

Just an update on this - While some investigations did occur this summer we did not ship support for this in our initial Xcode 12 support release.

It's on our backlog for future possible features now.

@amirvenus
Copy link

Forgive me for my noobness, but would it not be nice to create the app clips using Xamarin.iOS as well? Is the library size a showstopper? It'd be great if something could be done about it

@sichy
Copy link

sichy commented Sep 21, 2020 via email

@juepiezhongren
Copy link

@sichy what is the smallest xamarin.ios ipa size?

@dhindrik
Copy link

dhindrik commented Nov 6, 2020

We found a workaround:

Prerequisit -> you have a working Xamarin iOS App and you want to add a native appclip written in swift (for size)

Recipe:

  1. Create dummy xcode swift ios app (using certificates and appid of your existing xamarin app)
  2. unpack the ipa of your dummy+appclip app
  3. unpack the ipa of your xamarin ios app
  4. add appclip folder to the unpacked xamarin ios app
  5. repack + sign with your certificates
    upload to testflight using the lates xcode beta application loader

Will this work for Watch apps as well?

@jges42
Copy link

jges42 commented Nov 6, 2020

@dhindrik I suspect it does, but since we did'nt add a watch part to our apps I can't tell for sure.
But AppClip part still works great (2 month later)

@de-preut
Copy link

still no "solution" for this topic? We would really need a better support for AppClips, even if we need to develop the AppClip itself in swift, but a more robust solution than manually copy the folder together!?

@mnxamdev
Copy link

I'm interested in this. Would there be something we can use similar to the current Xamarin infrastructure for Widgets?

@mnxamdev
Copy link

mnxamdev commented Jun 21, 2022

We found a workaround:

Prerequisit -> you have a working Xamarin iOS App and you want to add a native appclip written in swift (for size)

Recipe:

  1. Create dummy xcode swift ios app (using certificates and appid of your existing xamarin app)
  2. unpack the ipa of your dummy+appclip app
  3. unpack the ipa of your xamarin ios app
  4. add appclip folder to the unpacked xamarin ios app
  5. repack + sign with your certificates
    upload to testflight using the lates xcode beta application loader

@dhindrik @jges42 did you have to archive the dummy+appclip app before doing this or just build? Also, do you have scripts to share?

@MohamadAminSoltani
Copy link

still no "solution" for this topic?

@mnxamdev
Copy link

mnxamdev commented Aug 25, 2022

@MohamadAminSoltani Here's my solution:

  1. Create dummy xcode swift iOS app (using certificates and appid of your existing xamarin app)
  2. Add an AppClip to the dummy app per Apple's documentation.
  3. Create and download the AppClip provisioning profiles per Apple's documentation.
  4. Add the following to your Xamarin iOS project .csproj file:
    <Folder Include="Resources\AppClips\**" />  
    <Content Include="Resources\AppClips\**" />
  1. Create an ExportOptions.plist per Apple's documentation. I can't recall how I did this but I may have archived a release or ad-hoc build to get it.
  2. Build your Xamarin.iOS app
  3. Archive your Xamarin.iOS app and upload to TestFlight as usual.

I do this all in CI so that process handles 7 above. Below are part of the commands I use in a build script when building in CI but you can use on your local workstation as part of the Xamarin project build commands. You can infer below where you need to adjust (project name etc.)

xcodebuild archive -scheme MyiOSProjectScheme -sdk iphoneos -allowProvisioningUpdates -archivePath ./My.archive

xcodebuild -exportArchive -archivePath My.archive.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath My.ipa

mv ./My.ipa/My.ipa ./My.ipa/My.ipa.zip
    
cd ./My.ipa
    
unzip -q ./My.ipa.zip
    
cd ..
    
ditto ./My.ipa/Payload/My.app/AppClips/ ../My.Xamarin.App.iOS/Resources/AppClips

This gives you all you need without needing to repack and sign. Once you export/archive from your Xamarin.iOS app you're ready to upload.

@narciszait
Copy link

@MohamadAminSoltani Here's my solution:

  1. Create dummy xcode swift iOS app (using certificates and appid of your existing xamarin app)
  2. Add an AppClip to the dummy app per Apple's documentation.
  3. Create and download the AppClip provisioning profiles per Apple's documentation.
  4. Add the following to your Xamarin iOS project .csproj file:
    <Folder Include="Resources\AppClips\**" />  
    <Content Include="Resources\AppClips\**" />
  1. Create an ExportOptions.plist per Apple's documentation. I can't recall how I did this but I may have archived a release or ad-hoc build to get it.
  2. Build your Xamarin.iOS app
  3. Archive your Xamarin.iOS app and upload to TestFlight as usual.

I do this all in CI so that process handles 7 above. Below are part of the commands I use in a build script when building in CI but you can use on your local workstation as part of the Xamarin project build commands. You can infer below where you need to adjust (project name etc.)

xcodebuild archive -scheme MyiOSProjectScheme -sdk iphoneos -allowProvisioningUpdates -archivePath ./My.archive

xcodebuild -exportArchive -archivePath My.archive.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath My.ipa

mv ./My.ipa/My.ipa ./My.ipa/My.ipa.zip
    
cd ./My.ipa
    
unzip -q ./My.ipa.zip
    
cd ..
    
ditto ./My.ipa/Payload/My.app/AppClips/ ../My.Xamarin.App.iOS/Resources/AppClips

This gives you all you need without needing to repack and sign. Once you export/archive from your Xamarin.iOS app you're ready to upload.

Hi - sorry to revive an inactive thread, but i would like to hear some more about this @mnxamdev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iOS Issues affecting iOS
Projects
None yet
Development

No branches or pull requests

10 participants