From b5d17697c3e6cdaba0ad37d4be04c5d94fce4f10 Mon Sep 17 00:00:00 2001 From: JianMiau Date: Mon, 29 Aug 2022 15:49:00 +0800 Subject: [PATCH] =?UTF-8?q?[mod]=20webview=20"loaded"=20=E6=89=8D=E9=96=8B?= =?UTF-8?q?=E5=A7=8B=E8=B7=91=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/Manager.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); } /** 跨版本溝通