我已经为main.ts中的应用程序暂停和恢复事件进行了编码,但未触发该事件。我已经通过以下链接https://docs.nativescript.org/angular/core-concepts/application-lifecycle#use-application-events
关注了文档我的Main.ts内容供您参考
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
import { AppModule } from "./app.module";
import { on as applicationOn, suspendEvent, resumeEvent, ApplicationEventData } from "tns-core-modules/application";
applicationOn(suspendEvent, (args: ApplicationEventData) => {
if (args.ios) {
console.log("suspendEvent triggered");
}
});
applicationOn(resumeEvent, (args: ApplicationEventData) => {
if (args.ios) {
console.log("resumeEvent triggered");
}
});
platformNativeScriptDynamic().bootstrapModule(AppModule);