Ionic App Inbox Messages

Get App Inbox Messages

const result = await this.reteno.getAppInboxMessages({
  page: 1,
  pageSize: 20,
  status: 'UNOPENED', // optional: 'OPENED' | 'UNOPENED'
});

console.log(result.messages, result.totalPages);

Returns AppInboxMessages: { messages: AppInboxMessage[], totalPages: number }. Each AppInboxMessage contains:

type AppInboxMessage = {
  id: string;
  title: string;
  createdDate: string;
  isNewMessage: boolean;
  content?: string | null;
  imageUrl?: string | null;
  linkUrl?: string | null;
  category?: string | null;
  status?: 'OPENED' | 'UNOPENED' | null;
  customData?: Record<string, string> | null;
};

Get Unread Messages Count

const count = await this.reteno.getAppInboxMessagesCount();
console.log('Unread messages:', count);

Subscribe to Count Changes

this.reteno.subscribeOnMessagesCountChanged().subscribe({
  next: (count) => console.log('App Inbox count changed:', count),
  error: (err) => console.error('subscribeOnMessagesCountChanged:', err),
});

// later
await this.reteno.unsubscribeMessagesCountChanged();

Mark Message as Opened

await this.reteno.markAsOpened('message-id');

Mark All Messages as Opened

await this.reteno.markAllMessagesAsOpened();