1use crate::error::StoreKitError;
2
3#[derive(Debug, Clone, PartialEq, Eq)]
4pub enum MessageReason {
6 Generic,
8 PriceIncreaseConsent,
10 BillingIssue,
12 WinBackOffer,
14 Unknown(i64),
16}
17
18#[derive(Debug, Clone, PartialEq, Eq)]
19pub struct Message {
21 pub reason: MessageReason,
23 pub localized_reason: Option<String>,
25}
26
27#[derive(Debug, Clone, Copy, Default)]
28pub struct MessageStream;
30
31impl Message {
32 pub const fn is_supported() -> bool {
34 false
35 }
36
37 pub fn messages() -> Result<MessageStream, StoreKitError> {
39 Err(StoreKitError::NotSupported(
40 "StoreKit.Message is unavailable on macOS".to_owned(),
41 ))
42 }
43}
44
45impl MessageStream {
46 #[allow(clippy::should_implement_trait)]
47 pub fn next(&mut self) -> Result<Option<Message>, StoreKitError> {
49 Err(StoreKitError::NotSupported(
50 "StoreKit.Message is unavailable on macOS".to_owned(),
51 ))
52 }
53}