From: jk7744.park Date: Tue, 8 Sep 2015 13:16:19 +0000 (+0900) Subject: tizen 2.3.1 release X-Git-Tag: submit/tizen_2.3.1/20150915.080342 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de377aa0f7784278fd09676719ca2ec553a0af6a;p=framework%2Fappfw%2Fsppc.git tizen 2.3.1 release --- diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9c13a9b --- /dev/null +++ b/LICENSE @@ -0,0 +1,204 @@ +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..ded3804 --- /dev/null +++ b/NOTICE @@ -0,0 +1 @@ +Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. \ No newline at end of file diff --git a/arm/bin/push_tool b/arm/bin/push_tool index fc90f5e..5307718 100755 Binary files a/arm/bin/push_tool and b/arm/bin/push_tool differ diff --git a/arm/bin/pushd b/arm/bin/pushd index 83b8fe1..f89d03c 100755 Binary files a/arm/bin/pushd and b/arm/bin/pushd differ diff --git a/arm/etc/init.d/pushd b/arm/etc/init.d/pushd deleted file mode 100755 index 09f9681..0000000 --- a/arm/etc/init.d/pushd +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -DESC="Push service daemon" -NAME=pushd -DAEMON=/usr/bin/$NAME -SCRIPTNAME=/etc/init.d/$NAME - -[ -x "$DAEMON" ] || exit 0 - -do_start() { - PID=`pidof $NAME` - [ -z "$PID" ] || return 1 - $DAEMON - RETVAL=$? - return "$RETVAL" -} - -do_stop() { - PID=`pidof $NAME` - if [ -n "$PID" ]; then - kill $PID - fi - return 0 -} - -prt_res() { - RETVAL=$1 - - case "$RETVAL" in - 0|1) - echo "... done." - RETVAL=0 - ;; - *) - echo "... failed!" - RETVAL=1 - ;; - esac - - return $RETVAL -} - -case "$1" in - start) - echo "Starting $DESC" "$NAME" - do_start - prt_res $? - ;; - stop) - echo "Stopping $DESC" "$NAME" - do_stop - prt_res $? - ;; - *) - echo "Usage: $SCRIPTNAME {start|stop}" >&2 - exit 3 - ;; -esac - diff --git a/arm/etc/rc.d/rc3.d/S90pushd b/arm/etc/rc.d/rc3.d/S90pushd deleted file mode 120000 index 70c8ff9..0000000 --- a/arm/etc/rc.d/rc3.d/S90pushd +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/pushd \ No newline at end of file diff --git a/arm/etc/rc.d/rc5.d/S90pushd b/arm/etc/rc.d/rc5.d/S90pushd deleted file mode 120000 index 70c8ff9..0000000 --- a/arm/etc/rc.d/rc5.d/S90pushd +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/pushd \ No newline at end of file diff --git a/arm/include/push.h b/arm/include/push.h deleted file mode 100644 index a8f697d..0000000 --- a/arm/include/push.h +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apach e License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef __PUSH_LIB_H__ -#define __PUSH_LIB_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @addtogroup CAPI_MESSAGING_PUSH_MODULE - * @{ - */ - -/** - * @file push.h - * @ingroup CAPI_MESSAGING_FRAMEWORK - * @brief Support to receive push notifications - */ - -/** - * @brief Enumerations of error codes for push API - */ -typedef enum { - PUSH_ERROR_NONE = 0, /**< Successful */ - PUSH_ERROR_OUT_OF_MEMORY = -ENOMEM, /**< Out of memory */ - PUSH_ERROR_INVALID_PARAMETER = -EINVAL, /**< Invalid parameter */ - PUSH_ERROR_NOT_CONNECTED = -ENOTCONN, /**< Not connected */ - PUSH_ERROR_NO_DATA = -ENODATA, /**< No data available */ - PUSH_ERROR_OPERATION_FAILED = -0x00004300, /**< Internal operation failed */ -} push_error_e; - -/** - * @brief Enumerations of registration state - */ -typedef enum { - PUSH_STATE_REGISTERED, /**< Registred */ - PUSH_STATE_UNREGISTERED, /**< Unregistered */ - PUSH_STATE_ERROR, /**< Error */ -} push_state_e; - -/** - * @brief Enumerations of result - */ -typedef enum { - PUSH_RESULT_SUCCESS, /**< Successful */ - PUSH_RESULT_TIMEOUT, /**< Request timed out */ - PUSH_RESULT_SERVER_ERROR, /**< Push server error */ - PUSH_RESULT_SYSTEM_ERROR, /**< System error */ -} push_result_e; - -/** - * @brief Handle of a connection to the push service - */ -typedef struct push_connection_s *push_connection_h; - -/** - * @brief Handle of a notification delivered from the push server - */ -typedef struct push_notification_s *push_notification_h; - -/** - * @brief State callback - * @remarks This callback will be invoked when the regisration state is - * refreshed. If the registration or degistration has been succeeded, - * then this state callback must be called. In addition, the state - * can be changed if the push server deregisters the application. - * @param[in] state Registration state - * @param[in] err Error message - * @param[in] user_data User data passed to this callback - * @see push_connect() - */ -typedef void (*push_state_cb)( - push_state_e state, const char *err, void *user_data); - -/** - * @brief Notifcation callback - * @param[in] notification A handle of notification containing its payload. - * The handle is available inside this callback only. - * @param[in] user_data User data passed to this callback - * @see push_connect(), push_get_notification_data() - */ -typedef void (*push_notify_cb)( - push_notification_h noti, void *user_data); - -/** - * @brief Result callback - * @param[in] result Registration/deregistration result - * @param[in] msg Result message from the push server or NULL - * @param[in] user_data User data passed to this callback - * @see push_register(), push_deregister() - */ -typedef void (*push_result_cb)(push_result_e result, const char *msg, void *user_data); - -/** - * @brief Connects to the push service and sets callback functions - * @remarks If there is a connection between an application and the push service, - * the notify callback passes the notification upon its arrival. - * Otherwise, the push service posts a UI notification to alert users. - * Connection should be freed with @ref push_disconnect() by you. - * @param[in] app_id The application ID - * @param[in] state_cb State callback function - * @param[in] notify_cb Notify callback function - * @param[in] user_data User data to pass to state_cb and notify_cb - * @param[out] connection The connection handle to the push service - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_OPERATION_FAILED Operation failed - * @pre There is no connection for the app_id to the push service - * @post The state callback will be called to let you know the current - * registration state immediately. - * @see push_disconnect() - */ -int push_connect(const char *app_id, push_state_cb state_callback, - push_notify_cb notify_callback, void *user_data, - push_connection_h *connection); - -/** - * @brief Closes the connection and releases all its resources - * @remarks If you call this function in the push callback functions, - * it may cause your application crash. - * @param[in] connection Handle of a connection to the push service - * @see push_connect() - */ -void push_disconnect(push_connection_h connection); - -/** - * @brief Registers an application to the push server - * @param[in] connection The connection handle to the push service - * @param[in] service A @ref Service handle to launch an application by - * an posted UI notification - * @param[in] result_cb Result callback function - * @param[in] user_data User data to pass to result_cb - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NOT_CONNECTED No connection to the push service - * @retval PUSH_ERROR_OPERATION_FAILED Operation failed - * @pre The application should be connected to the push service - * @post For successful result, the state callback should be invoked - * @see push_deregister() - */ -int push_register(push_connection_h connection, service_h service, - push_result_cb result_callback, void *user_data); - -/** - * @brief Deregisters an application from the Push server - * @param[in] connection The connection handle to the push service - * @param[in] result_cb Result callback function - * @param[in] user_data User data to pass to result_cb - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NOT_CONNECTED No connection to the push service - * @retval PUSH_ERROR_OPERATION_FAILED Operation failed - * @pre The application should be connected to the push service - * @post In result, the state callback will be invoked - * @see push_register() - */ -int push_deregister(push_connection_h connection, push_result_cb callback, - void *user_data); - -/** - * @brief Gets notification data which its server sent - * @remark The data must be released with free() by you - * @param[in] notification The notification handle - * @param[out] data The notification data\n - * Set NULL if error but PUSH_ERROR_INVALID_PARAMETER - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NO_DATA No data available - * @see push_notify_cb() - * @see push_get_unread_notification() - */ -int push_get_notification_data(push_notification_h notification, char **data); - - -/** - * @brief Gets the notification message which its server sent - * @remark The msg must be released with free() by you - * @param[in] notification The notification handle - * @param[out] data The notification message\n - * Set NULL if error but PUSH_ERROR_INVALID_PARAMETER - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NO_DATA No data available - * @see push_notify_cb() - * @see push_get_unread_notification() - */ -int push_get_notification_message(push_notification_h notification, - char **msg); - -/** - * @brief Gets the received time of the notification message - * - * @param[in] notification The notification handle - * @param[out] received_time The received time of the notification message. \n - * The @a received_time is based on UTC. - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_NO_DATA No data available - * - * @see push_notify_cb() - * @see push_get_unread_notification() - */ -int push_get_notification_time(push_notification_h notification, long long int *received_time); - -/** - * @brief Gets an unread notification message from the push server - * - * @remark This method will be deprecated. - * @remark @a noti must be released with push_free_notification() by you - * - * @details If an application receives an unread message with this method, the message is removed from the system. \n - * This method can be called repeatedly until it returns PUSH_ERROR_NO_DATA \n - * But, this method does NOT guarantee order and reliability of notification messages. \n - * Some notification messages can be dropped when the system message queue is full. - * - * @param[in] connection The connection handle to the push service - * @param[out] noti The notification handle - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NO_DATA No data available - * - * @see push_get_notification_message() - * @see push_get_notification_time() - * @see push_get_notification_data() - */ -int push_get_unread_notification(push_connection_h connection, - push_notification_h *noti); - - -/** - * @brief Gets the registration ID in PUSH_STATE_REGISTERED state - * @remark The reg_id must be released with free() by you - * @param[in] connection The connection handle to the push service - * @param[out] reg_id The registration ID\n - * Set NULL if error but PUSH_ERROR_INVALID_PARAMETER - * @return 0 on success, otherwise a negative error value - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NO_DATA No registration ID available - */ -int push_get_registration_id(push_connection_h connection, char **reg_id); - - -/** - * @brief Frees the notification handle - * @param[in] noti The notification handle - */ -void push_free_notification(push_notification_h noti); -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __PUSH_LIB_H__ */ diff --git a/arm/lib/libpush.so.0.2.12 b/arm/lib/libpush.so.0.2.12 index 966a35f..d6052a6 100644 Binary files a/arm/lib/libpush.so.0.2.12 and b/arm/lib/libpush.so.0.2.12 differ diff --git a/arm/lib/systemd/user/pushd.service b/arm/lib/systemd/user/pushd.service deleted file mode 100644 index 0603ebf..0000000 --- a/arm/lib/systemd/user/pushd.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Pushd service - -[Service] -Type=forking -ExecStart=/usr/bin/pushd - -[Install] -WantedBy=tizen-middleware.target diff --git a/arm/lib/systemd/user/tizen-middleware.target.wants/pushd.service b/arm/lib/systemd/user/tizen-middleware.target.wants/pushd.service deleted file mode 120000 index 21d0bfc..0000000 --- a/arm/lib/systemd/user/tizen-middleware.target.wants/pushd.service +++ /dev/null @@ -1 +0,0 @@ -../pushd.service \ No newline at end of file diff --git a/doc/images/capi_messaging_push_overview1.png b/doc/images/capi_messaging_push_overview1.png new file mode 100755 index 0000000..f473d64 Binary files /dev/null and b/doc/images/capi_messaging_push_overview1.png differ diff --git a/doc/push-service_doc.h b/doc/push-service_doc.h new file mode 100755 index 0000000..a382eae --- /dev/null +++ b/doc/push-service_doc.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apach e License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef __PUSH_SERVICE_DOC_H__ +#define __PUSH_SERVICE_DOC_H__ + +/** + * @ingroup CAPI_MESSAGING_FRAMEWORK + * @defgroup CAPI_MESSAGING_PUSH_PUBLIC_MODULE Push + * @brief The @ref CAPI_MESSAGING_PUSH_PUBLIC_MODULE API provides functions to receive push notifications. + * + * @addtogroup CAPI_MESSAGING_PUSH_PUBLIC_MODULE + * + * @section CAPI_MESSAGING_PUSH_PUBLIC_MODULE_HEADER Required Header + * \#include + * + * @section CAPI_MESSAGING_PUSH_PUBLIC_MODULE_OVERVIEW Overview + * + * The Push API allows your application to receive push notifications from a push server. + * The push service is a client daemon that maintains a permanent connection between your device + * and the push server, in order to process your registration/deregistration requests and + * deliver push notifications to your application. If the application is connected, + * the push service passes the notification data over the connection. Otherwise, + * the push service posts a UI notification with the data. + * It will be delivered when a user launches the application by selecting the posting. + * + * To receive push notifications, you need to follow the steps below: + * + * - Connecting to the push service + * - Registering your application + * - Getting notification data + * + * Push notification helps your application server send data to the application on devices + * over an IP network even if the application is not running. + * Push notification may reduce battery consumption over other applications keeping its own connection + * to its remote application server. + * @image html capi_messaging_push_overview1.png + * + * @subsection CAPI_MESSAGING_PUSH_PUBLIC_LIMITATIONS Service Limitation + * - Payload of a push message is limited to 4096 bytes. + * - Administrative permission is needed for your application and server to use the push service. + * - Push service does not guarantee delivery and order of push messages. + * - A device should have a valid IMEI number. + *
+ */ + +#endif /* __PUSH_SERVICE_DOC_H__ */ diff --git a/doc/push_doc.h b/doc/push_doc.h new file mode 100755 index 0000000..4abc75a --- /dev/null +++ b/doc/push_doc.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apach e License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef __PUSH_DOC_H__ +#define __PUSH_DOC_H__ + +/** + * @internal + * @defgroup CAPI_MESSAGING_PUSH_MODULE Push-Internal + * @brief The @ref CAPI_MESSAGING_PUSH_MODULE API provides functions to receive push notifications. + * @ingroup CAPI_MESSAGING_FRAMEWORK + * + * @addtogroup CAPI_MESSAGING_PUSH_MODULE + * + * @section CAPI_MESSAGING_PUSH_MODULE_HEADER Required Header + * \#include + * + * @section CAPI_MESSAGING_PUSH_MODULE_OVERVIEW Overview + * + * The Push API allows your application to receive push notifications from a push server. + * The push service is a client daemon that maintains a permanent connection between your device + * and the push server, in order to process your registration/deregistration requests and + * deliver push notifications to your application. If the application is connected, + * the push service passes the notification data over the connection. Otherwise, + * the push service posts a UI notification with the data. + * It will be delivered when a user launches the application by selecting the posting. + * + * To receive push notifications, you need to follow the steps below: + * + * - Connecting to the push service + * - Registering your application + * - Getting notification data + * + * Push notification helps your application server send data to the application on devices + * over an IP network even if the application is not running. + * Push notification may reduce battery consumption over other applications keeping its own connection + * to its remote application server. + * @image html capi_messaging_push_overview1.png + * + * @subsection CAPI_MESSAGING_PUSH_MODULE_OVERVIEW Service Limitation + * - Payload of a push message is limited to 4096 bytes. + * - Administrative permission is needed for your application and server to use the push service. + * - Push service does not guarantee delivery and order of push messages. + * - A device should have a valid IMEI number. + * + * @section CAPI_MESSAGING_PUSH_MODULE_FEATURE Related Features + * This API is related with the following feature: + * - http://tizen.org/feature/network.push + * + * It is recommended to design feature related codes in your application for reliability. + * + * You can check if a devrice supports the related features for this API by using @ref CAPI_SYSTEM_SYSTEM_INFO_MODULE, thereby controlling the procedure of your application. + * + * To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK. + * + * More details on featuring your application can be found from Feature Element. + * + */ + +#endif /* __PUSH_DOC_H__ */ diff --git a/include/push-service.h b/include/push-service.h new file mode 100755 index 0000000..87fbcca --- /dev/null +++ b/include/push-service.h @@ -0,0 +1,501 @@ +/* + * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __PUSH_PUBLIC_LIB_H__ +#define __PUSH_PUBLIC_LIB_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file push-service.h + */ + +/** + * @addtogroup CAPI_MESSAGING_PUSH_PUBLIC_MODULE + * @{ + */ + +/** + * @brief Enumerations of error codes for push API. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef enum { + PUSH_SERVICE_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ + PUSH_SERVICE_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ + PUSH_SERVICE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ + PUSH_SERVICE_ERROR_NOT_CONNECTED = TIZEN_ERROR_CONNECTION, /**< Not connected */ + PUSH_SERVICE_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA, /**< No data available */ + PUSH_SERVICE_ERROR_OPERATION_FAILED = TIZEN_ERROR_UNKNOWN, /**< Internal operation failed */ + PUSH_SERVICE_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< No privilege to access the push service */ + PUSH_SERVICE_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Push service not supported */ +} push_service_error_e; + +/** + * @brief Enumeration of registration states. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef enum { + PUSH_SERVICE_STATE_REGISTERED, /**< Registred */ + PUSH_SERVICE_STATE_UNREGISTERED, /**< Unregistered */ + PUSH_SERVICE_STATE_PROVISIONING_IPCHANGE, /**< To change the provisining server IP */ + PUSH_SERVICE_STATE_PING_CHANGE, /**< Ping interval is changing */ + PUSH_SERVICE_STATE_ERROR, /**< Error */ +} push_service_state_e; + +/** + * @brief Enumeration of result. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef enum { + PUSH_SERVICE_RESULT_SUCCESS, /**< Successful */ + PUSH_SERVICE_RESULT_TIMEOUT, /**< Request timed out */ + PUSH_SERVICE_RESULT_SERVER_ERROR, /**< Push server error */ + PUSH_SERVICE_RESULT_SYSTEM_ERROR, /**< System error */ +} push_service_result_e; + +/** + * @brief Connection to the push service handle. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef struct push_connection_s *push_service_connection_h; + +/** + * @brief Notification delivered from the push server handle. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef struct push_notification_s *push_service_notification_h; + +/** + * @brief Called when the registration state is refreshed. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remarks This callback will be invoked when the registration state is refreshed. \n + * If the registration or deregistration has succeeded, then this state callback must be called. \n + * In addition, the state can be changed if the push server deregisters the application. + * @param[in] state The registration state + * @param[in] err The error message + * @param[in] user_data The user data passed to this callback + * @see push_service_connect() + */ +typedef void (*push_service_state_cb)( + push_service_state_e state, const char *err, void *user_data); + +/** + * @brief Called to handle a notification. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @param[in] notification A handle of the notification containing its payload\n + * The handle is available inside this callback only. + * @param[in] user_data The user data passed to this callback + * @see push_service_connect() + * @see push_service_get_notification_data() + */ +typedef void (*push_service_notify_cb)( + push_service_notification_h noti, void *user_data); + +/** + * @brief Called with the result of a registration/deregistration. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @param[in] result The registration/deregistration result + * @param[in] msg The result message from the push server, + * otherwise @c NULL + * @param[in] user_data The user data passed to this callback + * @see push_service_register() + * @see push_service_deregister() + */ +typedef void (*push_service_result_cb)(push_service_result_e result, const char *msg, void *user_data); + +/** + * @brief Connects to the push service and sets callback functions. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/push + * @remarks If there is a connection between an application and the push service,\n + * the notify callback passes the notification upon its arrival.\n + * Otherwise, the push service posts a UI notification to alert users.\n + * The connection should be freed with push_service_disconnect() by you. + * @param[in] push_app_id App id received from Tizen Push Server team + * @param[in] state_callback State callback function + * @param[in] notify_callback Notify callback function + * @param[in] user_data User data to pass to state_cb and notify_cb + * @param[out] connection The connection handle to the push service + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NOT_CONNECTED Connection to the daemon failed + * @retval #PUSH_SERVICE_ERROR_PERMISSION_DENIED No push privilege + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @pre There is no connection to the push service for the app_id. + * @post The state callback will be called to let you know the current + * registration state immediately. + * @see push_service_disconnect() + */ +int push_service_connect(const char *push_app_id, + push_service_state_cb state_callback, + push_service_notify_cb notify_callback, void *user_data, + push_service_connection_h *connection); + +/** + * @brief Closes the connection and releases all its resources + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remarks If you call this function in the push callback functions,\n + * it may cause your application to crash.\n + * The specific error code can be obtained using the get_last_result()\n + * Error codes are described in the exception section. + * @param[in] connection The connection handle to the push service + * @exception #PUSH_SERVICE_ERROR_NONE Successful + * @exception #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @exception #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @see push_service_connect() + */ +void push_service_disconnect(push_service_connection_h connection); + +/** + * @brief Registers an application to the push server. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @param[in] connection The connection handle to the push service + * @param[in] result_callback Result callback function + * @param[in] user_data User data to pass to result_cb + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NOT_CONNECTED No connection to the push service + * @retval #PUSH_SERVICE_ERROR_OPERATION_FAILED Operation failed + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @pre The application should be connected to the push service. + * @post As a result, the state callback will be invoked. + * @see push_service_deregister() + */ +int push_service_register(push_service_connection_h connection, + push_service_result_cb result_callback, void *user_data); + +/** + * @brief Deregisters an application from the Push server. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @param[in] connection The connection handle to the push service + * @param[in] result_callback Result callback function + * @param[in] user_data User data to pass to result_cb + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NOT_CONNECTED No connection to the push service + * @retval #PUSH_SERVICE_ERROR_OPERATION_FAILED Operation failed + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @pre The application should be connected to the push service. + * @post As a result, the state callback will be invoked. + * @see push_service_register() + */ +int push_service_deregister(push_service_connection_h connection, push_service_result_cb result_callback, + void *user_data); + +/** + * @brief Retrieves the payload data of a notification that forcibly launched the app. + * @details When a notification arrives at the device with the "LAUNCH"\n + * option or a user clicks a notification in the quick panel,\n + * the push daemon forcibly launches the app and delivers the\n + * notification to the app as a bundle. This function returns\n + * the payload data in the notificaiton. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/push + * @remark This function must be called in the app control callback function.\n + * You must release the payload data using free().\n + * push_service_app_control_to_notification() is preferred to this API.\n + * The specific error code can be obtained using the get_last_result()\n + * Error codes are described in the exception section. + * @param[in] app_control The app control handle that is handed over in the\n + * app control callback function + * @param[in] operation The operation in the app control handle retrieved by\n + * app_control_get_operation() + * @return The payload data (appData) in the notification\n + * NULL if the app is not launched by a push notification. + * @exception #PUSH_SERVICE_ERROR_NONE Successful + * @exception #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @exception #PUSH_SERVICE_ERROR_NO_DATA Not launched by a notification + * @exception #PUSH_SERVICE_ERROR_OPERATION_FAILED Operation fail + * @exception #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @exception #PUSH_SERVICE_ERROR_NOT_CONNECTED Connection to the daemon failed + * @exception #PUSH_SERVICE_ERROR_PERMISSION_DENIED No push privilege + * @exception #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @see app_control_get_operation() + */ +char *push_service_app_control_to_noti_data(app_control_h app_control, char *operation); + +/** + * @brief Retrieves the notification that forcibly launched the app. + * @details When a notification arrives at the device with the "LAUNCH"\n + * option or a user clicks a notification in the quick panel,\n + * the push daemon forcibly launches the app and delivers the\n + * notification to the app as a bundle. This function returns\n + * the notificaiton from the bundle. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/push + * @remark This function must be called in the app control callback function.\n + * You must release the notification using push_service_free_notification(). + * @param[in] app_control The app control handle that is handed over in the\n + * app control callback function + * @param[in] operation The operation in the app control handle retrieved by\n + * app_control_get_operation() + * @param[out] noti The handle of the notification that forcibly launched the app + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_NO_DATA Not launched by a notification + * @retval #PUSH_SERVICE_ERROR_OPERATION_FAILED Operation fail + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NOT_CONNECTED Connection to the daemon failed + * @retval #PUSH_SERVICE_ERROR_PERMISSION_DENIED No push privilege + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @see push_service_free_notificaiton() + * @see app_control_get_operation() + */ +int push_service_app_control_to_notification(app_control_h app_control, char *operation, push_service_notification_h *noti); + +/** + * @brief Gets notification data sent by the server. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remarks You must release @a data using free(). + * @param[in] notification The notification handle + * @param[out] data The notification data\n + * Set NULL if error but PUSH_SERVICE_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NO_DATA No data available + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @see push_service_notify_cb() + * @see push_service_request_unread_notification() + */ +int push_service_get_notification_data(push_service_notification_h notification, char **data); + +/** + * @brief Gets the notification message sent by the server. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remark The msg must be released with free().\n + * push_service_request_unread_notification() is\n + * preferred to this API. + * @param[in] notification The notification handle + * @param[out] msg The notification message\n + * Set NULL if error but PUSH_SERVICE_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NO_DATA No data available + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @see push_service_notify_cb() + * @see push_service_get_unread_notification() + */ +int push_service_get_notification_message(push_service_notification_h notification, + char **msg); + +/** + * @brief Gets the received time of the notification message. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @param[in] notification The notification handle + * @param[out] received_time The received time of the notification message \n + * The @a received_time is based on UTC. + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_NO_DATA No data available + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @see push_service_notify_cb() + * @see push_service_request_unread_notification() + */ +int push_service_get_notification_time(push_service_notification_h notification, long long int *received_time); + +/** + * @brief Gets the sender of the notification. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remarks You must release @a sender using free(). + * @param[in] notification The notification handle + * @param[out] sender The sender\n + * Set @c NULL if error but #PUSH_SERVICE_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NO_DATA No data available + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @see push_service_notify_cb() + * @see push_serivce_get_unread_notification() + */ +int push_service_get_notification_sender(push_service_notification_h notification, + char **sender); + +/** + * @brief Gets the session ID of the notification. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remarks You must release @a session_info using free(). + * @param[in] notification The notification handle + * @param[out] session_info The session ID\n + * Set @c NULL if error but #PUSH_SERVICE_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NO_DATA No data available + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @see push_service_notify_cb() + * @see push_service_request_unread_notification() + */ +int push_service_get_notification_session_info(push_service_notification_h notification, + char **session_info); + + +/** + * @brief Gets the request ID assigned by the sender. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remarks You must release @a request_id using free(). + * @param[in] notification The notification handle + * @param[out] request_id The request ID\n + * Set @c NULL if error but #PUSH_SERVICE_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NO_DATA No data available + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @see push_service_notify_cb() + * @see push_service_request_unread_notification() + */ +int push_service_get_notification_request_id(push_service_notification_h notification, + char **request_id); + +/** + * @brief Gets the value in the type field of the notification + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @param[in] notification The notification handle + * @param[out] type The type value assigned by the sender + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_NO_DATA No data available + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * @see push_service_notify_cb() + * @see push_service_request_unread_notification() + */ +int push_service_get_notification_type(push_service_notification_h notification, int *type); + +/** + * @brief Gets an unread notification message from the push server. + * @details If an application receives an unread message with this method, the message is removed from the system. \n + * This method can be called repeatedly until it returns PUSH_SERVICE_ERROR_NO_DATA \n + * But, this method does NOT guarantee order and reliability of notification messages. \n + * Some notification messages can be dropped when the system message queue is full. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remarks It is recommended to use push_service_request_unread_notification(). + * @remarks You must release @a noti using push_service_free_notification(). + * @param[in] connection The connection handle to the push service + * @param[out] noti The notification handle + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NO_DATA No data available + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * + * @see push_service_get_notification_message() + * @see push_service_get_notification_time() + * @see push_service_get_notification_data() + */ +int push_service_get_unread_notification(push_service_connection_h connection, + push_service_notification_h *noti); + +/** + * @brief Requests unread notification messages to the push server. + * @details When the app wants to receive messages that arrived before it launched, this \n + * method should be called. Upon receiving ths request, the daemon sends messages\n + * stored in its DB to the app. The notify_callback() method assigned in push_service_connect()\n + * will be called when these messages arrive. No need to call this method multiple\n + * times to receive multiple messages. This method does NOT guarantee order and\n + * reliability of notification messages. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remarks This method is preferred to push_service_get_unread_notification(). + * @param[in] connection The connection handle to the push service + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_NOT_CONNECTED Not connected to the daemon + * @retval #PUSH_SERVICE_ERROR_OPERATION_FAILED Error when sending the request + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + * + * @see push_service_get_unread_notification() + * @see push_service_connect() + */ +int push_service_request_unread_notification(push_service_connection_h connection); + +/** + * @brief Gets the registration ID in the PUSH_SERVICE_STATE_REGISTERED state. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remarks You must release @a reg_id using free(). + * @param[in] connection The connection handle to the push service + * @param[out] reg_id The registration ID\n + * Set NULL if error but PUSH_SERVICE_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NO_DATA No registration ID available + * @retval #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + */ +int push_service_get_registration_id(push_service_connection_h connection, char **reg_id); + +/** + * @brief Frees the notification handle. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remark The specific error code can be obtained using the get_last_result()\n + * Error codes are described in the exception section. + * @param[in] noti The notification handle + * @exception #PUSH_SERVICE_ERROR_NONE Successful + * @exception #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @exception #PUSH_SERVICE_ERROR_NOT_SUPPORTED Not supported feature + */ +void push_service_free_notification(push_service_notification_h noti); + +/** + * @} + */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __PUSH_PUBLIC_LIB_H__ */ diff --git a/include/push.h b/include/push.h new file mode 100755 index 0000000..e2d4ae8 --- /dev/null +++ b/include/push.h @@ -0,0 +1,458 @@ +/* + * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __PUSH_LIB_H__ +#define __PUSH_LIB_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file push.h + */ + +/** + * @internal + * @addtogroup CAPI_MESSAGING_PUSH_MODULE + * @{ + */ + +/** + * @brief Enumeration of error codes for push API. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef enum { + PUSH_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */ + PUSH_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ + PUSH_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ + PUSH_ERROR_NOT_CONNECTED = TIZEN_ERROR_CONNECTION, /**< Not connected */ + PUSH_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA, /**< No data available */ + PUSH_ERROR_OPERATION_FAILED = TIZEN_ERROR_UNKNOWN, /**< Internal operation failed */ + PUSH_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< No privilege to access the push service */ +} push_error_e; + +/** + * @brief Enumeration of registration states. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef enum { + PUSH_STATE_REGISTERED, /**< Registered */ + PUSH_STATE_UNREGISTERED, /**< Unregistered */ + PUSH_STATE_PROVISIONING_IPCHANGE, /**< To change the provisioning server IP */ + PUSH_STATE_PING_CHANGE, /**< Ping interval is changing */ + PUSH_STATE_ERROR, /**< Error */ +} push_state_e; + +/** + * @brief Enumeration of result. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef enum { + PUSH_RESULT_SUCCESS, /**< Successful */ + PUSH_RESULT_TIMEOUT, /**< Request timed out */ + PUSH_RESULT_SERVER_ERROR, /**< Push server error */ + PUSH_RESULT_SYSTEM_ERROR, /**< System error */ +} push_result_e; + +/** + * @brief Connection to the push service handle. + */ +typedef struct push_connection_s *push_connection_h; + +/** + * @brief Notification delivered from the push server handle. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + */ +typedef struct push_notification_s *push_notification_h; + +/** + * @brief Called when the registration state is refreshed. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @remarks This callback will be invoked when the registration state is refreshed. \n + * If the registration or deregistration has succeeded, then this state callback must be called. \n + * In addition, the state can be changed if the push server deregisters the application. + * @param[in] state The registration state + * @param[in] err The error message + * @param[in] user_data The user data passed to this callback + * @see push_connect() + */ +typedef void (*push_state_cb)( + push_state_e state, const char *err, void *user_data); + +/** + * @brief Called to handle a notification. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @param[in] notification A handle of the notification containing its payload \n + * The handle is available inside this callback only. + * @param[in] user_data The user data passed to this callback + * @see push_connect() + * @see push_get_notification_data() + */ +typedef void (*push_notify_cb)( + push_notification_h noti, void *user_data); + +/** + * @brief Called with the result of a registration/deregistration. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @param[in] result The registration/deregistration result + * @param[in] msg The result message from the push server, + * otherwise @c NULL + * @param[in] user_data The user data passed to this callback + * @see push_register() + * @see push_deregister() + */ +typedef void (*push_result_cb)(push_result_e result, const char *msg, void *user_data); + +/** + * @brief Connects to the push service and sets callback functions. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/push + * @remarks If there is a connection between an application and the push service, + * the notify callback passes the notification upon its arrival.\n + * Otherwise, the push service posts a UI notification to alert users.\n + * The connection should be freed using push_disconnect(). + * @param[in] app_id The application ID + * @param[in] state_cb The state callback function + * @param[in] notify_cb The notify callback function + * @param[in] user_data The user data to pass to @a state_cb and @a notify_cb + * @param[out] connection The connection handle to the push service + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_ERROR_NOT_CONNECTED Connection to the daemon failed + * @retval #PUSH_ERROR_PERMISSION_DENIED No push privilege + * @pre There is no connection for the @a app_id to the push service. + * @post The state callback will be called to let you know the current + * registration state immediately. + * @see push_disconnect() + */ +int push_connect(const char *push_app_id, push_state_cb state_callback, + push_notify_cb notify_callback, void *user_data, + push_connection_h *connection); + +/** + * @brief Closes the connection and releases all its resources. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @remarks If you call this function in the push callback functions, + * it may cause your application to crash. + * @param[in] connection A connection to the push service handle + * @see push_connect() + */ +void push_disconnect(push_connection_h connection); + +/** + * @brief Registers an application to the push server. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @param[in] connection The connection handle to the push service + * @param[in] app_control An @ref CAPI_APP_CONTROL_MODULE handle to launch an application by\n + * an posted UI notification + * @param[in] result_callback Result callback function + * @param[in] user_data The user data to pass to @a result_cb + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_ERROR_NOT_CONNECTED No connection to the push service + * @retval #PUSH_ERROR_OPERATION_FAILED Operation failed + * @pre The application should be connected to the push service. + * @post For successful result, the state callback should be invoked. + * @see push_deregister() + */ +int push_register(push_connection_h connection, app_control_h app_control, + push_result_cb result_callback, void *user_data); + +/** + * @brief Deregisters an application from the Push server. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @param[in] connection The connection handle to the push service + * @param[in] result_callback Result callback function + * @param[in] user_data The user data to pass to @a result_cb + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_ERROR_NOT_CONNECTED No connection to the push service + * @retval #PUSH_ERROR_OPERATION_FAILED Operation failed + * @pre The application should be connected to the push service. + * @post As a result, the state callback will be invoked. + * @see push_register() + */ +int push_deregister(push_connection_h connection, push_result_cb result_callback, + void *user_data); + +/** + * @brief Gets the payload data in the notification. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @remarks You must release @a data using free(). + * @param[in] notification The notification handle + * @param[out] data The notification data\n + * Set @c NULL if error but #PUSH_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_ERROR_NO_DATA No data available + * @see push_notify_cb() + * @see push_request_unread_notification() + */ +int push_get_notification_data(push_notification_h notification, char **data); + +/** + * @brief Gets the message in the notification. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @remarks You must release @a msg using free(). + * @param[in] notification The notification handle + * @param[out] msg The notification message\n + * Set @c NULL if error but #PUSH_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_ERROR_NO_DATA No data available + * @see push_notify_cb() + * @see push_request_unread_notification() + */ +int push_get_notification_message(push_notification_h notification, + char **msg); + +/** + * @brief Gets the received time of the notification. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @param[in] notification The notification handle + * @param[out] received_time The received time of the notification message\n + * The @a received_time is based on UTC. + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_NO_DATA No data available + * + * @see push_notify_cb() + * @see push_request_unread_notification() + */ +int push_get_notification_time(push_notification_h notification, long long int *received_time); + +/** + * @brief Gets the sender of the notification. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @remarks You must release @a sender using free(). + * @param[in] notification The notification handle + * @param[out] sender The sender\n + * Set @c NULL if error but #PUSH_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_ERROR_NO_DATA No data available + * @see push_notify_cb() + * @see push_request_unread_notification() + */ +int push_get_notification_sender(push_notification_h notification, + char **sender); + +/** + * @brief Gets the session ID of the notification. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @remarks You must release @a session_info using free(). + * @param[in] notification The notification handle + * @param[out] session_info The session ID\n + * Set @c NULL if error but #PUSH_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_ERROR_NO_DATA No data available + * @see push_notify_cb() + * @see push_request_unread_notification() + */ +int push_get_notification_session_info(push_notification_h notification, + char **session_info); + + +/** + * @brief Gets the request ID assigned by the sender. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @remarks You must release @a request_id using free(). + * @param[in] notification The notification handle + * @param[out] request_id The request ID\n + * Set @c NULL if error but #PUSH_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_ERROR_NO_DATA No data available + * @see push_notify_cb() + * @see push_request_unread_notification() + */ +int push_get_notification_request_id(push_notification_h notification, + char **request_id); + +/** + * @brief Gets the value in the type field of the notification + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @param[in] notification The notification handle + * @param[out] type The type value assigned by the sender + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_NO_DATA No data available + * @see push_notify_cb() + * @see push_request_unread_notification() + */ +int push_get_notification_type(push_notification_h notification, int *type); + +/** + * @brief Gets an unread notification message from the push server. + * + * @details If an application receives an unread message with this method, the message is removed from the system.\n + * This method can be called repeatedly until it returns #PUSH_ERROR_NO_DATA.\n + * However, this method does NOT guarantee order and reliability of notification messages.\n + * Some notification messages can be dropped when the system message queue is full. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @remarks This method will be deprecated. + * @remarks You must release @a noti using push_free_notification(). + * push_request_unread_notification() is preferred to this API. + * @param[in] connection The connection handle to the push service + * @param[out] noti The notification handle + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_ERROR_NO_DATA No data available + * + * @see push_get_notification_message() + * @see push_get_notification_time() + * @see push_get_notification_data() + */ +int push_get_unread_notification(push_connection_h connection, + push_notification_h *noti); + +/** + * @brief Requests unread notification messages to the push server. + * @details When the app wants to receive messages that arrived before it launced, this \n + * method should be called. Upon receiving ths request, the daemon sends messages\n + * stored in its DB to the app. The notify_callback() method assigned in push_connect()\n + * will be called when these messages arrive. No need to call this method multiple\n + * times to receive multiple messages. This method does NOT guarantee order and\n + * reliability of notification messages. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @remark This method is preferred to push_get_unread_notification(). + * @param[in] connection The connection handle to the push service + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_NOT_CONNECTED Not connected to the daemon + * @retval #PUSH_ERROR_OPERATION_FAILED Error when sending the request + * + * @see push_get_unread_notification() + * @see push_connect() + */ +int push_request_unread_notification(push_connection_h connection); + +/** + * @brief Retrieves the notification with the notification token + * @details When the push service forcibly launches the application to\n + deliver a notification, a unique token for the notification\n + is generated and delivered to the application as a bundle.\n + Using this API with this token, the application can get\n + the notification. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/push + * @remark This function must be called in the app control callback function.\n + * You must release the notification using push_free_notification(). + * @param[in] noti_token The notification token received from the bundle + * @param[out] noti The handle for the notification that launched this app + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_SERVICE_ERROR_NONE Successful + * @retval #PUSH_SERVICE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_SERVICE_ERROR_NO_DATA No notification for this token + * @retval #PUSH_SERVICE_ERROR_OPERATION_FAILED Operation fail + * @retval #PUSH_SERVICE_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_SERVICE_ERROR_NOT_CONNECTED Connection to the daemon failed + * @retval #PUSH_SERVICE_ERROR_PERMISSION_DENIED No push privilege + * @see push_free_notificaiton() + * @see app_control_get_operation() + */ +int push_get_notification_using_token(const char *noti_token, push_notification_h *noti); + + +/** + * @brief Gets the registration ID in the @a #PUSH_STATE_REGISTERED state. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @remarks You must release @a reg_id using free(). + * @param[in] connection The connection handle to the push service + * @param[out] reg_id The registration ID + * Set @c NULL if error but #PUSH_ERROR_INVALID_PARAMETER + * @return @c 0 on success, + * otherwise a negative error value + * @retval #PUSH_ERROR_NONE Successful + * @retval #PUSH_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #PUSH_ERROR_OUT_OF_MEMORY Out of memory + * @retval #PUSH_ERROR_NO_DATA No registration ID available + */ +int push_get_registration_id(push_connection_h connection, char **reg_id); + + +/** + * @brief Frees the notification handle. + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/push + * @param[in] noti The notification handle + */ +void push_free_notification(push_notification_h noti); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __PUSH_LIB_H__ */ diff --git a/libpush.manifest b/libpush.manifest new file mode 100644 index 0000000..f2b785f --- /dev/null +++ b/libpush.manifest @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/packaging/push.spec b/packaging/push.spec old mode 100755 new mode 100644 index f6ec170..4a393ab --- a/packaging/push.spec +++ b/packaging/push.spec @@ -1,24 +1,35 @@ +%global _support_weblog 0 + Name: push -Summary: Push services and client library. -Version: 0.2.23 +Summary: Push services and client library.. +Version: 0.4.06 Release: 1 -Group: TO_BE_FILLED -License: TO_BE_FILLED +Group: Application Framwork/Service +License: Apache-2.0 Source0: %{name}-%{version}.tar.gz - +Source1: pushd.service +Requires(post): /sbin/ldconfig +Requires(post): /usr/bin/sqlite3 +Requires(post): /usr/bin/vconftool +Requires(postun): /sbin/ldconfig + +%if %{_support_weblog} +BuildRequires: pkgconfig(zlib) +BuildRequires: pkgconfig(json-glib-1.0) +%endif %description Push services and client library. %package -n libpush Summary: Push service client library -Group: TO_BE_FILLED +Group: Application Framwork/Libraries +Requires: %{name}-bin = %{version}-%{release} Provides: libpush.so.0 %description -n libpush Push service client library - %package -n libpush-devel Summary: Push service client library (DEV) Group: devel @@ -28,15 +39,14 @@ Requires: capi-appfw-application-devel %description -n libpush-devel Push service client library (DEV) - %package bin Summary: Push service daemon -Group: TO_BE_FILLED +Group: Application Framwork/Service +Requires(post): telephony-daemon %description bin Push service daemon - %package tool Summary: Push service tool Group: devel @@ -46,8 +56,6 @@ Requires: %{name}-bin = %{version}-%{release} %description tool Push service tool - - %prep %setup -q @@ -55,87 +63,80 @@ Push service tool %install rm -rf %{buildroot} +mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants +install -m 0644 %{SOURCE1} %{buildroot}%{_libdir}/systemd/system/pushd.service +ln -s ../pushd.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/pushd.service +mkdir -p %{buildroot}/usr/lib/systemd/user/tizen-middleware.target.wants +cp %{SOURCE1} %{buildroot}/usr/lib/systemd/user/pushd.service +ln -s ../pushd.service %{buildroot}/usr/lib/systemd/user/tizen-middleware.target.wants/ + +mkdir -p %{buildroot}/usr/share/license +cp -f LICENSE %{buildroot}/usr/share/license/%{name} + +%if %{_support_weblog} +cp -a share/push/push_sslkey.pem %{buildroot}/usr/share/push/ +cp -a share/push/prd-dl-key.pem %{buildroot}/usr/share/push/ +%endif -mkdir -p %{buildroot}%{_bindir} -mkdir -p %{buildroot}%{_libdir}/pkgconfig mkdir -p %{buildroot}%{_includedir} -mkdir -p %{buildroot}/usr/share/push -mkdir -p %{buildroot}%{_sysconfdir}/init.d -mkdir -p %{buildroot}%{_sysconfdir}/rc.d/{rc3.d,rc5.d} -mkdir -p %{buildroot}%{_libdir}/systemd/user/tizen-middleware.target.wants +cp -a include/push-service.h %{buildroot}%{_includedir} +cp -a include/push.h %{buildroot}%{_includedir} +%if %{_support_weblog} + include/pushlog.h %{buildroot}%{_includedir} +%endif + +mkdir -p %{buildroot}%{_libdir}/pkgconfig +cp -a push.pc %{buildroot}%{_libdir}/pkgconfig/ +mkdir -p %{buildroot}/usr/share/push/ +mkdir -p %{buildroot}%{_bindir} %ifarch %{arm} #libpush cp -a arm/lib/libpush.so.* %{buildroot}%{_libdir} -#libpush-devel -cp -a arm/include/push.h %{buildroot}%{_includedir} -cp -a arm/lib/pkgconfig/push.pc %{buildroot}%{_libdir}/pkgconfig/push.pc +#libpus-devel cp -a arm/lib/libpush.so %{buildroot}%{_libdir} #push-bin cp -a arm/bin/pushd %{buildroot}%{_bindir} -cp -a arm/share/push/PushServerTrust.cer %{buildroot}/usr/share/push/PushServerTrust.cer -cp -a arm/etc/init.d/pushd %{buildroot}%{_sysconfdir}/init.d/pushd -cp -a arm/etc/rc.d/rc3.d/S90pushd %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S90pushd -cp -a arm/etc/rc.d/rc5.d/S90pushd %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S90pushd -cp -a arm/lib/systemd/user/pushd.service %{buildroot}%{_libdir}/systemd/user/pushd.service -cp -a arm/lib/systemd/user/tizen-middleware.target.wants/pushd.service %{buildroot}%{_libdir}/systemd/user/tizen-middleware.target.wants/pushd.service -#push-tool cp -a arm/bin/push_tool %{buildroot}%{_bindir} +cp -a arm/share/push/*.cer %{buildroot}/usr/share/push/ +%if %{_support_weblog} + arm/bin/pushlog_tool +%endif %else #libpush cp -a x86/lib/libpush.so.* %{buildroot}%{_libdir} -#libpush-devel -cp -a x86/include/push.h %{buildroot}%{_includedir} -cp -a x86/lib/pkgconfig/push.pc %{buildroot}%{_libdir}/pkgconfig/push.pc +#libpus-devel cp -a x86/lib/libpush.so %{buildroot}%{_libdir} #push-bin cp -a x86/bin/pushd %{buildroot}%{_bindir} -cp -a x86/share/push/PushServerTrust.cer %{buildroot}/usr/share/push/PushServerTrust.cer -cp -a x86/etc/init.d/pushd %{buildroot}%{_sysconfdir}/init.d/pushd -cp -a x86/etc/rc.d/rc3.d/S90pushd %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S90pushd -cp -a x86/etc/rc.d/rc5.d/S90pushd %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S90pushd -cp -a x86/lib/systemd/user/pushd.service %{buildroot}%{_libdir}/systemd/user/pushd.service -cp -a x86/lib/systemd/user/tizen-middleware.target.wants/pushd.service %{buildroot}%{_libdir}/systemd/user/tizen-middleware.target.wants/pushd.service -#push-tool cp -a x86/bin/push_tool %{buildroot}%{_bindir} +cp -a x86/share/push/*.cer %{buildroot}/usr/share/push/ +%if %{_support_weblog} + x86/bin/pushlog_tool +%endif %endif + %post bin -mkdir -p /opt/dbspace -sqlite3 /opt/dbspace/.push.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null -chown root:5000 /opt/dbspace/.push.db -chown root:5000 /opt/dbspace/.push.db-journal -chmod 660 /opt/dbspace/.push.db -chmod 660 /opt/dbspace/.push.db-journal - - -_VER="1" -_DEV_TYPE="00000000" -_DEV_INFO="device.model=ssltest" -_IP_PV="gld.push.samsungosp.com" -_PORT_PV=5223 -#ping interval {120,240,480,960,1920} -_PING_INT=480 -_GRP="-g 5000" - -vconftool set -t string file/private/push-bin/version ${_VER} ${_GRP} -f -vconftool set -t string file/private/push-bin/dev_type ${_DEV_TYPE} ${_GRP} -f -vconftool set -t string file/private/push-bin/dev_info ${_DEV_INFO} ${_GRP} -f -vconftool set -t string file/private/push-bin/ip_pv ${_IP_PV} ${_GRP} -f -vconftool set -t int file/private/push-bin/port_pv ${_PORT_PV} ${_GRP} -f -vconftool set -t int file/private/push-bin/ping_int ${_PING_INT} ${_GRP} -f - -vconftool unset file/private/push-bin/devtk +mkdir -p /opt/usr/dbspace +sqlite3 /opt/usr/dbspace/.push.db "PRAGMA journal_mode = PERSIST; create table a(a); drop table a;" > /dev/null +chown root:5000 /opt/usr/dbspace/.push.db +chown root:5000 /opt/usr/dbspace/.push.db-journal +chmod 660 /opt/usr/dbspace/.push.db +chmod 660 /opt/usr/dbspace/.push.db-journal + +chsmack -a 'push-service::db' /opt/usr/dbspace/.push.db +chsmack -a 'push-service::db' /opt/usr/dbspace/.push.db-journal %post -n libpush /sbin/ldconfig %postun -p /sbin/ldconfig - %files -n libpush +%manifest libpush.manifest %attr(644,-,-) %{_libdir}/libpush.so.* %files -n libpush-devel @@ -144,18 +145,37 @@ vconftool unset file/private/push-bin/devtk %{_libdir}/libpush.so %files bin +%manifest push-bin.manifest %{_bindir}/pushd /usr/share/push/*.cer -/etc/init.d/pushd -/etc/rc.d/rc3.d/S90pushd -/etc/rc.d/rc5.d/S90pushd +/usr/share/license/%{name} + +# This is a certificate file to access to logging server by HTTPS. +%if %{_support_weblog} +/usr/share/push/push_sslkey.pem +/usr/share/push/prd-dl-key.pem +%endif + /usr/lib/systemd/user/pushd.service /usr/lib/systemd/user/tizen-middleware.target.wants/pushd.service +%{_libdir}/systemd/system/multi-user.target.wants/pushd.service +%{_libdir}/systemd/system/pushd.service %files tool +%manifest push-tool.manifest %{_bindir}/push_tool +%if %{_support_weblog} + %{_bindir}/pushlog_tool +%endif + %changelog +* Sat Nov 3 2012 Jooseok Park - 0.2.26 +- Prevent bug fixed(out-of bounds read, dead code,..) +* Mon Oct 22 2012 Jooseok Park - 0.2.25 +- bundle null check added & protobuf null check added +* Wed Sep 19 2012 Jooseok Park - 0.2.24 +- when pkg is uninstlled, db process is added * Fri Sep 7 2012 Jooseok Park - 0.2.23 - emul check logic is changed(using capi-system-info) * Tue Sep 4 2012 Jooseok Park - 0.2.22 diff --git a/packaging/pushd.service b/packaging/pushd.service old mode 100644 new mode 100755 index 0603ebf..442ca3c --- a/packaging/pushd.service +++ b/packaging/pushd.service @@ -1,9 +1,12 @@ [Unit] -Description=Pushd service +Description=Push daemon +After=tizen-runtime.target [Service] Type=forking ExecStart=/usr/bin/pushd +Restart=always +MemoryLimit=10M [Install] -WantedBy=tizen-middleware.target +WantedBy=multi-user.target diff --git a/push-bin.manifest b/push-bin.manifest new file mode 100644 index 0000000..768b76d --- /dev/null +++ b/push-bin.manifest @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/push-tool.manifest b/push-tool.manifest new file mode 100644 index 0000000..8773fef --- /dev/null +++ b/push-tool.manifest @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/arm/lib/pkgconfig/push.pc b/push.pc similarity index 99% rename from arm/lib/pkgconfig/push.pc rename to push.pc index b7919a2..ed29ff7 100644 --- a/arm/lib/pkgconfig/push.pc +++ b/push.pc @@ -11,4 +11,3 @@ Version: 0.2.12 Requires: capi-appfw-application Libs: -L${libdir} -lpush Cflags: -I${includedir} - diff --git a/share/push/prd-dl-key.pem b/share/push/prd-dl-key.pem new file mode 100644 index 0000000..34539ef --- /dev/null +++ b/share/push/prd-dl-key.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDTDCCArWgAwIBAgIJAIPbVe1K1TpOMA0GCSqGSIb3DQEBBQUAMIG9MQswCQYD +VQQGEwJLUjEUMBIGA1UECAwLR3llb25nZ2ktZG8xDjAMBgNVBAcMBVN1d29uMSUw +IwYDVQQKDBxTQU1TVU5HIEVMRUNUUk9OSUNTIENPLiwgTFREMRswGQYDVQQLDBJQ +bGF0Zm9ybSBkZXYgdGVhbS4xIjAgBgNVBAMMGSouYmlnZGF0YS5zc3Auc2Ftc3Vu +Zy5jb20xIDAeBgkqhkiG9w0BCQEWEWFkbWluQHNhbXN1bmcuY29tMCAXDTEzMDUy +OTA3MjcyOVoYDzIwNjMwNTE3MDcyNzI5WjCBvTELMAkGA1UEBhMCS1IxFDASBgNV +BAgMC0d5ZW9uZ2dpLWRvMQ4wDAYDVQQHDAVTdXdvbjElMCMGA1UECgwcU0FNU1VO +RyBFTEVDVFJPTklDUyBDTy4sIExURDEbMBkGA1UECwwSUGxhdGZvcm0gZGV2IHRl +YW0uMSIwIAYDVQQDDBkqLmJpZ2RhdGEuc3NwLnNhbXN1bmcuY29tMSAwHgYJKoZI +hvcNAQkBFhFhZG1pbkBzYW1zdW5nLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEAlGwP7mw/gHSM1/xaO2xVIv9QSQpAeP6bzc4JhLChTcbpyeXHfZf24em/ +pu8ocIDrO6AtEWuLmiHhdo1dWwEOjn3uZkdzmZv3DCanLgM+QRcU7EyhwAVXns6P +YDeUyU896QJZh1jnaiD2Wi9tNJBCoTOqb0u6sQZRuhtOg9Sti4ECAwEAAaNQME4w +HQYDVR0OBBYEFFuRWZUawqsPc2NKTbkxgp1LqtvFMB8GA1UdIwQYMBaAFFuRWZUa +wqsPc2NKTbkxgp1LqtvFMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEA +LAxLc9bZ8Hz7al2INLbqjSZ80rs1rYS0vCSUpNu2wU+AacgK5Fj6/5LlFoalT96Y +xpqtt9ojYsTFrQPHv+JeHpvd+NlHHZASseXq/2IevcczNozP9i5ipXTJPX8eEMwo +IvaV7mE5TU47OXVbpnk9t7oUPAoptByDMUKfbLTUol0= +-----END CERTIFICATE----- diff --git a/share/push/push_sslkey.pem b/share/push/push_sslkey.pem new file mode 100644 index 0000000..af076aa --- /dev/null +++ b/share/push/push_sslkey.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICWwIBAAKBgQCUbA/ubD+AdIzX/Fo7bFUi/1BJCkB4/pvNzgmEsKFNxunJ5cd9 +l/bh6b+m7yhwgOs7oC0Ra4uaIeF2jV1bAQ6Ofe5mR3OZm/cMJqcuAz5BFxTsTKHA +BVeezo9gN5TJTz3pAlmHWOdqIPZaL200kEKhM6pvS7qxBlG6G06D1K2LgQIDAQAB +AoGAbl0cS5G6dm4z/Lbs8ZrQg8GNlYJGBrJscFBwy3X7u7XZSgPOnxlMvxftJthX +HbD/OcsVOArcN7RRzrG3ZWAXzcL5ooSQzRuyQz/YyRiVT3fowSBMlj5xnSHayUN+ +3BMU2ngbL+AnOFq7YkMKaXXbj07uLKZJpvDotRC6raQUBAECQQDD4r44NUx111N8 +h0vF6bauo7UEFPfIoV4UxtoVISsD3CoyywSHYzTKdYNQeC9SqAw6xL+4qRjgjCXF +ExlhiuVxAkEAwfh2wHLYhlhgrCmg92L/S9ewu3s+e1TBWS/+/RxwKTXB2kO56uz/ +OC7c444uRwMiy9EYbSY+WJUyiQrn1xW/EQJAfRiHvCOlkbgSk/tfU6Qey0a26kVt +vE35ZDFdwpKtAskOleN7H+8mHomPc8tdBV9WeA2AFrC+t2ApGsNIuTdXsQJAaJum +74MAYvOmrzKELOam6DAakAGXYMwEuiS4T6jWlGL5eMytp5TIz3P2jIJRUtrOGT1a +/wJw/TT5XA8VmVmRAQJAauTkUlAHf3uCUI8/0DpIBcTFuk30hjUqIn3h/xj20wtr +YfAuZ8RtP4LQAJmcMOREiZ/+DQJkUDH3O9bA0VhnHg== +-----END RSA PRIVATE KEY----- diff --git a/x86/bin/push_tool b/x86/bin/push_tool index 8900e26..0149c22 100755 Binary files a/x86/bin/push_tool and b/x86/bin/push_tool differ diff --git a/x86/bin/pushd b/x86/bin/pushd index dd7b50a..9ce03ef 100755 Binary files a/x86/bin/pushd and b/x86/bin/pushd differ diff --git a/x86/etc/init.d/pushd b/x86/etc/init.d/pushd deleted file mode 100755 index 09f9681..0000000 --- a/x86/etc/init.d/pushd +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -DESC="Push service daemon" -NAME=pushd -DAEMON=/usr/bin/$NAME -SCRIPTNAME=/etc/init.d/$NAME - -[ -x "$DAEMON" ] || exit 0 - -do_start() { - PID=`pidof $NAME` - [ -z "$PID" ] || return 1 - $DAEMON - RETVAL=$? - return "$RETVAL" -} - -do_stop() { - PID=`pidof $NAME` - if [ -n "$PID" ]; then - kill $PID - fi - return 0 -} - -prt_res() { - RETVAL=$1 - - case "$RETVAL" in - 0|1) - echo "... done." - RETVAL=0 - ;; - *) - echo "... failed!" - RETVAL=1 - ;; - esac - - return $RETVAL -} - -case "$1" in - start) - echo "Starting $DESC" "$NAME" - do_start - prt_res $? - ;; - stop) - echo "Stopping $DESC" "$NAME" - do_stop - prt_res $? - ;; - *) - echo "Usage: $SCRIPTNAME {start|stop}" >&2 - exit 3 - ;; -esac - diff --git a/x86/etc/rc.d/rc3.d/S90pushd b/x86/etc/rc.d/rc3.d/S90pushd deleted file mode 120000 index 70c8ff9..0000000 --- a/x86/etc/rc.d/rc3.d/S90pushd +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/pushd \ No newline at end of file diff --git a/x86/etc/rc.d/rc5.d/S90pushd b/x86/etc/rc.d/rc5.d/S90pushd deleted file mode 120000 index 70c8ff9..0000000 --- a/x86/etc/rc.d/rc5.d/S90pushd +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/pushd \ No newline at end of file diff --git a/x86/include/push.h b/x86/include/push.h deleted file mode 100644 index a8f697d..0000000 --- a/x86/include/push.h +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apach e License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef __PUSH_LIB_H__ -#define __PUSH_LIB_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @addtogroup CAPI_MESSAGING_PUSH_MODULE - * @{ - */ - -/** - * @file push.h - * @ingroup CAPI_MESSAGING_FRAMEWORK - * @brief Support to receive push notifications - */ - -/** - * @brief Enumerations of error codes for push API - */ -typedef enum { - PUSH_ERROR_NONE = 0, /**< Successful */ - PUSH_ERROR_OUT_OF_MEMORY = -ENOMEM, /**< Out of memory */ - PUSH_ERROR_INVALID_PARAMETER = -EINVAL, /**< Invalid parameter */ - PUSH_ERROR_NOT_CONNECTED = -ENOTCONN, /**< Not connected */ - PUSH_ERROR_NO_DATA = -ENODATA, /**< No data available */ - PUSH_ERROR_OPERATION_FAILED = -0x00004300, /**< Internal operation failed */ -} push_error_e; - -/** - * @brief Enumerations of registration state - */ -typedef enum { - PUSH_STATE_REGISTERED, /**< Registred */ - PUSH_STATE_UNREGISTERED, /**< Unregistered */ - PUSH_STATE_ERROR, /**< Error */ -} push_state_e; - -/** - * @brief Enumerations of result - */ -typedef enum { - PUSH_RESULT_SUCCESS, /**< Successful */ - PUSH_RESULT_TIMEOUT, /**< Request timed out */ - PUSH_RESULT_SERVER_ERROR, /**< Push server error */ - PUSH_RESULT_SYSTEM_ERROR, /**< System error */ -} push_result_e; - -/** - * @brief Handle of a connection to the push service - */ -typedef struct push_connection_s *push_connection_h; - -/** - * @brief Handle of a notification delivered from the push server - */ -typedef struct push_notification_s *push_notification_h; - -/** - * @brief State callback - * @remarks This callback will be invoked when the regisration state is - * refreshed. If the registration or degistration has been succeeded, - * then this state callback must be called. In addition, the state - * can be changed if the push server deregisters the application. - * @param[in] state Registration state - * @param[in] err Error message - * @param[in] user_data User data passed to this callback - * @see push_connect() - */ -typedef void (*push_state_cb)( - push_state_e state, const char *err, void *user_data); - -/** - * @brief Notifcation callback - * @param[in] notification A handle of notification containing its payload. - * The handle is available inside this callback only. - * @param[in] user_data User data passed to this callback - * @see push_connect(), push_get_notification_data() - */ -typedef void (*push_notify_cb)( - push_notification_h noti, void *user_data); - -/** - * @brief Result callback - * @param[in] result Registration/deregistration result - * @param[in] msg Result message from the push server or NULL - * @param[in] user_data User data passed to this callback - * @see push_register(), push_deregister() - */ -typedef void (*push_result_cb)(push_result_e result, const char *msg, void *user_data); - -/** - * @brief Connects to the push service and sets callback functions - * @remarks If there is a connection between an application and the push service, - * the notify callback passes the notification upon its arrival. - * Otherwise, the push service posts a UI notification to alert users. - * Connection should be freed with @ref push_disconnect() by you. - * @param[in] app_id The application ID - * @param[in] state_cb State callback function - * @param[in] notify_cb Notify callback function - * @param[in] user_data User data to pass to state_cb and notify_cb - * @param[out] connection The connection handle to the push service - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_OPERATION_FAILED Operation failed - * @pre There is no connection for the app_id to the push service - * @post The state callback will be called to let you know the current - * registration state immediately. - * @see push_disconnect() - */ -int push_connect(const char *app_id, push_state_cb state_callback, - push_notify_cb notify_callback, void *user_data, - push_connection_h *connection); - -/** - * @brief Closes the connection and releases all its resources - * @remarks If you call this function in the push callback functions, - * it may cause your application crash. - * @param[in] connection Handle of a connection to the push service - * @see push_connect() - */ -void push_disconnect(push_connection_h connection); - -/** - * @brief Registers an application to the push server - * @param[in] connection The connection handle to the push service - * @param[in] service A @ref Service handle to launch an application by - * an posted UI notification - * @param[in] result_cb Result callback function - * @param[in] user_data User data to pass to result_cb - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NOT_CONNECTED No connection to the push service - * @retval PUSH_ERROR_OPERATION_FAILED Operation failed - * @pre The application should be connected to the push service - * @post For successful result, the state callback should be invoked - * @see push_deregister() - */ -int push_register(push_connection_h connection, service_h service, - push_result_cb result_callback, void *user_data); - -/** - * @brief Deregisters an application from the Push server - * @param[in] connection The connection handle to the push service - * @param[in] result_cb Result callback function - * @param[in] user_data User data to pass to result_cb - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NOT_CONNECTED No connection to the push service - * @retval PUSH_ERROR_OPERATION_FAILED Operation failed - * @pre The application should be connected to the push service - * @post In result, the state callback will be invoked - * @see push_register() - */ -int push_deregister(push_connection_h connection, push_result_cb callback, - void *user_data); - -/** - * @brief Gets notification data which its server sent - * @remark The data must be released with free() by you - * @param[in] notification The notification handle - * @param[out] data The notification data\n - * Set NULL if error but PUSH_ERROR_INVALID_PARAMETER - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NO_DATA No data available - * @see push_notify_cb() - * @see push_get_unread_notification() - */ -int push_get_notification_data(push_notification_h notification, char **data); - - -/** - * @brief Gets the notification message which its server sent - * @remark The msg must be released with free() by you - * @param[in] notification The notification handle - * @param[out] data The notification message\n - * Set NULL if error but PUSH_ERROR_INVALID_PARAMETER - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NO_DATA No data available - * @see push_notify_cb() - * @see push_get_unread_notification() - */ -int push_get_notification_message(push_notification_h notification, - char **msg); - -/** - * @brief Gets the received time of the notification message - * - * @param[in] notification The notification handle - * @param[out] received_time The received time of the notification message. \n - * The @a received_time is based on UTC. - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_NO_DATA No data available - * - * @see push_notify_cb() - * @see push_get_unread_notification() - */ -int push_get_notification_time(push_notification_h notification, long long int *received_time); - -/** - * @brief Gets an unread notification message from the push server - * - * @remark This method will be deprecated. - * @remark @a noti must be released with push_free_notification() by you - * - * @details If an application receives an unread message with this method, the message is removed from the system. \n - * This method can be called repeatedly until it returns PUSH_ERROR_NO_DATA \n - * But, this method does NOT guarantee order and reliability of notification messages. \n - * Some notification messages can be dropped when the system message queue is full. - * - * @param[in] connection The connection handle to the push service - * @param[out] noti The notification handle - * @return 0 on success, otherwise a negative error value. - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NO_DATA No data available - * - * @see push_get_notification_message() - * @see push_get_notification_time() - * @see push_get_notification_data() - */ -int push_get_unread_notification(push_connection_h connection, - push_notification_h *noti); - - -/** - * @brief Gets the registration ID in PUSH_STATE_REGISTERED state - * @remark The reg_id must be released with free() by you - * @param[in] connection The connection handle to the push service - * @param[out] reg_id The registration ID\n - * Set NULL if error but PUSH_ERROR_INVALID_PARAMETER - * @return 0 on success, otherwise a negative error value - * @retval PUSH_ERROR_NONE Successful - * @retval PUSH_ERROR_INVALID_PARAMETER Invalid parameter - * @retval PUSH_ERROR_OUT_OF_MEMORY Out of memory - * @retval PUSH_ERROR_NO_DATA No registration ID available - */ -int push_get_registration_id(push_connection_h connection, char **reg_id); - - -/** - * @brief Frees the notification handle - * @param[in] noti The notification handle - */ -void push_free_notification(push_notification_h noti); -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __PUSH_LIB_H__ */ diff --git a/x86/lib/libpush.so.0.2.12 b/x86/lib/libpush.so.0.2.12 index ff95723..864056b 100644 Binary files a/x86/lib/libpush.so.0.2.12 and b/x86/lib/libpush.so.0.2.12 differ diff --git a/x86/lib/pkgconfig/push.pc b/x86/lib/pkgconfig/push.pc deleted file mode 100644 index b7919a2..0000000 --- a/x86/lib/pkgconfig/push.pc +++ /dev/null @@ -1,14 +0,0 @@ -# Package Information for pkg-config - -prefix=/usr -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: push -Description: Push service client library -Version: 0.2.12 -Requires: capi-appfw-application -Libs: -L${libdir} -lpush -Cflags: -I${includedir} - diff --git a/x86/lib/systemd/user/pushd.service b/x86/lib/systemd/user/pushd.service deleted file mode 100644 index 0603ebf..0000000 --- a/x86/lib/systemd/user/pushd.service +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Pushd service - -[Service] -Type=forking -ExecStart=/usr/bin/pushd - -[Install] -WantedBy=tizen-middleware.target diff --git a/x86/lib/systemd/user/tizen-middleware.target.wants/pushd.service b/x86/lib/systemd/user/tizen-middleware.target.wants/pushd.service deleted file mode 120000 index 21d0bfc..0000000 --- a/x86/lib/systemd/user/tizen-middleware.target.wants/pushd.service +++ /dev/null @@ -1 +0,0 @@ -../pushd.service \ No newline at end of file