diff --git a/assets/Script/Manager.ts b/assets/Script/Manager.ts index bb43dcf..9336cf4 100644 --- a/assets/Script/Manager.ts +++ b/assets/Script/Manager.ts @@ -78,9 +78,11 @@ export default class Manager extends cc.Component { } protected start(): void { - const FCMToken: string = NativeClass.Instance.GetFCMToken(); - console.log(`FCMToken ${FCMToken}`); - NativeClass.Instance.CocosBridge(System_Eevent.SetFCMToken, FCMToken, 666); + this.webview.node.on("loaded", () => { + const FCMToken: string = NativeClass.Instance.GetFCMToken(); + console.log(`FCMToken ${FCMToken}`); + NativeClass.Instance.CocosBridge(System_Eevent.SetFCMToken, FCMToken); + }, this); } /** 跨版本溝通