콘텐츠로 건너뛰기

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

자세한 내용은 기본 통합 가이드를 참조하십시오.