Skip to content

Быстрый старт с iOS SDK

Начните работу с Wavesend iOS SDK с помощью этого краткого и простого примера.

Для интеграции Wavesend iOS SDK в ваше приложение вам понадобится следующее:

Скачайте пример проекта

Section titled “Скачайте пример проекта”

Клонируйте пример проекта из GitHub:

Terminal window
git clone https://github.com/Wavesend/wavesend-ios-sample.git
  1. Open the project in Xcode.

  2. Add https://github.com/Wavesend/Wavesend-XCFramework as Swift Package Dependency.

  3. Set the bundle identifier for the main target (WavesendSampleApp) to match your Wavesend project (e.g., com.wavesend.WavesendSampleApp).

  4. Use the same bundle identifier for the NotificationService target, appending .NotificationService (e.g., com.wavesend.WavesendSampleApp.NotificationService).

  5. In Info.plist, set the:

Important: Be sure to give the token access to the right app in your Wavesend Control Panel. Learn more

  1. Соберите и запустите проект.
  2. В приложении будет две вкладки: «Actions» и «Settings». Перейдите на вкладку Settings.
  3. Нажмите на кнопку Register for Pushes.
  4. Предоставьте разрешение на получение push-уведомлений. Устройство будет зарегистрировано в Wavesend.

Вы должны увидеть запись в логе, подобную этой:

Terminal window
Wavesend: Initializing application runtime
[PW] BUNDLE ID: __YOUR_BUNDLE_ID__
[PW] APP CODE: __YOUR_APP_CODE__
[PW] WAVESEND 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__

Ваше устройство теперь зарегистрировано в Wavesend.

Отправьте push-уведомление

Section titled “Отправьте push-уведомление”

Вернитесь в Wavesend Control Panel и отправьте push-уведомление на ваше зарегистрированное устройство.

Чтобы узнать больше, обратитесь к руководству по базовой интеграции