개발자 가이드
User GuideDeveloper GuideAPI Guide🏠
English
English
  • 홈
  • 공통
    • Unified ID Linkage Scenario
    • Constant
    • FAQ
  • 플랫폼 별 가이드
    • Android
      • Link up
      • Event
      • Set User Identification Information
      • User Profile Settings
      • Action
        • Push
        • In-app messages
        • Notification Talk
        • Message
      • Privacy Policy
        • Support for Privacy Protection
        • Preparing for data disclosure requirements on Google Play
      • Release Notes
    • iOS
      • Link up
      • Event
      • Set user identification information
      • User Profile Settings
      • Action
        • Push
        • In-app messages
        • Notification Talk
        • message
      • Release Notes
    • HybridApp
      • Link up
    • Web
      • Link up
      • Event
      • Set user identification information
      • User Profile Settings
      • Action
        • In-app messages
        • Notification Talk
        • Message
      • Advanced use cases
        • Additional Settings
      • Release Notes
Powered by GitBook
On this page
  1. 플랫폼 별 가이드
  2. Web
  3. Advanced use cases

Additional Settings

OnInitialized function

  • The OnInitialized function is used when the SDK has logic that needs to run after Init is complete.

Dfinery.OnInitialized(() => {
  // init Operation logic after
});
  • If there is page transition logic right after calling the event function, the page transition may occur before the function is completed, so the event may not be collected. Since logEvent is an asynchronous function that returns a Promise, it is recommended to proceed with the code as follows.

// init Run the function afterwards
window.Dfinery.onInitialized(() => {
  Promise.race([
    window.Dfinery.logEvent("EVENT_NAME"),
    new Promise((resolve, reject) => {
      setTimeout(() => reject("Timed out"), 2000); // If you don't succeed within 2 seconds, you fail.
    }),
  ])
    .catch((error) => {
      //
    })
    .then(() => {
      // movement
      window.location.href = "https://www.dfinery.io/crm";
    });
});

Adjust the timeout to reduce the impact of SDK errors. Depending on the timeout time and the client's network speed, collection may not be possible.

PreviousAdvanced use casesNextRelease Notes

Last updated 3 months ago