Skip to content

Commit d536526

Browse files
authored
Add an iOS app clip sample (#538)
1 parent a41cbf9 commit d536526

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1856
-0
lines changed

ios_app_clip/.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
22+
23+
# Flutter/Dart/Pub related
24+
**/doc/api/
25+
**/ios/Flutter/.last_build_id
26+
.dart_tool/
27+
.flutter-plugins
28+
.flutter-plugins-dependencies
29+
.packages
30+
.pub-cache/
31+
.pub/
32+
/build/
33+
34+
# Web related
35+
lib/generated_plugin_registrant.dart
36+
37+
# Symbolication related
38+
app.*.symbols
39+
40+
# Obfuscation related
41+
app.*.map.json

ios_app_clip/.metadata

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 65ae30c8cc99b7d48b5bd08d3726f5669b819be0
8+
channel: master
9+
10+
project_type: app

ios_app_clip/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# ios_app_clip
2+
3+
A sample project demonstrating integration with iOS 14's App Clip.
4+
5+
The App Clip target is rendered by Flutter and uses a plugin.
6+
7+
## Intent
8+
9+
1. Demonstrate it's possible to produce iOS App Clip targets rendered in Flutter.
10+
2. Serve as a canonical example to test the App Clip scenario.
11+
3. Let users validate their integration steps when following the guide at
12+
[flutter.dev/docs/development/platform-integration/ios-app-clip](https://flutter.dev/docs/development/platform-integration/ios-app-clip)
13+
14+
## To run
15+
16+
In order to run.
17+
18+
1. `cd ios`
19+
2. `pod install`
20+
3. `open Runner.xcworkspace`
21+
4. Inside Xcode, select the `AppClip` target from the scheme dropdown
22+
5. Select an iOS 14 device
23+
6. Select a development team as needed
24+
7. Press run in Xcode to run
25+
26+
## Questions/issues
27+
28+
If you have a general question about iOS App Clips in Flutter, the
29+
best places to go are:
30+
31+
* [The FlutterDev Google Group](https://groups.google.com/forum/#!forum/flutter-dev)
32+
* [The Flutter Gitter channel](https://gitter.im/flutter/flutter)
33+
* [StackOverflow](https://stackoverflow.com/questions/tagged/flutter)
34+
35+
If you run into an issue with the sample itself, please file an issue
36+
in the [main Flutter repo](https://github.com/flutter/flutter/issues).

ios_app_clip/ios/.gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
*.mode1v3
2+
*.mode2v3
3+
*.moved-aside
4+
*.pbxuser
5+
*.perspectivev3
6+
**/*sync/
7+
.sconsign.dblite
8+
.tags*
9+
**/.vagrant/
10+
**/DerivedData/
11+
Icon?
12+
**/Pods/
13+
**/.symlinks/
14+
profile
15+
xcuserdata
16+
**/.generated/
17+
Flutter/App.framework
18+
Flutter/Flutter.framework
19+
Flutter/Flutter.podspec
20+
Flutter/Generated.xcconfig
21+
Flutter/app.flx
22+
Flutter/app.zip
23+
Flutter/flutter_assets/
24+
Flutter/flutter_export_environment.sh
25+
ServiceDefinitions.json
26+
Runner/GeneratedPluginRegistrant.*
27+
28+
# Exceptions to above rules.
29+
!default.mode1v3
30+
!default.mode2v3
31+
!default.pbxuser
32+
!default.perspectivev3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.developer.associated-domains</key>
6+
<array>
7+
<string>appclips:com.example.iosAppClip</string>
8+
</array>
9+
<key>com.apple.developer.parent-application-identifiers</key>
10+
<array>
11+
<string>$(AppIdentifierPrefix)com.example.iosAppClip</string>
12+
</array>
13+
</dict>
14+
</plist>

ios_app_clip/ios/AppClip/Info.plist

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>ios_app_clip</string>
9+
<key>CFBundleExecutable</key>
10+
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>$(PRODUCT_NAME)</string>
17+
<key>CFBundlePackageType</key>
18+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>$(FLUTTER_BUILD_NAME)</string>
21+
<key>CFBundleVersion</key>
22+
<string>$(FLUTTER_BUILD_NUMBER)</string>
23+
<key>LSRequiresIPhoneOS</key>
24+
<true/>
25+
<key>NSAppClip</key>
26+
<dict>
27+
<key>NSAppClipRequestEphemeralUserNotification</key>
28+
<false/>
29+
<key>NSAppClipRequestLocationConfirmation</key>
30+
<false/>
31+
</dict>
32+
<key>UIApplicationSupportsIndirectInputEvents</key>
33+
<true/>
34+
<key>UILaunchStoryboardName</key>
35+
<string>LaunchScreen</string>
36+
<key>UIMainStoryboardFile</key>
37+
<string>Main</string>
38+
<key>UIRequiredDeviceCapabilities</key>
39+
<array>
40+
<string>armv7</string>
41+
</array>
42+
<key>UISupportedInterfaceOrientations</key>
43+
<array>
44+
<string>UIInterfaceOrientationPortrait</string>
45+
<string>UIInterfaceOrientationLandscapeLeft</string>
46+
<string>UIInterfaceOrientationLandscapeRight</string>
47+
</array>
48+
<key>UISupportedInterfaceOrientations~ipad</key>
49+
<array>
50+
<string>UIInterfaceOrientationPortrait</string>
51+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
52+
<string>UIInterfaceOrientationLandscapeLeft</string>
53+
<string>UIInterfaceOrientationLandscapeRight</string>
54+
</array>
55+
</dict>
56+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>App</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>io.flutter.flutter.app</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>App</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1.0</string>
23+
<key>MinimumOSVersion</key>
24+
<string>9.0</string>
25+
</dict>
26+
</plist>
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2+
#include "Generated.xcconfig"
3+
4+
FLUTTER_BUILD_MODE=debug
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2+
#include "Generated.xcconfig"

ios_app_clip/ios/Podfile

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
use_frameworks!
31+
use_modular_headers!
32+
33+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
34+
35+
target 'Runner'
36+
target 'AppClip'
37+
38+
post_install do |installer|
39+
installer.pods_project.targets.each do |target|
40+
flutter_additional_ios_build_settings(target)
41+
end
42+
end

ios_app_clip/ios/Podfile.lock

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
PODS:
2+
- device_info (0.0.1):
3+
- Flutter
4+
- Flutter (1.0.0)
5+
6+
DEPENDENCIES:
7+
- device_info (from `.symlinks/plugins/device_info/ios`)
8+
- Flutter (from `Flutter`)
9+
10+
EXTERNAL SOURCES:
11+
device_info:
12+
:path: ".symlinks/plugins/device_info/ios"
13+
Flutter:
14+
:path: Flutter
15+
16+
SPEC CHECKSUMS:
17+
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
18+
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
19+
20+
PODFILE CHECKSUM: bc9008ce7ae4a3c97e1769a857208392f3d51952
21+
22+
COCOAPODS: 1.10.0.beta.2

0 commit comments

Comments
 (0)