Set up InboxKit with CocoaPods
이 콘텐츠는 아직 귀하의 언어로 제공되지 않습니다.
Available since iOS SDK 7.0.40.
InboxKit ships as an optional subspec of the umbrella PushwooshXCFramework pod. You need the main SDK to be already integrated; if you are starting from scratch, follow the Basic integration guide first.
Add the InboxKit pod
Anchor link to1. Open your Podfile and add the InboxKit subspec to your app target:
target 'MyApp' do use_frameworks!
pod 'PushwooshXCFramework' pod 'PushwooshXCFramework/PushwooshInboxKit'end2. Run pod install from your project directory:
pod install3. Open the generated .xcworkspace file. InboxKit is now linked alongside the main SDK.
Show the inbox
Anchor link toAdd the inbox controller to any navigation flow. The default configuration is enough to get a working inbox with the three standard cell types:
import PushwooshInboxKit
let inboxVC = PushwooshInboxKitViewController()navigationController?.pushViewController(inboxVC, animated: true)@import PushwooshInboxKit;
PushwooshInboxKitViewController *inboxVC = [PushwooshInboxKitViewController new];[self.navigationController pushViewController:inboxVC animated:YES];Customize the inbox
Anchor link toIn Swift, configure the controller through the PushwooshInboxKitAttributes value type. In Objective-C, use the @objc-friendly setters on the controller — PushwooshInboxKitAttributes is a Swift struct and is not bridged.
var attributes = PushwooshInboxKitAttributes()attributes.pullToRefreshEnabled = trueattributes.swipeToDeleteEnabled = trueattributes.pinningEnabled = trueattributes.style.unreadBadgeColor = .systemBlueattributes.style.titleFont = .systemFont(ofSize: 17, weight: .semibold)
let inboxVC = PushwooshInboxKitViewController(attributes: attributes)PushwooshInboxKitViewController *inboxVC = [PushwooshInboxKitViewController new];[inboxVC setBackgroundColor:[UIColor systemBackgroundColor]];[inboxVC setEmptyMessage:@"You have no messages yet"];The Style struct exposes all colors, fonts, corner radii and the date formatter used by the default cells. Every value is an Apple semantic color by default, so the inbox reacts to system dark mode automatically.

Captioned cell with a custom theme applied through PushwooshInboxKitAttributes.Style.
Handle taps and refreshes
Anchor link toConform to PushwooshInboxKitDelegate to react to user actions and refresh events. Every method has a default implementation, so you only override what you need:
final class InboxCoordinator: NSObject, PushwooshInboxKitDelegate { func inboxKit(_ vc: PushwooshInboxKitViewController, didSelect message: PWInboxMessageProtocol) -> Bool { // Return true to let the SDK open the message URL or richmedia. // Return false if you handled the tap entirely (e.g. routed to a custom screen). return true }
func inboxKit(_ vc: PushwooshInboxKitViewController, didRefreshWith messages: [PWInboxMessageProtocol], error: Error?) { // Show your own empty / error state here if needed. }}
inboxVC.delegate = inboxCoordinatorThe SDK ships bulk operations as @objc methods on the controller, so you can wire them straight to a UIBarButtonItem:
let markAll = UIBarButtonItem( image: UIImage(systemName: "checkmark.circle"), style: .plain, target: inboxVC, action: #selector(PushwooshInboxKitViewController.markAllAsRead))let clearRead = UIBarButtonItem( image: UIImage(systemName: "trash"), style: .plain, target: inboxVC, action: #selector(PushwooshInboxKitViewController.clearReadMessages))inboxVC.navigationItem.rightBarButtonItems = [clearRead, markAll]