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

Feat/notification service #12

Merged
merged 6 commits into from
May 31, 2024
Merged

Feat/notification service #12

merged 6 commits into from
May 31, 2024

Conversation

gochicus
Copy link
Contributor

No description provided.

@gochicus gochicus added the documentation Improvements or additions to documentation label May 31, 2024
@gochicus gochicus requested a review from maksmart96 May 31, 2024 02:18
@gochicus gochicus self-assigned this May 31, 2024
@gochicus
Copy link
Contributor Author

@maksmart96 посмотри, пожалуйста этот, твои правки учтены.

@maksmart96
Copy link

@gochicus
Все что я написал - надо вставить вместо того что из проекта ты скопировал и будет выглядеть отлично думаю

@gochicus gochicus requested a review from maksmart96 May 31, 2024 03:23
# Less than a week - token won`t be sent.
# If `autoSendPushToken` value is false NotificationService won`t send the token to the server

@UIApplicationMain
Copy link
Contributor Author

Choose a reason for hiding this comment

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

 class AppDelegate: UIResponder, UIApplicationDelegate {
         var window: UIWindow?

         var sdk: PersonalizationSDK!
         var notificationService: NotificationServiceProtocol?

         func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
             sdk = createPersonalizationSDK(shopId: "SHOP_ID", enableLogs: true, { error in
             # Custom completionHandler
             })

             # Create instance of NotificationService with pre-created sdk
             notificationService = NotificationService(sdk: sdk)
                 }
             }

     # During initialization `NotificationService ` will ask permission from the user to send notifications
     # - UIApplication.shared.registerForRemoteNotifications()
     # The client will have to sign protocols - UNUserNotificationCenterDelegate and implement the `application` method
     # and call the `application` method inside of the NotificationService object application

     extension AppDelegate: UNUserNotificationCenterDelegate {
         func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
         # Additional custom code
     notificationService?.didRegisterForRemoteNotificationsWithDeviceToken(deviceToken: deviceToken)
     }

@maksmart96 Последним коммитом вс убрал, вот так сейчас выглядит.

@gochicus gochicus requested a review from TorinAsakura May 31, 2024 04:32
Copy link

@maksmart96 maksmart96 left a comment

Choose a reason for hiding this comment

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

.

@gochicus
Copy link
Contributor Author

@maksmart96 тут с проверками проблемы, Андрею мерждить придётся. Пожалуйста, сделай resolve своих ревью.

@TorinAsakura
Copy link
Member

@maksmart96 тут с проверками проблемы, Андрею мерждить придётся. Пожалуйста, сделай resolve своих ревью.

какими проверками? какие проблемы?

@TorinAsakura TorinAsakura merged commit c7c4e1a into master May 31, 2024
0 of 5 checks passed
@TorinAsakura TorinAsakura deleted the feat/notification-service branch May 31, 2024 11:40
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