%define tizen_feature_nfc_support 1
%define tizen_feature_notification_support 1
%define tizen_feature_power_support 1
-%define tizen_feature_push_support 0
+%define tizen_feature_push_support 1
%define tizen_feature_sap_support 0
%define tizen_feature_se_support 1
%define tizen_feature_sensor_support 1
BuildRequires: pkgconfig(capi-system-power)
%endif
+%if 0%{?tizen_feature_power_support}
+BuildRequires: pkgconfig(push)
+BuildRequires: pkgconfig(capi-appfw-application)
+%endif
+
%if 0%{?tizen_feature_tv_display_support}
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(vconf)
--- /dev/null
+{
+ 'includes':[
+ '../common/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'tizen_push',
+ 'type': 'loadable_module',
+ 'sources': [
+ 'push_api.js',
+ 'push_extension.cc',
+ 'push_extension.h',
+ 'push_instance.cc',
+ 'push_instance.h',
+ 'push_manager.cc',
+ 'push_manager.h'
+ ],
+ 'includes': [
+ '../common/pkg-config.gypi',
+ ],
+ 'conditions': [
+ ['tizen == 1', {
+ 'variables': {
+ 'packages': [
+ 'push',
+ 'capi-appfw-application',
+ ]
+ },
+ }],
+ ],
+ },
+ ],
+}
--- /dev/null
+/* global xwalk, extension, tizen */
+
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+var native = new xwalk.utils.NativeManager(extension);
+var validator = xwalk.utils.validator;
+
+
+
+/**
+ * @constructor
+ */
+function PushManager() {
+ if (!(this instanceof PushManager)) {
+ throw new TypeError;
+ }
+}
+
+PushManager.prototype.registerService = function(appControl, successCallback, errorCallback) {
+
+};
+
+PushManager.prototype.unregisterService = function(successCallback, errorCallback) {
+
+};
+
+PushManager.prototype.connectService = function(notificationCallback) {
+
+};
+
+PushManager.prototype.disconnectService = function() {
+
+};
+
+PushManager.prototype.getRegistrationId = function() {
+
+};
+
+PushManager.prototype.getUnreadNotifications = function() {
+
+};
+
+exports = new PushManager();
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "push/push_extension.h"
+#include "push/push_instance.h"
+
+// This will be generated from push_api.js
+extern const char kSource_push_api[];
+
+namespace extension {
+namespace push {
+
+PushExtension::PushExtension() {
+ SetExtensionName("tizen.push");
+ SetJavaScriptAPI(kSource_push_api);
+}
+
+PushExtension::~PushExtension() {}
+
+PushManager& PushExtension::manager() {
+ // Initialize API on first request
+ return PushManager::getInstance();
+}
+
+common::Instance* PushExtension::CreateInstance() {
+ return new PushInstance;
+}
+
+} // namespace push
+} // namespace extension
+
+common::Extension* CreateExtension() {
+ return new extension::push::PushExtension;
+}
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_PUSH_PUSH_EXTENSION_H_
+#define SRC_PUSH_PUSH_EXTENSION_H_
+
+#include "common/extension.h"
+#include "push/push_manager.h"
+
+namespace extension {
+namespace push {
+
+class PushExtension : public common::Extension {
+ public:
+ PushExtension();
+ virtual ~PushExtension();
+
+ PushManager& manager();
+
+ private:
+ virtual common::Instance* CreateInstance();
+};
+
+} // namespace push
+} // namespace extension
+
+#endif // SRC_PUSH_PUSH_EXTENSION_H_
+
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "common/logger.h"
+
+#include "push/push_instance.h"
+#include "push/push_manager.h"
+
+namespace extension {
+namespace push {
+
+PushInstance::PushInstance() {
+ LoggerD("Enter");
+}
+
+PushInstance::~PushInstance() {
+ LoggerD("Enter");
+}
+
+} // namespace push
+} // namespace extension
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_PUSH_PUSH_INSTANCE_H_
+#define SRC_PUSH_PUSH_INSTANCE_H_
+
+#include "common/extension.h"
+
+#include "push/push_manager.h"
+
+namespace extension {
+namespace push {
+
+class PushInstance: public common::ParsedInstance {
+ public:
+ PushInstance();
+ virtual ~PushInstance();
+
+ private:
+};
+
+} // namespace push
+} // namespace extension
+
+#endif // SRC_PUSH_PUSH_INSTANCE_H_
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "common/logger.h"
+#include "push/push_manager.h"
+
+namespace extension {
+namespace push {
+
+PushManager::PushManager() {
+ LoggerD("Enter");
+}
+
+PushManager::~PushManager() {
+ LoggerD("Enter");
+}
+
+PushManager& PushManager::getInstance() {
+ static PushManager instance;
+ return instance;
+}
+
+} // namespace push
+} // namespace extension
+
--- /dev/null
+// Copyright 2014 Samsung Electronics Co, Ltd. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_PUSH_PUSH_MANAGER_H_
+#define SRC_PUSH_PUSH_MANAGER_H_
+
+namespace extension {
+namespace push {
+
+
+class PushManager {
+ public:
+ static PushManager& getInstance();
+ virtual ~PushManager();
+
+ private:
+ PushManager();
+};
+
+} // namespace push
+} // namespace extension
+
+#endif // SRC_PUSH_PUSH_MANAGER_H_
+
'sound/sound.gyp:*',
'notification/notification.gyp:*',
'sensor/sensor.gyp:*',
+ 'push/push.gyp:*',
],
},
], # end mobile