Skip to content

Commit b8cf0a7

Browse files
committed
add clear all notifications button to demo
1 parent ed3e6eb commit b8cf0a7

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

iOS_SDK/OneSignalSwiftUIExample/OneSignalSwiftUIExample/Views/Components/NotificationGrid.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ struct SendPushButtons: View {
3333
let onSimple: () -> Void
3434
let onWithImage: () -> Void
3535
let onCustom: () -> Void
36+
let onClearAll: () -> Void
3637

3738
var body: some View {
3839
VStack(spacing: 8) {
3940
ActionButton(title: "Simple", action: onSimple)
4041
ActionButton(title: "With Image", action: onWithImage)
4142
ActionButton(title: "Custom", action: onCustom)
43+
ActionButton(title: "Clear All", action: onClearAll)
4244
}
4345
}
4446
}
@@ -70,7 +72,8 @@ struct SendInAppButtons: View {
7072
SendPushButtons(
7173
onSimple: { print("Simple") },
7274
onWithImage: { print("With Image") },
73-
onCustom: { print("Custom") }
75+
onCustom: { print("Custom") },
76+
onClearAll: { print("Clear All") }
7477
)
7578

7679
Text("Send In-App Message")

iOS_SDK/OneSignalSwiftUIExample/OneSignalSwiftUIExample/Views/Sections/NotificationSection.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ struct SendPushSection: View {
4444
},
4545
onCustom: {
4646
viewModel.showingCustomNotificationSheet = true
47+
},
48+
onClearAll: {
49+
viewModel.clearAllNotifications()
4750
}
4851
)
4952
}

0 commit comments

Comments
 (0)