Skip to content

Add an iOS app clip sample - #538

Merged
redbrogdon merged 6 commits into
flutter:masterfrom
xster:app-clip
Sep 23, 2020
Merged

redbrogdon merged 6 commits into
flutter:masterfrom
xster:app-clip

Conversation

@xster

@xster xster commented Sep 9, 2020 •

Copy link
Copy Markdown
Member

Don't know if I've crossed the threshold of acceptable scope 😅

I've made a sample to show using an App Clip target in iOS 14.

flutter/flutter#60029

@xster
xster requested a review from redbrogdon September 9, 2020 08:59

@redbrogdon redbrogdon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this repo is the right place for this. I get that the goal for the sample is that it's set up to build out of the box as an AppClip, but what's the content? Like, if you diffed this against the Counter app from flutter create, what's going to be different?

The reason I ask is that if it's not that much code, you might be better off just sticking with the guide on flutter.dev by itself.

Comment thread ios_app_clip/.metadata Outdated

version:
revision: 7e480edc7e531c400aff4f08afeebe04c0f63e2e
channel: cupertino-icon-5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have new channels?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh, fixed it to what it should have been.

Comment thread ios_app_clip/README.md
@xster

xster commented Sep 12, 2020

Copy link
Copy Markdown
Member Author

Ya, it's definitely debatable. The goal is to have an out of the box thing that builds like you're saying so we can test. Also a known working case that users can validate against after following through the guide and perhaps running into problems. It's a way to bisect the problem.

The difference with a blank flutter created template is going to be mostly in Runner.xcodeproj file. It's a bit like the prebuilt iOS host app example in add-to-app. There isn't too much code. It's A) to let you spin up an add-to-app example quickly to see it running, and to prove that it works, and B) to double check your own integration steps (which is also manual on flutter.dev). In that case too, a lot of the diff vs a blank Xcode project is in the Xcode project hook-up itself.

@xster

xster commented Sep 17, 2020

Copy link
Copy Markdown
Member Author

Gentle ping

@redbrogdon redbrogdon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to land it here. I've added a few nitpicks, but nothing significant. 😄

Comment thread ios_app_clip/lib/main.dart
Comment thread ios_app_clip/lib/main.dart Outdated
}

class MyApp extends StatelessWidget {
// This widget is the root of your application.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend cutting all of these comments rom the template. Also, consider stripping this down to just the plugin output and some kind of graphic (like a spinning Flutter logo or something).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, SG. Done

Comment thread ios_app_clip/pubspec.yaml
Comment thread ios_app_clip/test/widget_test.dart Outdated
import 'package:ios_app_clip/main.dart';

void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you revise the main page of the app, feel free to replace this with a stub test. It does need to have one, though, and get listed in /tool/travis_flutter_script.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, consider adding it to /tool/travis_ios_script.sh as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I think I did. I'm not sure I understood the travis_ios_script. Did you mean whether I had an XCTest for this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I just want it to build. We have some full integration tests for the add-to-app Android apps, but haven't had bandwidth to do anything for iOS.

);
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.example.iosAppClip.Clip;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do the ${DEVELOPMENT_TEAM} trick for this project as well?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And is this the right place, or should it be done in AppFrameworkInfo.plist? I don't actually know, and I need to update the other samples.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now realize it's probably weird to use your PR to work out my own research, but there it is. 😄

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah very good point. Done. PRODUCT_BUNDLE_IDENTIFIER is the thing to use, rather than CFBundleIdentifier.

Comment thread ios_app_clip/.metadata
@xster
xster requested a review from redbrogdon September 19, 2020 02:15
@xster

xster commented Sep 22, 2020

Copy link
Copy Markdown
Member Author

Gentle ping

@redbrogdon

Copy link
Copy Markdown
Contributor

LGTM. Adding it to the iOS test script felt like a thing to do because this app mostly exists to illustrate iOS configuration and iOS-related stuff. It's not completely necessary though. I'll have a think on it. Comments welcome in the meantime.

@redbrogdon
redbrogdon merged commit d536526 into flutter:master Sep 23, 2020
@jmagman jmagman mentioned this pull request Feb 14, 2024
5 tasks done
jmagman added a commit that referenced this pull request Feb 16, 2024
1. Run `flutter run` on the project to pick up project automigrations.
2. Set min version to iOS 16 to take advantage of the 15MB size limit
(see
flutter/flutter#71098 (comment))
3. Other updates needed to avoid Xcode errors and warnings.

First introduced in #538
See also flutter/website#10145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants