Skip to content

Commit 24e2393

Browse files
Adding topic function to messaging test app (#5505)
1 parent fbd7847 commit 24e2393

23 files changed

+194
-43
lines changed

FirebaseMessaging/Apps/Sample/Sample.xcodeproj/project.pbxproj

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 51;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -16,6 +16,8 @@
1616
5125CCAC2437F472006CA5D0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5125CCAA2437F472006CA5D0 /* LaunchScreen.storyboard */; };
1717
5126B5F0244F87D800C5A2CD /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5126B5EF244F87D800C5A2CD /* GoogleService-Info.plist */; };
1818
513771F2243BE5DE004503C3 /* Identity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 513771F1243BE5DE004503C3 /* Identity.swift */; };
19+
51C544FB2457A86E0093D292 /* TopicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51C544FA2457A86E0093D292 /* TopicView.swift */; };
20+
51C545122458E9A60093D292 /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 51C545112458E9A60093D292 /* logo.png */; };
1921
51D4B021244684B4001A87BB /* UserSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51D4B020244684B4001A87BB /* UserSettings.swift */; };
2022
/* End PBXBuildFile section */
2123

@@ -32,6 +34,8 @@
3234
5125CCB32437F9A9006CA5D0 /* Sample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Sample.entitlements; sourceTree = "<group>"; };
3335
5126B5EF244F87D800C5A2CD /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
3436
513771F1243BE5DE004503C3 /* Identity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Identity.swift; sourceTree = "<group>"; };
37+
51C544FA2457A86E0093D292 /* TopicView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopicView.swift; sourceTree = "<group>"; };
38+
51C545112458E9A60093D292 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = "<group>"; };
3539
51D4B020244684B4001A87BB /* UserSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSettings.swift; sourceTree = "<group>"; };
3640
/* End PBXFileReference section */
3741

@@ -84,7 +88,9 @@
8488
5125CCA02437F471006CA5D0 /* Sample.xcdatamodeld */,
8589
513771F1243BE5DE004503C3 /* Identity.swift */,
8690
51D4B020244684B4001A87BB /* UserSettings.swift */,
91+
51C545112458E9A60093D292 /* logo.png */,
8792
5125CCA72437F472006CA5D0 /* Preview Content */,
93+
51C544FA2457A86E0093D292 /* TopicView.swift */,
8894
);
8995
path = Sample;
9096
sourceTree = "<group>";
@@ -155,6 +161,7 @@
155161
isa = PBXResourcesBuildPhase;
156162
buildActionMask = 2147483647;
157163
files = (
164+
51C545122458E9A60093D292 /* logo.png in Resources */,
158165
5125CCAC2437F472006CA5D0 /* LaunchScreen.storyboard in Resources */,
159166
5126B5F0244F87D800C5A2CD /* GoogleService-Info.plist in Resources */,
160167
5125CCA92437F472006CA5D0 /* Preview Assets.xcassets in Resources */,
@@ -174,6 +181,7 @@
174181
5125CC9D2437F471006CA5D0 /* AppDelegate.swift in Sources */,
175182
513771F2243BE5DE004503C3 /* Identity.swift in Sources */,
176183
5125CCA42437F471006CA5D0 /* ContentView.swift in Sources */,
184+
51C544FB2457A86E0093D292 /* TopicView.swift in Sources */,
177185
5125CC9F2437F471006CA5D0 /* SceneDelegate.swift in Sources */,
178186
);
179187
runOnlyForDeploymentPostprocessing = 0;

FirebaseMessaging/Apps/Sample/Sample/AppDelegate.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
2323
FirebaseApp.configure()
2424

2525
let center = UNUserNotificationCenter.current()
26+
center.delegate = self
27+
2628
center.requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
2729
if error != nil {
2830
print("Failed requesting notification permission: ", error ?? "")
@@ -32,6 +34,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
3234
return true
3335
}
3436

37+
// Implement this to display notification when app is in foreground.
38+
func userNotificationCenter(_ center: UNUserNotificationCenter,
39+
willPresent notification: UNNotification,
40+
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions)
41+
-> Void) {
42+
completionHandler([.alert, .sound])
43+
}
44+
3545
// MARK: UISceneSession Lifecycle
3646

