mirror of
https://gh.wpcy.net/https://github.com/parcelvoy/ios-sdk.git
synced 2026-04-24 05:17:59 +08:00
20 lines
579 B
Swift
20 lines
579 B
Swift
import Foundation
|
|
|
|
public enum InAppDisplayState {
|
|
case show, skip, consume
|
|
}
|
|
|
|
public protocol InAppDelegate: AnyObject {
|
|
var autoShow: Bool { get }
|
|
func onNew(notification: ParcelvoyNotification) -> InAppDisplayState
|
|
func handle(action: InAppAction, context: [String: Any], notification: ParcelvoyNotification)
|
|
func onError(error: Error)
|
|
}
|
|
|
|
extension InAppDelegate {
|
|
public var autoShow: Bool { true }
|
|
public func onNew(notification: ParcelvoyNotification) -> InAppDisplayState {
|
|
return .show
|
|
}
|
|
public func onError(error: Error) {}
|
|
}
|