From fdebbc77b7820e94ff10b39aa4aeb23b46055fd0 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 26 Jul 2018 09:32:37 +0800 Subject: [PATCH] dispatch show/hide event to js (#1424) --- .../frameworks/runtime-src/Classes/AppDelegate.cpp | 2 ++ .../frameworks/runtime-src/Classes/AppDelegate.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp b/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp index 3a78ffb04e..904b6a6d55 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/native/templates/js-template-default/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -101,6 +101,7 @@ void AppDelegate::applicationDidEnterBackground() struct CustomEvent event; event.name = EVENT_COME_TO_BACKGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterBackgroundEvent(); } // this function will be called when the app is active again @@ -109,4 +110,5 @@ void AppDelegate::applicationWillEnterForeground() struct CustomEvent event; event.name = EVENT_COME_TO_FOREGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterForegroundEvent(); } diff --git a/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp b/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp index 3a78ffb04e..904b6a6d55 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/native/templates/js-template-link/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -101,6 +101,7 @@ void AppDelegate::applicationDidEnterBackground() struct CustomEvent event; event.name = EVENT_COME_TO_BACKGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterBackgroundEvent(); } // this function will be called when the app is active again @@ -109,4 +110,5 @@ void AppDelegate::applicationWillEnterForeground() struct CustomEvent event; event.name = EVENT_COME_TO_FOREGROUND; EventDispatcher::dispatchCustomEvent(&event); + EventDispatcher::dispatchEnterForegroundEvent(); }