3747
func application(_ application: UIApplication,

FirebaseMessaging/Apps/Sample/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json

100644100755
Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,117 @@
11
{
22
"images" : [
33
{
4-
"idiom" : "iphone",
54
"size" : "20x20",
5+
"idiom" : "iphone",
6+
"filename" : "[email protected]",
67
"scale" : "2x"
78
},
89
{
9-
"idiom" : "iphone",
1010
"size" : "20x20",
11+
"idiom" : "iphone",
12+
"filename" : "[email protected]",
1113
"scale" : "3x"
1214
},
1315
{
16+
"size" : "29x29",
1417
"idiom" : "iphone",
18+
"filename" : "[email protected]",
19+
"scale" : "1x"
20+
},
21+
{
1522
"size" : "29x29",
23+
"idiom" : "iphone",
24+
"filename" : "[email protected]",
1625
"scale" : "2x"
1726
},
1827
{
19-
"idiom" : "iphone",
2028
"size" : "29x29",
29+
"idiom" : "iphone",
30+
"filename" : "[email protected]",
2131
"scale" : "3x"
2232
},
2333
{
24-
"idiom" : "iphone",
2534
"size" : "40x40",
35+
"idiom" : "iphone",
36+
"filename" : "[email protected]",
2637
"scale" : "2x"
2738
},
2839
{
29-
"idiom" : "iphone",
3040
"size" : "40x40",
41+
"idiom" : "iphone",
42+
"filename" : "[email protected]",
3143
"scale" : "3x"
3244
},
3345
{
34-
"idiom" : "iphone",
3546
"size" : "60x60",
47+
"idiom" : "iphone",
48+
"filename" : "[email protected]",
3649
"scale" : "2x"
3750
},
3851
{
39-
"idiom" : "iphone",
4052
"size" : "60x60",
53+
"idiom" : "iphone",
54+
"filename" : "[email protected]",
4155
"scale" : "3x"
4256
},
4357
{
44-
"idiom" : "ipad",
4558
"size" : "20x20",
59+
"idiom" : "ipad",
60+
"filename" : "[email protected]",
4661
"scale" : "1x"
4762
},
4863
{
49-
"idiom" : "ipad",
5064
"size" : "20x20",
65+
"idiom" : "ipad",
66+
"filename" : "[email protected]",
5167
"scale" : "2x"
5268
},
5369
{
54-
"idiom" : "ipad",
5570
"size" : "29x29",
71+
"idiom" : "ipad",
72+
"filename" : "[email protected]",
5673
"scale" : "1x"
5774
},
5875
{
59-
"idiom" : "ipad",
6076
"size" : "29x29",
77+
"idiom" : "ipad",
78+
"filename" : "[email protected]",
6179
"scale" : "2x"
6280
},
6381
{
64-
"idiom" : "ipad",
6582
"size" : "40x40",
83+
"idiom" : "ipad",
84+
"filename" : "[email protected]",
6685
"scale" : "1x"
6786
},
6887
{
69-
"idiom" : "ipad",
7088
"size" : "40x40",
89+
"idiom" : "ipad",
90+
"filename" : "[email protected]",
7191
"scale" : "2x"
7292
},
7393
{
74-
"idiom" : "ipad",
7594
"size" : "76x76",
95+
"idiom" : "ipad",
96+
"filename" : "[email protected]",
7697
"scale" : "1x"
7798
},
7899
{
79-
"idiom" : "ipad",
80100
"size" : "76x76",
101+
"idiom" : "ipad",
102+
"filename" : "[email protected]",
81103
"scale" : "2x"
82104
},
83105
{
84-
"idiom" : "ipad",
85106
"size" : "83.5x83.5",
107+
"idiom" : "ipad",
108+
"filename" : "[email protected]",
86109
"scale" : "2x"
87110
},
88111
{
89-
"idiom" : "ios-marketing",
90112
"size" : "1024x1024",
113+
"idiom" : "ios-marketing",
114+
"filename" : "[email protected]",
91115
"scale" : "1x"
92116
}
93117
],
1007 Bytes
Loading
2.47 KB
Loading
4.13 KB
Loading
1.57 KB
Loading
3.95 KB
Loading
6.35 KB
Loading
2.47 KB
Loading

0 commit comments

Comments
 (0)