[add] 沒有FCMToken就在要一次
This commit is contained in:
parent
cf6f6f393c
commit
fd5f31fd66
@ -1,3 +1,4 @@
|
|||||||
|
import { CoroutineV2 } from "./Engine/CatanEngine/CoroutineV2/CoroutineV2";
|
||||||
import { System_Eevent } from "./Engine/CatanEngine/CSharp/System/System_Eevent";
|
import { System_Eevent } from "./Engine/CatanEngine/CSharp/System/System_Eevent";
|
||||||
import NativeClass from "./NativeClass";
|
import NativeClass from "./NativeClass";
|
||||||
|
|
||||||
@ -109,7 +110,16 @@ export default class Manager extends cc.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public onLoadOK(): void {
|
public onLoadOK(): void {
|
||||||
|
CoroutineV2.Single(this.GetFCMToken()).Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public *GetFCMToken(): IterableIterator<any> {
|
||||||
const FCMToken: string = NativeClass.Instance.GetFCMToken();
|
const FCMToken: string = NativeClass.Instance.GetFCMToken();
|
||||||
|
if (!FCMToken) {
|
||||||
|
yield CoroutineV2.WaitTime(1);
|
||||||
|
yield this.GetFCMToken();
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log(`FCMToken ${FCMToken}`);
|
console.log(`FCMToken ${FCMToken}`);
|
||||||
NativeClass.Instance.CocosBridge(System_Eevent.SetFCMToken, `"${FCMToken}"`);
|
NativeClass.Instance.CocosBridge(System_Eevent.SetFCMToken, `"${FCMToken}"`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user