Swift Package Manager로 InboxKit 설정하기
iOS SDK 7.0.40부터 사용 가능합니다.
InboxKit은 Pushwoosh-XCFramework Swift 패키지 내의 별도 라이브러리 제품으로 제공됩니다. 메인 SDK가 이미 통합되어 있어야 합니다. 처음부터 시작하는 경우, 먼저 기본 통합 가이드를 따르세요.
InboxKit 패키지 제품 추가하기
Anchor link to-
Xcode에서 프로젝트를 열고 프로젝트 설정 → Package Dependencies로 이동한 다음 + 버튼을 누릅니다.
-
다음 Package URL을 입력합니다:
https://github.com/Pushwoosh/Pushwoosh-XCFramework-
Dependency Rule을 최신 안정 버전으로 Up to Next Major Version으로 설정한 다음, Add Package를 클릭합니다.
-
패키지 선택 화면에서 최소한 다음 제품을 선택하고 메인 앱 타겟에 추가합니다:
- PushwooshFramework (필수)
- PushwooshCore (필수)
- PushwooshBridge (필수)
- PushwooshInboxKit (새 모듈)

강조 표시된 네 가지 제품을 메인 앱 타겟에 추가하세요.
- 메인 앱 타겟을 열고 Frameworks, Libraries, and Embedded Content 아래에
PushwooshInboxKit.xcframework가 목록에 있고 임베드되었는지 확인합니다.
이것으로 끝입니다 — 이제 InboxKit이 메인 SDK와 함께 연결되었습니다.
인박스 표시하기
Anchor link to인박스 컨트롤러를 모든 내비게이션 플로우에 추가하세요. 기본 설정만으로도 세 가지 표준 셀 유형이 있는 작동하는 인박스를 얻을 수 있습니다:
import PushwooshInboxKit
let inboxVC = PushwooshInboxKitViewController()navigationController?.pushViewController(inboxVC, animated: true)@import PushwooshInboxKit;
PushwooshInboxKitViewController *inboxVC = [PushwooshInboxKitViewController new];[self.navigationController pushViewController:inboxVC animated:YES];인박스 사용자 정의하기
Anchor link toSwift에서는 PushwooshInboxKitAttributes 값 유형을 통해 컨트롤러를 구성합니다. Objective-C에서는 컨트롤러의 @objc 친화적인 세터를 사용합니다 — PushwooshInboxKitAttributes는 Swift 구조체이며 브리지되지 않습니다.
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"];Style 구조체는 기본 셀에서 사용하는 모든 색상, 글꼴, 모서리 반경 및 날짜 포맷터를 노출합니다. 모든 값은 기본적으로 Apple 시맨틱 색상이므로 인박스는 시스템 다크 모드에 자동으로 반응합니다.

PushwooshInboxKitAttributes.Style을 통해 사용자 정의 테마가 적용된 캡션 셀.
탭 및 새로고침 처리하기
Anchor link toPushwooshInboxKitDelegate를 준수하여 사용자 작업 및 새로고침 이벤트에 반응합니다. 모든 메서드에는 기본 구현이 있으므로 필요한 것만 재정의하면 됩니다:
final class InboxCoordinator: NSObject, PushwooshInboxKitDelegate { func inboxKit(_ vc: PushwooshInboxKitViewController, didSelect message: PWInboxMessageProtocol) -> Bool { // SDK가 메시지 URL이나 리치미디어를 열도록 하려면 true를 반환합니다. // 탭을 완전히 처리한 경우(예: 사용자 정의 화면으로 라우팅) false를 반환합니다. return true }
func inboxKit(_ vc: PushwooshInboxKitViewController, didRefreshWith messages: [PWInboxMessageProtocol], error: Error?) { // 필요한 경우 여기에 자신만의 비어 있거나 오류 상태를 표시합니다. }}
inboxVC.delegate = inboxCoordinator