iOS SDK 7.0+ 빠른 시작
이 빠르고 간단한 예제를 사용하여 Pushwoosh iOS SDK를 시작하세요.
iOS SDK 7.0+의 새로운 기능
Anchor link to버전 7.0부터 Pushwoosh iOS SDK는 완전한 모듈식 아키텍처로 재설계되었습니다. 이제 SDK는 별도의 모듈로 분리됩니다: 기본 통합에는 PushwooshFramework, PushwooshCore, PushwooshBridge, PushwooshLiveActivities가 필요하며, PushwooshForegroundPush, PushwooshVoIP, PushwooshTVOS는 필요에 따라 선택적으로 추가할 수 있습니다.
이 모듈식 접근 방식을 사용하면 앱에서 실제로 사용하는 기능만 포함할 수 있으므로 최종 바이너리 크기를 줄이고 빌드 시간을 개선할 수 있습니다. 각 모듈은 독립적으로 업데이트할 수 있어 나머지 통합에 영향을 주지 않고 새로운 기능을 더 쉽게 채택할 수 있습니다.
이번 릴리스에서는 더 쉬운 종속성 관리를 위한 네이티브 Swift Package Manager 지원과 모든 모듈에 걸친 향상된 Swift 상호 운용성을 소개합니다. 이제 문서는 바이너리 프레임워크에 직접 내장되어 있어 Xcode의 Quick Help 및 Developer Documentation 창을 통해 API 참조 및 코드 예제에 바로 액세스할 수 있습니다. 새로운 기능으로는 Dynamic Island 통합이 포함된 iOS 16+ Live Activities 전체 지원, 애니메이션 배너 및 햅틱 피드백이 포함된 사용자 정의 가능한 포그라운드 푸시 알림, 향상된 VoIP 기능, Apple TV 애플리케이션을 위한 전용 tvOS 모듈이 있습니다.
전제 조건
Anchor link toPushwoosh iOS SDK를 앱에 통합하려면 다음이 필요합니다:
예제 프로젝트 다운로드
Anchor link toGitHub에서 예제 프로젝트를 클론합니다:
git clone https://github.com/Pushwoosh/pushwoosh-ios-sample.git프로젝트 구성
Anchor link to-
Xcode에서 프로젝트를 엽니다.
-
https://github.com/Pushwoosh/Pushwoosh-XCFramework를 Swift Package Dependency로 추가합니다. -
메인 타겟(PushwooshSampleApp)의 bundle identifier를 Pushwoosh 프로젝트와 일치하도록 설정합니다(예:
com.pushwoosh.PushwooshSampleApp). -
NotificationService 타겟에 대해 동일한 bundle identifier를 사용하고
.NotificationService를 덧붙입니다(예:com.pushwoosh.PushwooshSampleApp.NotificationService). -
Info.plist에서 다음을 설정합니다:Pushwoosh_APPID키: Pushwoosh Application CodePushwoosh_API_TOKEN키: Pushwoosh Device API Token
중요: Pushwoosh Control Panel에서 토큰에 올바른 앱에 대한 액세스 권한을 부여해야 합니다. 자세히 알아보기
프로젝트 실행
Anchor link to- 프로젝트를 빌드하고 실행합니다.
- 앱에는 “Actions”와 “Settings” 두 개의 탭이 있습니다. Settings 탭으로 이동합니다.
- Register for Pushes 버튼을 탭합니다.
- 푸시 알림 권한을 부여합니다. 기기가 Pushwoosh에 등록됩니다.
다음과 같은 로그 항목이 표시되어야 합니다:
Pushwoosh: Initializing application runtime[PW] BUNDLE ID: __YOUR_BUNDLE_ID__[PW] APP CODE: __YOUR_APP_CODE__[PW] PUSHWOOSH SDK VERSION: 7.0.0[PW] HWID: __YOUR_HWID__[PW] PUSH TOKEN: (null)[PW] [I] -[PWNotificationManagerCompatiOS10] NotificationCenter authorization granted: 1[PW] [I] -[PWPushNotificationsManagerCommon] Registered for push notifications: __YOUR_PUSH_TOKEN__이제 기기가 Pushwoosh에 등록되었습니다.
푸시 알림 보내기
Anchor link toPushwoosh Control Panel로 돌아가 등록된 기기로 푸시 알림을 보냅니다.
SDK 6.x에서 마이그레이션
Anchor link toSDK 버전 6.x에서 업그레이드하는 경우, 주요 변경 사항은 Pushwoosh 인스턴스에 액세스하는 방법입니다. 버전 7.0+에서는 Pushwoosh.sharedInstance() 대신 Pushwoosh.configure를 사용합니다:
이전 (6.x):
Pushwoosh.sharedInstance().registerForPushNotifications()Pushwoosh.sharedInstance().delegate = self이후 (7.0+):
Pushwoosh.configure.registerForPushNotifications()Pushwoosh.configure.delegate = self다른 모든 API는 동일하게 유지되므로, 코드를 업데이트하려면 프로젝트 전체에서 sharedInstance()를 configure로 바꾸기만 하면 됩니다.
다음 단계
Anchor link to자세한 내용은 기본 통합 가이드를 참조하세요.