Support persistent notification 55/147355/1
authorcookie <cookie@samsung.com>
Mon, 4 Sep 2017 05:47:18 +0000 (05:47 +0000)
committercookie <cookie@samsung.com>
Mon, 4 Sep 2017 05:47:18 +0000 (05:47 +0000)
[Problem] Persistent notifiaction doesn't work if browser is suspened or killed.
[Cause] Chromium posts notification with app_control which includes custom
        information. If browser launched by notification we should hand over
        this information to chromium.
[Solution] Invoke |ewk_context_app_control_set|.

Change-Id: Iba0018c461de3cc2d14c9700b2f3d81108abb645
Signed-off-by: cookie <cookie@samsung.com>
core/main.cpp

index 8f4592938b3443a748f96bb21e685a097aa90ea4..da76884837fa29e5a3c9ea3077b737123140eb2d 100755 (executable)
@@ -203,6 +203,8 @@ static void app_control(app_control_h app_control, void* app_data)
     evas_object_show((*bd)->getMainWindow().get());
     elm_win_activate((*bd)->getMainWindow().get());
 
+    ewk_context_app_control_set(ewk_context_default_get(), static_cast<void*>(app_control));
+
     if (appcore_flush_memory() == -1) {
        return;
     }
@@ -246,7 +248,11 @@ static void app_language_changed(app_event_info*, void* app_data)
 int main(int argc, char* argv[])try
 {
     BEGIN()
-    ewk_init();
+    if (!ewk_init()) {
+        BROWSER_LOGE(" could not ewk_init()");
+        return false;
+    }
+
     set_arguments(argv);
 
 //#if !defined(NDEBUG)