Skip to content

Commit 88db428

Browse files
committed
Update Apple example for push notifications
1 parent e74194f commit 88db428

File tree

9 files changed

+352
-47
lines changed

9 files changed

+352
-47
lines changed

src/SDK/Language/Apple.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,21 @@ public function getFiles(): array
382382
'destination' => '/example-swiftui/Tests macOS/Tests_macOS.swift',
383383
'template' => '/swift/example-swiftui/Tests macOS/Tests_macOS.swift',
384384
],
385+
[
386+
'scope' => 'default',
387+
'destination' => '/example-swiftui/test (iOS).entitlements',
388+
'template' => '/swift/example-swiftui/test (iOS).entitlements',
389+
],
390+
[
391+
'scope' => 'default',
392+
'destination' => '/example-swiftui/test (tvOS).entitlements',
393+
'template' => '/swift/example-swiftui/test (tvOS).entitlements',
394+
],
395+
[
396+
'scope' => 'default',
397+
'destination' => '/example-swiftui/test (watchOS).entitlements',
398+
'template' => '/swift/example-swiftui/test (watchOS).entitlements',
399+
],
385400
// Config for project example-uikit
386401
[
387402
'scope' => 'default',

templates/swift/example-swiftui/Example.xcodeproj/project.pbxproj

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
1D54699029932DF900AAB591 /* ExampleViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D34C2522702E4A000D1DA8D /* ExampleViewModel.swift */; };
2727
1D54699129932DF900AAB591 /* ExampleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D34C2542702E4B500D1DA8D /* ExampleView.swift */; };
2828
1D54699229932E0500AAB591 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4B115883E8645C18835765B2 /* Assets.xcassets */; };
29-
1DB55D6D2B6E091400E119EF /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1DB55D6C2B6E091400E119EF /* GoogleService-Info.plist */; };
29+
1DB1714C2B84402E00318590 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 1DB1714B2B84402E00318590 /* FirebaseMessaging */; };
30+
1DB1714E2B84403C00318590 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 1DB1714D2B84403C00318590 /* FirebaseMessaging */; };
31+
1DB171502B84404500318590 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 1DB1714F2B84404500318590 /* FirebaseMessaging */; };
32+
1DB171522B84404E00318590 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 1DB171512B84404E00318590 /* FirebaseMessaging */; };
33+
1DB171592B8458B700318590 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1DB171582B8458B600318590 /* GoogleService-Info.plist */; };
3034
1DBB414827E87CA000ECF86F /* Appwrite in Frameworks */ = {isa = PBXBuildFile; productRef = 1DBB414727E87CA000ECF86F /* Appwrite */; };
3135
1DBB414A27E87CA800ECF86F /* Appwrite in Frameworks */ = {isa = PBXBuildFile; productRef = 1DBB414927E87CA800ECF86F /* Appwrite */; };
3236
2358B1EE270AC9DC0016EFBA /* ExampleViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D34C2522702E4A000D1DA8D /* ExampleViewModel.swift */; };
@@ -83,7 +87,10 @@
8387
1D43900726FC8B2500C71E3E /* ImagePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImagePicker.swift; sourceTree = "<group>"; };
8488
1D54695829932D3500AAB591 /* test (watchOS).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "test (watchOS).app"; sourceTree = BUILT_PRODUCTS_DIR; };
8589
1D54697429932D3700AAB591 /* Test watchOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Test watchOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
86-
1DB55D6C2B6E091400E119EF /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
90+
1DB171552B8457B100318590 /* test (iOS).entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "test (iOS).entitlements"; sourceTree = "<group>"; };
91+
1DB171582B8458B600318590 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
92+
1DB1715A2B845EAB00318590 /* test (tvOS).entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "test (tvOS).entitlements"; sourceTree = "<group>"; };
93+
1DB1715B2B845EB800318590 /* test (watchOS).entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "test (watchOS).entitlements"; sourceTree = "<group>"; };
8794
1DBB414627E87BDB00ECF86F /* apple */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = apple; path = ../../../examples/apple; sourceTree = "<group>"; };
8895
23DDF5922709A457006EFAFA /* ImagePicker+iOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ImagePicker+iOS.swift"; sourceTree = "<group>"; };
8996
23DDF5942709A46A006EFAFA /* ImagePicker+macOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ImagePicker+macOS.swift"; sourceTree = "<group>"; };
@@ -108,6 +115,7 @@
108115
isa = PBXFrameworksBuildPhase;
109116
buildActionMask = 2147483647;
110117
files = (
118+
1DB171502B84404500318590 /* FirebaseMessaging in Frameworks */,
111119
1D0647F92991E16D00ADFADC /* Appwrite in Frameworks */,
112120
);
113121
runOnlyForDeploymentPostprocessing = 0;
@@ -123,6 +131,7 @@
123131
isa = PBXFrameworksBuildPhase;
124132
buildActionMask = 2147483647;
125133
files = (
134+
1DB171522B84404E00318590 /* FirebaseMessaging in Frameworks */,
126135
1D54698A29932D9100AAB591 /* Appwrite in Frameworks */,
127136
);
128137
runOnlyForDeploymentPostprocessing = 0;
@@ -152,6 +161,7 @@
152161
isa = PBXFrameworksBuildPhase;
153162
buildActionMask = 2147483647;
154163
files = (
164+
1DB1714E2B84403C00318590 /* FirebaseMessaging in Frameworks */,
155165
1DBB414A27E87CA800ECF86F /* Appwrite in Frameworks */,
156166
);
157167
runOnlyForDeploymentPostprocessing = 0;
@@ -160,6 +170,7 @@
160170
isa = PBXFrameworksBuildPhase;
161171
buildActionMask = 2147483647;
162172
files = (
173+
1DB1714C2B84402E00318590 /* FirebaseMessaging in Frameworks */,
163174
1DBB414827E87CA000ECF86F /* Appwrite in Frameworks */,
164175
);
165176
runOnlyForDeploymentPostprocessing = 0;
@@ -207,7 +218,10 @@
207218
4B1152396B94D0F596CEBB52 = {
208219
isa = PBXGroup;
209220
children = (
210-
1DB55D6C2B6E091400E119EF /* GoogleService-Info.plist */,
221+
1DB1715B2B845EB800318590 /* test (watchOS).entitlements */,
222+
1DB1715A2B845EAB00318590 /* test (tvOS).entitlements */,
223+
1DB171582B8458B600318590 /* GoogleService-Info.plist */,
224+
1DB171552B8457B100318590 /* test (iOS).entitlements */,
211225
1DBB414527E87BDB00ECF86F /* Packages */,
212226
4B115B49441350FF784C7745 /* Products */,
213227
4B11566FD1E1FA1ABD88E438 /* Shared */,
@@ -305,6 +319,7 @@
305319
name = "test (tvOS)";
306320
packageProductDependencies = (
307321
1D0647F82991E16D00ADFADC /* Appwrite */,
322+
1DB1714F2B84404500318590 /* FirebaseMessaging */,
308323
);
309324
productName = Test;
310325
productReference = 1D0647BD2991E01C00ADFADC /* test (tvOS).app */;
@@ -343,6 +358,7 @@
343358
name = "test (watchOS)";
344359
packageProductDependencies = (
345360
1D54698929932D9100AAB591 /* Appwrite */,
361+
1DB171512B84404E00318590 /* FirebaseMessaging */,
346362
);
347363
productName = "test Watch App";
348364
productReference = 1D54695829932D3500AAB591 /* test (watchOS).app */;
@@ -381,6 +397,7 @@
381397
name = "test (iOS)";
382398
packageProductDependencies = (
383399
1DBB414727E87CA000ECF86F /* Appwrite */,
400+
1DB1714B2B84402E00318590 /* FirebaseMessaging */,
384401
);
385402
productName = "test (iOS)";
386403
productReference = 4B115DA4916DAA4E8F13734F /* test.app */;
@@ -401,6 +418,7 @@
401418
name = "test (macOS)";
402419
packageProductDependencies = (
403420
1DBB414927E87CA800ECF86F /* Appwrite */,
421+
1DB1714D2B84403C00318590 /* FirebaseMessaging */,
404422
);
405423
productName = "test (macOS)";
406424
productReference = 4B11505C9899942E695B59FF /* test.app */;
@@ -481,6 +499,9 @@
481499
en,
482500
);
483501
mainGroup = 4B1152396B94D0F596CEBB52;
502+
packageReferences = (
503+
1DB171482B84400300318590 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
504+
);
484505
productRefGroup = 4B115B49441350FF784C7745 /* Products */;
485506
projectDirPath = "";
486507
projectRoot = "";
@@ -548,7 +569,7 @@
548569
buildActionMask = 2147483647;
549570
files = (
550571
4B1157C67CF5E569FBCB65DD /* Assets.xcassets in Resources */,
551-
1DB55D6D2B6E091400E119EF /* GoogleService-Info.plist in Resources */,
572+
1DB171592B8458B700318590 /* GoogleService-Info.plist in Resources */,
552573
);
553574
runOnlyForDeploymentPostprocessing = 0;
554575
};
@@ -675,6 +696,7 @@
675696
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
676697
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
677698
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
699+
CODE_SIGN_ENTITLEMENTS = "test (tvOS).entitlements";
678700
CODE_SIGN_STYLE = Automatic;
679701
CURRENT_PROJECT_VERSION = 1;
680702
ENABLE_PREVIEWS = YES;
@@ -702,6 +724,7 @@
702724
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
703725
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
704726
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
727+
CODE_SIGN_ENTITLEMENTS = "test (tvOS).entitlements";
705728
CODE_SIGN_STYLE = Automatic;
706729
CURRENT_PROJECT_VERSION = 1;
707730
ENABLE_PREVIEWS = YES;
@@ -771,6 +794,7 @@
771794
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
772795
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
773796
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
797+
CODE_SIGN_ENTITLEMENTS = "test (watchOS).entitlements";
774798
CODE_SIGN_STYLE = Automatic;
775799
CURRENT_PROJECT_VERSION = 1;
776800
ENABLE_PREVIEWS = YES;
@@ -800,6 +824,7 @@
800824
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
801825
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
802826
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
827+
CODE_SIGN_ENTITLEMENTS = "test (watchOS).entitlements";
803828
CODE_SIGN_STYLE = Automatic;
804829
CURRENT_PROJECT_VERSION = 1;
805830
ENABLE_PREVIEWS = YES;
@@ -905,7 +930,10 @@
905930
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
906931
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
907932
CODE_SIGN_ENTITLEMENTS = macOS/macOS.entitlements;
933+
CODE_SIGN_IDENTITY = "Apple Development";
934+
CODE_SIGN_STYLE = Automatic;
908935
COMBINE_HIDPI_IMAGES = YES;
936+
DEVELOPMENT_TEAM = GWZ23QTYB5;
909937
ENABLE_PREVIEWS = YES;
910938
INFOPLIST_FILE = macOS/Info.plist;
911939
LD_RUNPATH_SEARCH_PATHS = (
@@ -915,6 +943,7 @@
915943
MACOSX_DEPLOYMENT_TARGET = 11.0;
916944
PRODUCT_BUNDLE_IDENTIFIER = io.appwrite.mac;
917945
PRODUCT_NAME = test;
946+
PROVISIONING_PROFILE_SPECIFIER = "";
918947
SDKROOT = macosx;
919948
SWIFT_VERSION = 5.0;
920949
};
@@ -925,14 +954,16 @@
925954
buildSettings = {
926955
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
927956
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
957+
CODE_SIGN_ENTITLEMENTS = "test (iOS).entitlements";
958+
DEVELOPMENT_TEAM = GWZ23QTYB5;
928959
ENABLE_PREVIEWS = YES;
929960
INFOPLIST_FILE = iOS/Info.plist;
930-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
961+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
931962
LD_RUNPATH_SEARCH_PATHS = (
932963
"$(inherited)",
933964
"@executable_path/Frameworks",
934965
);
935-
PRODUCT_BUNDLE_IDENTIFIER = io.appwrite.ios;
966+
PRODUCT_BUNDLE_IDENTIFIER = "io.appwrite.ios-example";
936967
PRODUCT_NAME = test;
937968
SDKROOT = iphoneos;
938969
SWIFT_VERSION = 5.0;
@@ -963,14 +994,16 @@
963994
buildSettings = {
964995
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
965996
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
997+
CODE_SIGN_ENTITLEMENTS = "test (iOS).entitlements";
998+
DEVELOPMENT_TEAM = GWZ23QTYB5;
966999
ENABLE_PREVIEWS = YES;
9671000
INFOPLIST_FILE = iOS/Info.plist;
968-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
1001+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
9691002
LD_RUNPATH_SEARCH_PATHS = (
9701003
"$(inherited)",
9711004
"@executable_path/Frameworks",
9721005
);
973-
PRODUCT_BUNDLE_IDENTIFIER = io.appwrite.ios;
1006+
PRODUCT_BUNDLE_IDENTIFIER = "io.appwrite.ios-example";
9741007
PRODUCT_NAME = test;
9751008
SDKROOT = iphoneos;
9761009
SWIFT_VERSION = 5.0;
@@ -984,7 +1017,10 @@
9841017
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
9851018
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
9861019
CODE_SIGN_ENTITLEMENTS = macOS/macOS.entitlements;
1020+
CODE_SIGN_IDENTITY = "Apple Development";
1021+
CODE_SIGN_STYLE = Automatic;
9871022
COMBINE_HIDPI_IMAGES = YES;
1023+
DEVELOPMENT_TEAM = GWZ23QTYB5;
9881024
ENABLE_PREVIEWS = YES;
9891025
INFOPLIST_FILE = macOS/Info.plist;
9901026
LD_RUNPATH_SEARCH_PATHS = (
@@ -994,6 +1030,7 @@
9941030
MACOSX_DEPLOYMENT_TARGET = 11.0;
9951031
PRODUCT_BUNDLE_IDENTIFIER = io.appwrite.mac;
9961032
PRODUCT_NAME = test;
1033+
PROVISIONING_PROFILE_SPECIFIER = "";
9971034
SDKROOT = macosx;
9981035
SWIFT_VERSION = 5.0;
9991036
};
@@ -1213,6 +1250,17 @@
12131250
};
12141251
/* End XCConfigurationList section */
12151252

1253+
/* Begin XCRemoteSwiftPackageReference section */
1254+
1DB171482B84400300318590 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */ = {
1255+
isa = XCRemoteSwiftPackageReference;
1256+
repositoryURL = "https://github.com/firebase/firebase-ios-sdk";
1257+
requirement = {
1258+
kind = upToNextMajorVersion;
1259+
minimumVersion = 10.21.0;
1260+
};
1261+
};
1262+
/* End XCRemoteSwiftPackageReference section */
1263+
12161264
/* Begin XCSwiftPackageProductDependency section */
12171265
1D0647F82991E16D00ADFADC /* Appwrite */ = {
12181266
isa = XCSwiftPackageProductDependency;
@@ -1222,6 +1270,26 @@
12221270
isa = XCSwiftPackageProductDependency;
12231271
productName = Appwrite;
12241272
};
1273+
1DB1714B2B84402E00318590 /* FirebaseMessaging */ = {
1274+
isa = XCSwiftPackageProductDependency;
1275+
package = 1DB171482B84400300318590 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
1276+
productName = FirebaseMessaging;
1277+
};
1278+
1DB1714D2B84403C00318590 /* FirebaseMessaging */ = {
1279+
isa = XCSwiftPackageProductDependency;
1280+
package = 1DB171482B84400300318590 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
1281+
productName = FirebaseMessaging;
1282+
};
1283+
1DB1714F2B84404500318590 /* FirebaseMessaging */ = {
1284+
isa = XCSwiftPackageProductDependency;
1285+
package = 1DB171482B84400300318590 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
1286+
productName = FirebaseMessaging;
1287+
};
1288+
1DB171512B84404E00318590 /* FirebaseMessaging */ = {
1289+
isa = XCSwiftPackageProductDependency;
1290+
package = 1DB171482B84400300318590 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
1291+
productName = FirebaseMessaging;
1292+
};
12251293
1DBB414727E87CA000ECF86F /* Appwrite */ = {
12261294
isa = XCSwiftPackageProductDependency;
12271295
productName = Appwrite;

0 commit comments

Comments
 (0)