if (ret != PUSH_SERVICE_ERROR_NONE)
{
// Your implementation here
- LOGI("push_service_connect() Failed");
+ dlog_print(DLOG_INFO, LOG_TAG, "push_service_connect() Failed");
}
return true;
switch (state)
{
case PUSH_SERVICE_STATE_UNREGISTERED:
- LOGI("Arrived at STATE_UNREGISTERED");
+ dlog_print(DLOG_INFO, LOG_TAG, "Arrived at STATE_UNREGISTERED");
_on_state_unregistered(user_data);
break;
case PUSH_SERVICE_STATE_REGISTERED:
- LOGI("Arrived at STATE_REGISTERED");
+ dlog_print(DLOG_INFO, LOG_TAG, "Arrived at STATE_REGISTERED");
_on_state_registered(user_data);
break;
case PUSH_SERVICE_STATE_ERROR:
- LOGI("Arrived at STATE_ERROR");
+ dlog_print(DLOG_INFO, LOG_TAG, "Arrived at STATE_ERROR");
_on_state_error(err, user_data);
break;
default:
- LOGI("Unknown State");
+ dlog_print(DLOG_INFO, LOG_TAG, "Unknown State");
break;
}
}
static void _result_cb(push_service_result_e result, const char *msg, void *user_data)
{
if (result == PUSH_SERVICE_RESULT_SUCCESS)
- LOGI("Registration request is approved.");
+ dlog_print(DLOG_INFO, LOG_TAG, "Registration request is approved.");
else
- LOGE("Registration ERROR [%s]", msg);
+ dlog_print(DLOG_ERROR, LOG_TAG, "Registration ERROR [%s]", msg);
return;
}
ret = push_service_get_registration_id(push_conn, &reg_id);
if (ret != PUSH_SERVICE_ERROR_NONE)
{
- LOGE("ERROR [%d]: push_service_get_registration_id()", ret);
+ dlog_print(DLOG_ERROR, LOG_TAG, "ERROR [%d]: push_service_get_registration_id()", ret);
return;
}
}
</pre>
-<p>When the <span style="font-family: Courier New,Courier,monospace;">_noti_cb()</span> function is called, obtain the notification through the first parameter. The second parameter is the pointer to the user data. You can retrieve the app data, message, and time stamp from the handle using the <span style="font-family: Courier New,Courier,monospace;">push_get_notification_data()</span>, <span style="font-family: Courier New,Courier,monospace;">push_get_notification_message()</span>, and <span style="font-family: Courier New,Courier,monospace;">push_get_notification_time()</span> functions respectively. Before exiting the function, free the data. However, do not free <span style="font-family: Courier New,Courier,monospace;">noti</span> in the notification callback function. It is freed automatically right after this callback function.</p>
+<p>When the <span style="font-family: Courier New,Courier,monospace;">_noti_cb()</span> function is called, obtain the notification through the first parameter. The second parameter is the pointer to the user data. You can retrieve the app data, message, and time stamp from the handle using the <span style="font-family: Courier New,Courier,monospace;">push_service_get_notification_data()</span>, <span style="font-family: Courier New,Courier,monospace;">push_service_get_notification_message()</span>, and <span style="font-family: Courier New,Courier,monospace;">push_service_get_notification_time()</span> functions respectively. Before exiting the function, free the data. However, do not free <span style="font-family: Courier New,Courier,monospace;">noti</span> in the notification callback function. It is freed automatically right after this callback function.</p>
</li>
<li>Receive notifications when the application is not running.
</script>
</body>
-</html>
\ No newline at end of file
+</html>