콘텐츠로 건너뛰기

iOS SDK 빠른 시작

이 빠르고 간단한 예제를 사용하여 Pushwoosh iOS SDK를 시작하세요.

사전 요구 사항

Anchor link to

Pushwoosh iOS SDK를 앱에 통합하려면 다음이 필요합니다:

예제 프로젝트 다운로드

Anchor link to

GitHub에서 예제 프로젝트를 복제합니다:

Terminal window
git clone https://github.com/Pushwoosh/pushwoosh-ios-sample.git

프로젝트 구성

Anchor link to
  1. Xcode에서 프로젝트를 엽니다.

  2. https://github.com/Pushwoosh/Pushwoosh-XCFramework를 Swift Package Dependency로 추가합니다.

  3. 메인 타겟(PushwooshSampleApp)의 bundle identifier를 Pushwoosh 프로젝트와 일치하도록 설정합니다(예: com.pushwoosh.PushwooshSampleApp).

  4. NotificationService 타겟에 대해 동일한 bundle identifier를 사용하고 .NotificationService를 덧붙입니다(예: com.pushwoosh.PushwooshSampleApp.NotificationService).

  5. Info.plist에서 다음을 설정합니다:

중요: Pushwoosh Control Panel에서 토큰에 올바른 앱에 대한 액세스 권한을 부여해야 합니다. 자세히 알아보기

프로젝트 실행

Anchor link to
  1. 프로젝트를 빌드하고 실행합니다.
  2. 앱에는 “Actions”와 “Settings” 두 개의 탭이 있습니다. Settings 탭으로 이동합니다.
  3. Register for Pushes 버튼을 탭합니다.
  4. 푸시 알림 권한을 부여합니다. 기기가 Pushwoosh에 등록됩니다.

다음과 같은 로그 항목이 표시됩니다:

Terminal window
Pushwoosh: Initializing application runtime
[PW] BUNDLE ID: __YOUR_BUNDLE_ID__
[PW] APP CODE: __YOUR_APP_CODE__
[PW] PUSHWOOSH SDK VERSION: 6.7.13
[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 to

Pushwoosh Control Panel로 돌아가 등록된 기기로 푸시 알림을 보냅니다.

다음 단계

Anchor link to

더 자세히 알아보려면 기본 통합 가이드를 참조하세요.