[mod] webview "loaded" 才開始跑事件

This commit is contained in:
建喵 2022-08-29 15:49:00 +08:00
parent 4a2abf55f6
commit b5d17697c3

View File

@ -78,9 +78,11 @@ export default class Manager extends cc.Component {
} }
protected start(): void { protected start(): void {
const FCMToken: string = NativeClass.Instance.GetFCMToken(); this.webview.node.on("loaded", () => {
console.log(`FCMToken ${FCMToken}`); const FCMToken: string = NativeClass.Instance.GetFCMToken();
NativeClass.Instance.CocosBridge(System_Eevent.SetFCMToken, FCMToken, 666); console.log(`FCMToken ${FCMToken}`);
NativeClass.Instance.CocosBridge(System_Eevent.SetFCMToken, FCMToken);
}, this);
} }
/** /**