Skip to content

Commit 165d2ab

Browse files
feat(messaging): Swift Package Manager support (#13205) (#16786)
Co-authored-by: Russell Wheatley <[email protected]>
1 parent 56051cf commit 165d2ab

File tree

26 files changed

+363
-45
lines changed

26 files changed

+363
-45
lines changed

.github/workflows/all_plugins.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ jobs:
126126
runs-on: macos-latest
127127
timeout-minutes: 30
128128
env:
129-
FLUTTER_DEPENDENCIES: "cloud_firestore firebase_remote_config cloud_functions firebase_database firebase_auth firebase_storage firebase_analytics"
129+
FLUTTER_DEPENDENCIES: "cloud_firestore firebase_remote_config cloud_functions firebase_database firebase_auth firebase_storage firebase_analytics firebase_messaging"
130130
steps:
131131
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
132132
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225

packages/firebase_messaging/firebase_messaging/example/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
1113

1214
# IntelliJ related
1315
*.iml

packages/firebase_messaging/firebase_messaging/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

packages/firebase_messaging/firebase_messaging/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1717
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
1818
F2D5D8600D3E9C26CB50CF29 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4033173012D0F59DEEBA9825 /* GoogleService-Info.plist */; };
19+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
1920
/* End PBXBuildFile section */
2021

2122
/* Begin PBXCopyFilesBuildPhase section */
@@ -59,6 +60,7 @@
5960
isa = PBXFrameworksBuildPhase;
6061
buildActionMask = 2147483647;
6162
files = (
63+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
6264
00E92990C987F9E25B63A112 /* Pods_Runner.framework in Frameworks */,
6365
);
6466
runOnlyForDeploymentPostprocessing = 0;
@@ -144,6 +146,9 @@
144146

