Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 9d32c83

Browse files
authored
[quick_actions] Extract iOS implementation into a separate package. (#4702)
1 parent 99feee9 commit 9d32c83

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

+1924
-4
lines changed

packages/quick_actions/quick_actions/pubspec.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ repository: https://github.com/flutter/plugins/tree/main/packages/quick_actions/
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+quick_actions%22
66
version: 0.6.0+9
77

8+
# Temporarily disable publishing to allow moving Android and iOS
9+
# implementations.
10+
publish_to: none
11+
812
environment:
913
sdk: ">=2.14.0 <3.0.0"
1014
flutter: ">=2.5.0"
@@ -16,11 +20,14 @@ flutter:
1620
package: io.flutter.plugins.quickactions
1721
pluginClass: QuickActionsPlugin
1822
ios:
19-
pluginClass: FLTQuickActionsPlugin
23+
default_package: quick_actions_ios
2024

2125
dependencies:
2226
flutter:
2327
sdk: flutter
28+
# Temporary path dependencies to allow moving Android and iOS implementations.
29+
quick_actions_ios:
30+
path: ../quick_actions_ios
2431
quick_actions_platform_interface: ^1.0.0
2532

2633
dev_dependencies:
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Below is a list of people and organizations that have contributed
2+
# to the Flutter project. Names should be added to the list like so:
3+
#
4+
# Name/Organization <email address>
5+
6+
Google Inc.
7+
The Chromium Authors
8+
German Saprykin <saprykin.h@gmail.com>
9+
Benjamin Sauer <sauer.benjamin@gmail.com>
10+
larsenthomasj@gmail.com
11+
Ali Bitek <alibitek@protonmail.ch>
12+
Pol Batlló <pol.batllo@gmail.com>
13+
Anatoly Pulyaevskiy
14+
Hayden Flinner <haydenflinner@gmail.com>
15+
Stefano Rodriguez <hlsroddy@gmail.com>
16+
Salvatore Giordano <salvatoregiordanoo@gmail.com>
17+
Brian Armstrong <brian@flutter.institute>
18+
Paul DeMarco <paulmdemarco@gmail.com>
19+
Fabricio Nogueira <feufeu@gmail.com>
20+
Simon Lightfoot <simon@devangels.london>
21+
Ashton Thomas <ashton@acrinta.com>
22+
Thomas Danner <thmsdnnr@gmail.com>
23+
Diego Velásquez <diego.velasquez.lopez@gmail.com>
24+
Hajime Nakamura <nkmrhj@gmail.com>
25+
Tuyển Vũ Xuân <netsoft1985@gmail.com>
26+
Miguel Ruivo <miguel@miguelruivo.com>
27+
Sarthak Verma <sarthak@artiosys.com>
28+
Mike Diarmid <mike@invertase.io>
29+
Invertase <oss@invertase.io>
30+
Elliot Hesp <elliot@invertase.io>
31+
Vince Varga <vince.varga@smaho.com>
32+
Aawaz Gyawali <awazgyawali@gmail.com>
33+
EUI Limited <ian.evans3@admiralgroup.co.uk>
34+
Katarina Sheremet <katarina@sheremet.ch>
35+
Thomas Stockx <thomas@stockxit.com>
36+
Sarbagya Dhaubanjar <sarbagyastha@gmail.com>
37+
Ozkan Eksi <ozeksi@gmail.com>
38+
Rishab Nayak <rishab@bu.edu>
39+
ko2ic <ko2ic.dev@gmail.com>
40+
Jonathan Younger <jonathan@daikini.com>
41+
Jose Sanchez <josesm82@gmail.com>
42+
Debkanchan Samadder <debu.samadder@gmail.com>
43+
Audrius Karosevicius <audrius.karosevicius@gmail.com>
44+
Lukasz Piliszczuk <lukasz@intheloup.io>
45+
SoundReply Solutions GmbH <ch@soundreply.com>
46+
Rafal Wachol <rwachol@gmail.com>
47+
Pau Picas <pau.picas@gmail.com>
48+
Christian Weder <chrstian.weder@yapeal.ch>
49+
Alexandru Tuca <salexandru.tuca@outlook.com>
50+
Christian Weder <chrstian.weder@yapeal.ch>
51+
Rhodes Davis Jr. <rody.davis.jr@gmail.com>
52+
Luigi Agosti <luigi@tengio.com>
53+
Quentin Le Guennec <quentin@tengio.com>
54+
Koushik Ravikumar <koushik@tengio.com>
55+
Nissim Dsilva <nissim@tengio.com>
56+
Giancarlo Rocha <giancarloiff@gmail.com>
57+
Ryo Miyake <ryo@miyake.id>
58+
Théo Champion <contact.theochampion@gmail.com>
59+
Kazuki Yamaguchi <y.kazuki0614n@gmail.com>
60+
Eitan Schwartz <eshvartz@gmail.com>
61+
Chris Rutkowski <chrisrutkowski89@gmail.com>
62+
Juan Alvarez <juan.alvarez@resideo.com>
63+
Aleksandr Yurkovskiy <sanekyy@gmail.com>
64+
Anton Borries <mail@antonborri.es>
65+
Alex Li <google@alexv525.com>
66+
Rahul Raj <64.rahulraj@gmail.com>
67+
Daniel Roek <daniel.roek@gmail.com>
68+
Maurits van Beusekom <maurits@baseflow.com>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
## 0.6.0+9
3+
4+
* Switches to a package-internal implementation of the platform interface.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Copyright 2013 The Flutter Authors. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above
9+
copyright notice, this list of conditions and the following
10+
disclaimer in the documentation and/or other materials provided
11+
with the distribution.
12+
* Neither the name of Google Inc. nor the names of its
13+
contributors may be used to endorse or promote products derived
14+
from this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# quick\_actions\_ios
2+
3+
The iOS implementation of [`quick_actions`][1].
4+
5+
## Usage
6+
7+
This package is [endorsed][2], which means you can simply use `quick_actions`
8+
normally. This package will be automatically included in your app when you do.
9+
10+
## Contributing
11+
12+
If you would like to contribute to the plugin, check out our [contribution guide][3].
13+
14+
[1]: https://pub.dev/packages/quick_actions
15+
[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin
16+
[3]: https://github.com/flutter/plugins/blob/master/CONTRIBUTING.md
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# quick_actions_example
2+
3+
Demonstrates how to use the quick_actions plugin.
4+
5+
## Getting Started
6+
7+
For help getting started with Flutter, view our online
8+
[documentation](https://flutter.dev/).
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'package:flutter_test/flutter_test.dart';
6+
import 'package:integration_test/integration_test.dart';
7+
import 'package:quick_actions_ios/quick_actions_ios.dart';
8+
9+
void main() {
10+
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
11+
12+
testWidgets('Can set shortcuts', (WidgetTester tester) async {
13+
final QuickActionsIos quickActions = QuickActionsIos();
14+
await quickActions.initialize((String value) {});
15+
16+
const ShortcutItem shortCutItem = ShortcutItem(
17+
type: 'action_one',
18+
localizedTitle: 'Action one',
19+
icon: 'AppIcon',
20+
);
21+
expect(
22+
quickActions.setShortcutItems(<ShortcutItem>[shortCutItem]), completes);
23+
});
24+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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>en</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>UIRequiredDeviceCapabilities</key>
24+
<array>
25+
<string>arm64</string>
26+
</array>
27+
<key>MinimumOSVersion</key>
28+
<string>9.0</string>
29+
</dict>
30+
</plist>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2+
#include "Generated.xcconfig"
Lines changed: 2 additions & 0 deletions
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"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
target 'Runner' do
31+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
32+
target 'RunnerTests' do
33+
inherit! :search_paths
34+
end
35+
end
36+
37+
post_install do |installer|
38+
installer.pods_project.targets.each do |target|
39+
flutter_additional_ios_build_settings(target)
40+
end
41+
end

0 commit comments

Comments
 (0)