Class NotificationProxyApi
Inheritance
Implements
Inherited Members
Namespace: iMobileDevice.NotificationProxy
Assembly: iMobileDevice-net.dll
Syntax
public class NotificationProxyApi : INotificationProxyApi
Constructors
| Improve this Doc View SourceNotificationProxyApi(ILibiMobileDevice)
Declaration
public NotificationProxyApi(ILibiMobileDevice parent)
Parameters
Type | Name | Description |
---|---|---|
ILibiMobileDevice | parent |
Properties
| Improve this Doc View SourceParent
Declaration
public ILibiMobileDevice Parent { get; }
Property Value
Type | Description |
---|---|
ILibiMobileDevice |
Methods
| Improve this Doc View Sourcenp_client_free(IntPtr)
Disconnects a notification_proxy client from the device and frees up the notification_proxy client data.
Declaration
public virtual NotificationProxyError np_client_free(IntPtr client)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | client | The notification_proxy client to disconnect and free. |
Returns
Type | Description |
---|---|
NotificationProxyError | NP_E_SUCCESS on success, or NP_E_INVALID_ARG when client is NULL. |
np_client_new(iDeviceHandle, LockdownServiceDescriptorHandle, out NotificationProxyClientHandle)
Connects to the notification_proxy on the specified device.
Declaration
public virtual NotificationProxyError np_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out NotificationProxyClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
iDeviceHandle | device | The device to connect to. |
LockdownServiceDescriptorHandle | service | The service descriptor returned by lockdownd_start_service. |
NotificationProxyClientHandle | client | Pointer that will be set to a newly allocated np_client_t upon successful return. |
Returns
Type | Description |
---|---|
NotificationProxyError | NP_E_SUCCESS on success, NP_E_INVALID_ARG when device is NULL, or NP_E_CONN_FAILED when the connection to the device could not be established. |
np_client_start_service(iDeviceHandle, out NotificationProxyClientHandle, String)
Starts a new notification proxy service on the specified device and connects to it.
Declaration
public virtual NotificationProxyError np_client_start_service(iDeviceHandle device, out NotificationProxyClientHandle client, string label)
Parameters
Type | Name | Description |
---|---|---|
iDeviceHandle | device | The device to connect to. |
NotificationProxyClientHandle | client | Pointer that will point to a newly allocated np_client_t upon successful return. Must be freed using np_client_free() after use. |
System.String | label | The label to use for communication. Usually the program name. Pass NULL to disable sending the label in requests to lockdownd. |
Returns
Type | Description |
---|---|
NotificationProxyError | NP_E_SUCCESS on success, or an NP_E_* error code otherwise. |
np_observe_notification(NotificationProxyClientHandle, String)
Tells the device to send a notification on the specified event.
Declaration
public virtual NotificationProxyError np_observe_notification(NotificationProxyClientHandle client, string notification)
Parameters
Type | Name | Description |
---|---|---|
NotificationProxyClientHandle | client | The client to send to |
System.String | notification | The notifications that should be observed. |
Returns
Type | Description |
---|---|
NotificationProxyError | NP_E_SUCCESS on success, NP_E_INVALID_ARG when client or notification are NULL, or an error returned by np_plist_send. |
np_observe_notifications(NotificationProxyClientHandle, out String)
Tells the device to send a notification on specified events.
Declaration
public virtual NotificationProxyError np_observe_notifications(NotificationProxyClientHandle client, out string notificationSpec)
Parameters
Type | Name | Description |
---|---|---|
NotificationProxyClientHandle | client | The client to send to |
System.String | notificationSpec |
Returns
Type | Description |
---|---|
NotificationProxyError | NP_E_SUCCESS on success, NP_E_INVALID_ARG when client is null, or an error returned by np_observe_notification. |
np_post_notification(NotificationProxyClientHandle, String)
Sends a notification to the device's notification_proxy.
Declaration
public virtual NotificationProxyError np_post_notification(NotificationProxyClientHandle client, string notification)
Parameters
Type | Name | Description |
---|---|---|
NotificationProxyClientHandle | client | The client to send to |
System.String | notification | The notification message to send |
Returns
Type | Description |
---|---|
NotificationProxyError | NP_E_SUCCESS on success, or an error returned by np_plist_send |
np_set_notify_callback(NotificationProxyClientHandle, NotificationProxyNotifyCallBack, IntPtr)
This function allows an application to define a callback function that will be called when a notification has been received. It will start a thread that polls for notifications and calls the callback function if a notification has been received. In case of an error condition when polling for notifications - e.g. device disconnect - the thread will call the callback function with an empty notification "" and terminate itself.
Declaration
public virtual NotificationProxyError np_set_notify_callback(NotificationProxyClientHandle client, NotificationProxyNotifyCallBack notifyCallBack, IntPtr userdata)
Parameters
Type | Name | Description |
---|---|---|
NotificationProxyClientHandle | client | the NP client |
NotificationProxyNotifyCallBack | notifyCallBack | |
System.IntPtr | userdata |
Returns
Type | Description |
---|---|
NotificationProxyError | NP_E_SUCCESS when the callback was successfully registered, NP_E_INVALID_ARG when client is NULL, or NP_E_UNKNOWN_ERROR when the callback thread could no be created. |
Remarks
Only one callback function can be registered at the same time; any previously set callback function will be removed automatically.