145147
/* Begin PBXNativeTarget section */
146148
97C146ED1CF9000F007C117D /* Runner */ = {
149+
packageProductDependencies = (
150+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
151+
);
147152
isa = PBXNativeTarget;
148153
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
149154
buildPhases = (
@@ -169,9 +174,12 @@
169174

170175
/* Begin PBXProject section */
171176
97C146E61CF9000F007C117D /* Project object */ = {
177+
packageReferences = (
178+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
179+
);
172180
isa = PBXProject;
173181
attributes = {
174-
LastUpgradeCheck = 1300;
182+
LastUpgradeCheck = 1510;
175183
ORGANIZATIONNAME = "";
176184
TargetAttributes = {
177185
97C146ED1CF9000F007C117D = {
@@ -254,10 +262,12 @@
254262
};
255263
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
256264
isa = PBXShellScriptBuildPhase;
265+
alwaysOutOfDate = 1;
257266
buildActionMask = 2147483647;
258267
files = (
259268
);
260269
inputPaths = (
270+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
261271
);
262272
name = "Thin Binary";
263273
outputPaths = (
@@ -268,6 +278,7 @@
268278
};
269279
9740EEB61CF901F6004384FC /* Run Script */ = {
270280
isa = PBXShellScriptBuildPhase;
281+
alwaysOutOfDate = 1;
271282
buildActionMask = 2147483647;
272283
files = (
273284
);
@@ -593,6 +604,18 @@
593604
defaultConfigurationName = Release;
594605
};
595606
/* End XCConfigurationList section */
607+
/* Begin XCLocalSwiftPackageReference section */
608+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
609+
isa = XCLocalSwiftPackageReference;
610+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
611+
};
612+
/* End XCLocalSwiftPackageReference section */
613+
/* Begin XCSwiftPackageProductDependency section */
614+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
615+
isa = XCSwiftPackageProductDependency;
616+
productName = FlutterGeneratedPluginSwiftPackage;
617+
};
618+
/* End XCSwiftPackageProductDependency section */
596619
};
597620
rootObject = 97C146E61CF9000F007C117D /* Project object */;
598621
}

packages/firebase_messaging/firebase_messaging/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1300"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<PreActions>
9+
<ExecutionAction
10+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
11+
<ActionContent
12+
title = "Run Prepare Flutter Framework Script"
13+
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
14+
<EnvironmentBuildable>
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
18+
BuildableName = "Firebase Cloud Messaging Example.app"
19+
BlueprintName = "Runner"
20+
ReferencedContainer = "container:Runner.xcodeproj">
21+
</BuildableReference>
22+
</EnvironmentBuildable>
23+
</ActionContent>
24+
</ExecutionAction>
25+
</PreActions>
826
<BuildActionEntries>
927
<BuildActionEntry
1028
buildForTesting = "YES"

packages/firebase_messaging/firebase_messaging/example/ios/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,7 @@
4848
<false/>
4949
<key>CADisableMinimumFrameDurationOnPhone</key>
5050
<true/>
51+
<key>UIApplicationSupportsIndirectInputEvents</key>
52+
<true/>
5153
</dict>
5254
</plist>

packages/firebase_messaging/firebase_messaging/example/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
2727
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
2828
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
29+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; };
2930
B550B1FC23F53648007DADD5 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = B550B1FB23F53648007DADD5 /* GoogleService-Info.plist */; };
3031
B6036D992F5B77F0D48D7883 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1026236A547BC5196614E954 /* Pods_Runner.framework */; };
3132
/* End PBXBuildFile section */
@@ -83,6 +84,7 @@
8384
isa = PBXFrameworksBuildPhase;
8485
buildActionMask = 2147483647;
8586
files = (
87+
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
8688
B6036D992F5B77F0D48D7883 /* Pods_Runner.framework in Frameworks */,
8789
);
8890
runOnlyForDeploymentPostprocessing = 0;
@@ -196,6 +198,9 @@
196198
33CC11202044C79F0003C045 /* PBXTargetDependency */,
197199
);
198200
name = Runner;
201+
packageProductDependencies = (
202+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */,
203+
);
199204
productName = Runner;
200205
productReference = 33CC10ED2044A3C60003C045 /* Firebase Cloud Messaging Example.app */;
201206
productType = "com.apple.product-type.application";
@@ -207,7 +212,7 @@
207212
isa = PBXProject;
208213
attributes = {
209214
LastSwiftUpdateCheck = 0920;
210-
LastUpgradeCheck = 1430;
215+
LastUpgradeCheck = 1510;
211216
ORGANIZATIONNAME = "The Flutter Authors";
212217
TargetAttributes = {
213218
33CC10EC2044A3C60003C045 = {
@@ -235,6 +240,9 @@
235240
Base,
236241
);
237242
mainGroup = 33CC10E42044A3C60003C045;
243+
packageReferences = (
244+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
245+
);
238246
productRefGroup = 33CC10EE2044A3C60003C045 /* Products */;
239247
projectDirPath = "";
240248
projectRoot = "";
@@ -326,27 +334,11 @@
326334
);
327335
inputPaths = (
328336
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
329-
"${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework",
330-
"${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.framework",
331-
"${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework",
332-
"${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework",
333-
"${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework",
334-
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
335-
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
336337
"${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework",
337-
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
338338
);
339339
name = "[CP] Embed Pods Frameworks";
340340
outputPaths = (
341-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework",
342-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreInternal.framework",
343-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework",
344-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework",
345-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework",
346-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
347-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
348341
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework",
349-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
350342
);
351343
runOnlyForDeploymentPostprocessing = 0;
352344
shellPath = /bin/sh;
@@ -581,7 +573,7 @@
581573
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
582574
CODE_SIGN_STYLE = Automatic;
583575
COMBINE_HIDPI_IMAGES = YES;
584-
DEVELOPMENT_TEAM = YMA4Y8JWM2;
576+
DEVELOPMENT_TEAM = YYX2P3XVJ7;
585577
FRAMEWORK_SEARCH_PATHS = (
586578
"$(inherited)",
587579
"$(PROJECT_DIR)/Flutter/ephemeral",
@@ -607,10 +599,10 @@
607599
CLANG_ENABLE_MODULES = YES;
608600
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
609601
CODE_SIGN_IDENTITY = "Apple Development";
610-
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
602+
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
611603
CODE_SIGN_STYLE = Automatic;
612604
COMBINE_HIDPI_IMAGES = YES;
613-
DEVELOPMENT_TEAM = YMA4Y8JWM2;
605+
DEVELOPMENT_TEAM = "";
614606
FRAMEWORK_SEARCH_PATHS = (
615607
"$(inherited)",
616608
"$(PROJECT_DIR)/Flutter/ephemeral",
@@ -677,6 +669,20 @@
677669
defaultConfigurationName = Release;
678670
};
679671
/* End XCConfigurationList section */
672+
673+
/* Begin XCLocalSwiftPackageReference section */
674+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
675+
isa = XCLocalSwiftPackageReference;
676+
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
677+
};
678+
/* End XCLocalSwiftPackageReference section */
679+
680+
/* Begin XCSwiftPackageProductDependency section */
681+
78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = {
682+
isa = XCSwiftPackageProductDependency;
683+
productName = FlutterGeneratedPluginSwiftPackage;
684+
};
685+
/* End XCSwiftPackageProductDependency section */
680686
};
681687
rootObject = 33CC10E52044A3C60003C045 /* Project object */;
682688
}

packages/firebase_messaging/firebase_messaging/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1430"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
8+
<PreActions>
9+
<ExecutionAction
10+
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
11+
<ActionContent
12+
title = "Run Prepare Flutter Framework Script"
13+
scriptText = "&quot;$FLUTTER_ROOT&quot;/packages/flutter_tools/bin/macos_assemble.sh prepare&#10;">
14+
<EnvironmentBuildable>
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
18+
BuildableName = "Firebase Cloud Messaging Example.app"
19+
BlueprintName = "Runner"
20+
ReferencedContainer = "container:Runner.xcodeproj">
21+
</BuildableReference>
22+
</EnvironmentBuildable>
23+
</ActionContent>
24+
</ExecutionAction>
25+
</PreActions>
826
<BuildActionEntries>
927
<BuildActionEntry
1028
buildForTesting = "YES"
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import Cocoa
22
import FlutterMacOS
33

4-
@NSApplicationMain
4+
@main
55
class AppDelegate: FlutterAppDelegate {
66
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
77
return true
88
}
9+
10+
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
11+
return true
12+
}
913
}
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
4-
<dict>
5-
<key>com.apple.developer.aps-environment</key>
6-
<string>development</string>
7-
<key>com.apple.security.app-sandbox</key>
8-
<true/>
9-
<key>com.apple.security.network.client</key>
10-
<true/>
11-
</dict>
4+
<dict/>
125
</plist>

0 commit comments

Comments
 (0)