Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(notification_service): draft #9

Closed
wants to merge 0 commits into from

Conversation

gochicus
Copy link
Contributor

No description provided.

@gochicus gochicus added the documentation Improvements or additions to documentation label May 15, 2024
@gochicus gochicus self-assigned this May 15, 2024
@TorinAsakura
Copy link
Member

что за draft?

@TorinAsakura
Copy link
Member

@yart просил уже миллион раз - отруби чёртовы экшены

@gochicus gochicus requested a review from maksmart96 May 30, 2024 14:56
@gochicus gochicus marked this pull request as ready for review May 30, 2024 14:56
let notificationService = NotificationService(sdkInstance: personalizationSDK)

// Request permission for remote notifications
UIApplication.shared.registerForRemoteNotifications()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

метод registerForRemoteNotifications наш класс NotificationService вызовет самостоятельно во время своей инициализации. Клиенту(разработчику) не нужно самостоятельно подписываться под уведомления и просить авторизиции (разрешение на отправку уведомлений)

@@ -0,0 +1,37 @@
// Example of SimplePersonalizationSDK initialization with autoSendPushToken flag set to true

let personalizationSDK = SimplePersonalizationSDK(autoSendPushToken: true)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по дефолту токен будет отправляться автоматически - поэтому не обязательно прописывать явно параметр autoSendPushToken - не знаю необходимо ли это в документации но инфу доношу.
лучше написать так let personalizationSDK = SimplePersonalizationSDK(shopId: "SHOP_ID", autoSendPushToken: true)
тк параметр shopId обязателен для инициализации.

let personalizationSDK = SimplePersonalizationSDK(autoSendPushToken: true)

// Example of initializing NotificationService
let notificationService = NotificationService(sdkInstance: personalizationSDK)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NotificationService(sdk: personalizationSDK) - не sdkInstance

let notificationService = NotificationService(sdkInstance: personalizationSDK)

// Request permission for remote notifications
UIApplication.shared.registerForRemoteNotifications()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NotificationService самостоятельно запросит регистрацию
UIApplication.shared.registerForRemoteNotifications() не нужно вызывать самостоятельно


// Example of integrating NotificationService in AppDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Initialize NotificationService

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Initialize iOS SDK first 
var personalizationSDK = createPersonalizationSDK(shopId: "SHOP_ID", autoSendPushToken: true)

// Initialize NotificationService with pre-created instance of iOS SDK
let notificationService = NotificationService(sdk: personalizationSDK)

// Implement method for receiving device token
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
// Pass device token to NotificationService
notificationService.didRegisterForRemoteNotifications(with: deviceToken)
Copy link

@maksmart96 maksmart96 May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notificationService.didRegisterForRemoteNotificationsWithDeviceToken(deviceToken: deviceToken)

@gochicus gochicus closed this May 31, 2024
@gochicus gochicus force-pushed the feat/notification-service branch from 2bcea05 to abc42dc Compare May 31, 2024 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants