Web SDK ライフサイクルコールバック
初期化や設定の取得完了など、MoEngage Web SDK のライフサイクルイベントをリッスンします。
SDK の初期化が完全に完了するまで待ってから何らかのアクションを実行したい場合があります。また、SDK の設定が取得されたとき(ブラウザに 24 時間キャッシュされます)に何かをトリガーする必要がある場合もあります。
SDK はさまざまなライフサイクルでイベントを発行するため、それらをリッスンして利用できます。
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
初期化や設定の取得完了など、MoEngage Web SDK のライフサイクルイベントをリッスンします。
window.addEventListener("MOE_LIFECYCLE", function(e) {
if (e.detail.name === "SDK_INITIALIZATION_COMPLETED") {
console.log(e.detail.data);
// write your code here
}
if (e.detail.name === "SETTINGS_FETCHED") {
console.log(e.detail.data);
// write your code here
}
});
Suggestions