-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add App Clip to Demo project #659
base: trunk
Are you sure you want to change the base?
Conversation
This is only to show a screenshot of the App Clip running on my device that is obviously the one in this codebase.
I run into an issue testing the prototype build automation and before trying to debug it, I thought I'd make sure we're on the latest tooling.
For consistency with where the App Clip entitlements file is, that is.
62ad28b
to
c11c843
Compare
# rubocop:disable Metrics/AbcSize | ||
# rubocop:disable Metrics/CyclomaticComplexity | ||
def remove_app_clip_dependency! | ||
project_path = XCODEPROJ_PATH | ||
project = Xcodeproj::Project.open(project_path) | ||
|
||
native_targets = project.targets.select { |t| t.is_a?(Xcodeproj::Project::Object::PBXNativeTarget) } | ||
app_targets = native_targets.select { |t| t.product_type == 'com.apple.product-type.application' } | ||
app_clip_targets = native_targets.select { |t| t.product_type == 'com.apple.product-type.application.on-demand-install-capable' } | ||
|
||
if app_clip_targets.empty? | ||
UI.user_error!("No on-demand-install-capable targets found in #{project_path}. Has something changed in the project structure? Aborting App Clips removal.") | ||
end | ||
|
||
app_targets.each do |app| | ||
# Delete any dependency of the app target that is an app_clip target | ||
app.dependencies.delete_if { |dep| app_clip_targets.include?(dep.target) } | ||
# Delete the "Embed App Clips" build phase | ||
app.build_phases.delete_if { |b| b.display_name == 'Embed App Clips' } | ||
end | ||
|
||
UI.message('Saving the project file....') | ||
project.save | ||
|
||
UI.success('Dependency successfuly removed.') | ||
end | ||
# rubocop:enable Metrics/AbcSize | ||
# rubocop:enable Metrics/CyclomaticComplexity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicated from Pocket Casts. We might want to centralize at the release toolkit level, see wordpress-mobile/release-toolkit#629
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, the original development profile is for an Enterprise app, which doesn't support App Clips. Thanks for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mokagio given that's the second repo/app for which we need to do that trick (removing AppClip for Enterprise / Prototype builds to compile), worth P2-ing about it for future reference?
NVM, I missed your comment above suggesting to centralize this at the release-toolkit
level, which would indeed be an even better idea 👍
|
App Name | ||
Build Number | 2119 | |
Version | 1.0 | |
Bundle ID | com.automattic.gravatar-sdk-demo-uikit.prototype-build | |
Commit | b17a5fd | |
App Center Build | Gravatar SDK Demo - UIKit #603 |
Thank you very much! This is very useful for us. I won't merge it for now as this effort might move to a separate repo. |
@mokagio The app clip target works fine but this time, I can't get the old demo app target to build in this branch. I get the error: |
Also, we need to test OAuth in the app clip target so we'll need this config. Does this require updating the provisioning profile also? @mokagio
|
Ah, yes, I believe it does. Apologies, I didn't consider that when I opened the request. Thanks for catching it. |
51b5a1a addresses this. The app clip already had the associated domains capability because of the |
This will make it clearer that they are shared once we'll read them from the app clip extension, too.
Generated by 🚫 Danger |
Internal ref pdnsEh-21E-p2
Description
Testing Steps
Checkout this branch and run the debug build on device.
Here's a screenshot from mine:
Where to go from here
For @andrewdmontgomery @pinarol & team to
@Automattic/apps-infrastructure
know whether to set up TestFlight distribution to test the App Clip without having to deploy the app on device. That will require a bunch of Fastlane updates, so I didn't go down that path in the context of this PR.