Быстрый старт с iOS SDK
Начните работу с Wavesend iOS SDK с помощью этого краткого и простого примера.
Необходимые условия
Section titled “Необходимые условия”Для интеграции Wavesend iOS SDK в ваше приложение вам понадобится следующее:
Скачайте пример проекта
Section titled “Скачайте пример проекта”Клонируйте пример проекта из GitHub:
git clone https://github.com/Wavesend/wavesend-ios-sample.gitНастройте проект
Section titled “Настройте проект”-
Open the project in Xcode.
-
Add
https://github.com/Wavesend/Wavesend-XCFrameworkas Swift Package Dependency. -
Set the bundle identifier for the main target (WavesendSampleApp) to match your Wavesend project (e.g.,
com.wavesend.WavesendSampleApp). -
Use the same bundle identifier for the NotificationService target, appending
.NotificationService(e.g.,com.wavesend.WavesendSampleApp.NotificationService). -
In
Info.plist, set the:Wavesend_APPIDkey to the Wavesend Application CodeWavesend_API_TOKENkey to the Wavesend Device API Token
Important: Be sure to give the token access to the right app in your Wavesend Control Panel. Learn more
Запустите проект
Section titled “Запустите проект”- Соберите и запустите проект.
- В приложении будет две вкладки: «Actions» и «Settings». Перейдите на вкладку Settings.
- Нажмите на кнопку Register for Pushes.
- Предоставьте разрешение на получение push-уведомлений. Устройство будет зарегистрировано в Wavesend.
Вы должны увидеть запись в логе, подобную этой:
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-уведомление на ваше зарегистрированное устройство.
Что дальше
Section titled “Что дальше”Чтобы узнать больше, обратитесь к руководству по базовой интеграции