Skip to content

Commit

Permalink
docs(notification_service): description change
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr_Zavadkin <[email protected]>
  • Loading branch information
gochicus committed May 31, 2024
1 parent 8c8a609 commit 526e395
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions source/includes/_notification_service.md.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# The first step is setting `autoSendPushToken = true` during SDK initialization
# `NotificationService` object is initializing in `SimplePersonalizationSDK`
# The first step is to make sure that `autoSendPushToken = true` during SDK initialization
# it's a default value.
# `NotificationService` object is initializing with `SimplePersonalizationSDK`
# `NotificationService` will check `autoSendPushToken ` value. If true - the last sending date check.
# Check results: nil - token will be sent to the server and the date will be saved.
# More than a week - the token will be sent and the token sending date will be renewed.
Expand All @@ -25,14 +26,11 @@

print("0 init SDK")
sdk = createPersonalizationSDK(shopId:String, enableLogs: Boolean, { error in
didToken = self.sdk.getDeviceId()
globalSDK = self.sdk
NotificationCenter.default.post(name: globalSDKNotificationNameMainInit, object: nil)
# Custom completionHandler
})
# Create instance of NotificationService with pre-created sdk
notificationService = NotificationService(sdk: sdk)
notificationService?.pushActionDelegate = self

}
}
}

# During initialization `NotificationService ` will ask permission from the user to send notifications
Expand All @@ -49,6 +47,6 @@
print("Push Token", pushGlobalToken)
userDefaults.standard.set(token,forkey: "pushGlobalToken")
Messaging.messaging().apnsToken = deviceToken

notificationService?didRegisterForRemoteNotificationsWithDeviceToken(deviceToken: deviceToken)
# Additional custom code
notificationService?didRegisterForRemoteNotificationsWithDeviceToken(deviceToken: deviceToken)
}

0 comments on commit 526e395

Please sign in to comment.