-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(sdk): channels support, cleanup
- Loading branch information
worotyns
committed
Jun 13, 2023
1 parent
f7c05dd
commit 424f819
Showing
19 changed files
with
313 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-79 Bytes
(100%)
...deproj/project.xcworkspace/xcuserdata/worotyns.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// NotificationAction.swift | ||
// PpgCoreSDK | ||
// | ||
// Created by Mateusz Worotyński on 13/06/2023. | ||
// | ||
|
||
import Foundation | ||
|
||
struct NotificationAction: Codable { | ||
let icon: String? | ||
let action: String | ||
let title: String | ||
let url: String | ||
|
||
static func fromJson(json: Data) -> [NotificationAction] { | ||
let decoder = JSONDecoder() | ||
|
||
guard let deserialized = try? decoder.decode([NotificationAction].self, from: json) else { | ||
fatalError("Failed to decode notification action from JSON") | ||
} | ||
|
||
return deserialized | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Channel.swift | ||
// PpgCoreSDK | ||
// | ||
// Created by Mateusz Worotyński on 13/06/2023. | ||
// | ||
|
||
import Foundation | ||
import UserNotifications | ||
|
||
public enum NotificationChannelType: String { | ||
case DEFAULT | ||
case DEFAULT_WITH_ACTION | ||
case DEFAULT_WITH_ACTIONS | ||
case CUSTOM | ||
} | ||
|
||
struct NotificationChannel { | ||
var name: String | ||
var sound: UNNotificationSound | ||
var actions: [String] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.