Class MobileSyncApi
Inheritance
Implements
Inherited Members
Namespace: iMobileDevice.MobileSync
Assembly: iMobileDevice-net.dll
Syntax
public class MobileSyncApi : IMobileSyncApi
Constructors
| Improve this Doc View SourceMobileSyncApi(ILibiMobileDevice)
Declaration
public MobileSyncApi(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 Sourcemobilesync_acknowledge_changes_from_device(MobileSyncClientHandle)
Acknowledges to the device that the changes have been merged on the computer MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
Declaration
public virtual MobileSyncError mobilesync_acknowledge_changes_from_device(MobileSyncClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_actions_add(PlistHandle)
Add one or more new key:value pairs to the given actions plist.
Declaration
public virtual void mobilesync_actions_add(PlistHandle actions)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | actions | The actions to modify. |
Remarks
The known keys so far are "SyncDeviceLinkEntityNamesKey" which expects an array of entity names, followed by a count paramter as well as "SyncDeviceLinkAllRecordsOfPulledEntityTypeSentKey" which expects an integer to use as a boolean value indicating that the device should link submitted changes and report remapped identifiers.
mobilesync_actions_free(PlistHandle)
Free actions plist.
Declaration
public virtual void mobilesync_actions_free(PlistHandle actions)
Parameters
Type | Name | Description |
---|---|---|
PlistHandle | actions | The actions plist to free. Does nothing if NULL is passed. |
mobilesync_actions_new()
Create a new actions plist to use in mobilesync_send_changes().
Declaration
public virtual PlistHandle mobilesync_actions_new()
Returns
Type | Description |
---|---|
PlistHandle | A new plist_t of type PLIST_DICT. |
mobilesync_anchors_free(IntPtr)
Free memory used by anchors. MOBILESYNC_E_SUCCESS on success
Declaration
public virtual MobileSyncError mobilesync_anchors_free(IntPtr anchors)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | anchors | The anchors to free. |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_anchors_new(String, String, out MobileSyncAnchorsHandle)
Allocates memory for a new anchors struct initialized with the passed anchors. MOBILESYNC_E_SUCCESS on success
Declaration
public virtual MobileSyncError mobilesync_anchors_new(string deviceAnchor, string computerAnchor, out MobileSyncAnchorsHandle anchor)
Parameters
Type | Name | Description |
---|---|---|
System.String | deviceAnchor | |
System.String | computerAnchor | |
MobileSyncAnchorsHandle | anchor |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_cancel(MobileSyncClientHandle, String)
Cancels a running synchronization session with a device at any time. MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
Declaration
public virtual MobileSyncError mobilesync_cancel(MobileSyncClientHandle client, string reason)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
System.String | reason | The reason to supply to the device for cancelling |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_clear_all_records_on_device(MobileSyncClientHandle)
Requests the device to delete all records of the current data class MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form
Declaration
public virtual MobileSyncError mobilesync_clear_all_records_on_device(MobileSyncClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
Returns
Type | Description |
---|---|
MobileSyncError |
Remarks
The operation must be called after starting synchronization.
mobilesync_client_free(IntPtr)
Disconnects a mobilesync client from the device and frees up the mobilesync client data. MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if is NULL.
Declaration
public virtual MobileSyncError mobilesync_client_free(IntPtr client)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | client | The mobilesync client to disconnect and free. |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_client_new(iDeviceHandle, LockdownServiceDescriptorHandle, out MobileSyncClientHandle)
Connects to the mobilesync service on the specified device. MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one or more parameters are invalid DEVICE_LINK_SERVICE_E_BAD_VERSION if the mobilesync version on the device is newer.
Declaration
public virtual MobileSyncError mobilesync_client_new(iDeviceHandle device, LockdownServiceDescriptorHandle service, out MobileSyncClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
iDeviceHandle | device | The device to connect to. |
LockdownServiceDescriptorHandle | service | The service descriptor returned by lockdownd_start_service. |
MobileSyncClientHandle | client | Pointer that will be set to a newly allocated mobilesync_client_t upon successful return. |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_client_start_service(iDeviceHandle, out MobileSyncClientHandle, String)
Starts a new mobilesync service on the specified device and connects to it.
Declaration
public virtual MobileSyncError mobilesync_client_start_service(iDeviceHandle device, out MobileSyncClientHandle client, string label)
Parameters
Type | Name | Description |
---|---|---|
iDeviceHandle | device | The device to connect to. |
MobileSyncClientHandle | client | Pointer that will point to a newly allocated mobilesync_client_t upon successful return. Must be freed using mobilesync_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 |
---|---|
MobileSyncError | MOBILESYNC_E_SUCCESS on success, or an MOBILESYNC_E_* error code otherwise. |
mobilesync_finish(MobileSyncClientHandle)
Finish a synchronization session of a data class on the device. A session must have previously been started using mobilesync_start(). MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form
Declaration
public virtual MobileSyncError mobilesync_finish(MobileSyncClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_get_all_records_from_device(MobileSyncClientHandle)
Requests to receive all records of the currently set data class from the device. The actually changes are retrieved using mobilesync_receive_changes() after this request has been successful. MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
Declaration
public virtual MobileSyncError mobilesync_get_all_records_from_device(MobileSyncClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_get_changes_from_device(MobileSyncClientHandle)
Requests to receive only changed records of the currently set data class from the device. The actually changes are retrieved using mobilesync_receive_changes() after this request has been successful. MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid
Declaration
public virtual MobileSyncError mobilesync_get_changes_from_device(MobileSyncClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_ready_to_send_changes_from_computer(MobileSyncClientHandle)
Verifies if the device is ready to receive changes from the computer. This call changes the synchronization direction so that mobilesync_send_changes() can be used to send changes to the device. MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does not permit this call MOBILESYNC_E_CANCELLED if the device explicitly cancelled the session MOBILESYNC_E_NOT_READY if the device is not ready to start receiving any changes
Declaration
public virtual MobileSyncError mobilesync_ready_to_send_changes_from_computer(MobileSyncClientHandle client)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_receive(MobileSyncClientHandle, out PlistHandle)
Polls the device for mobilesync data.
Declaration
public virtual MobileSyncError mobilesync_receive(MobileSyncClientHandle client, out PlistHandle plist)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
PlistHandle | plist | A pointer to the location where the plist should be stored |
Returns
Type | Description |
---|---|
MobileSyncError | an error code |
mobilesync_receive_changes(MobileSyncClientHandle, out PlistHandle, ref Char, out PlistHandle)
Receives changed entitites of the currently set data class from the device MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid MOBILESYNC_E_CANCELLED if the device explicitly cancelled the session
Declaration
public virtual MobileSyncError mobilesync_receive_changes(MobileSyncClientHandle client, out PlistHandle entities, ref char isLastRecord, out PlistHandle actions)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
PlistHandle | entities | A pointer to store the changed entity records as a PLIST_DICT |
System.Char | isLastRecord | |
PlistHandle | actions | A pointer to additional flags the device is sending or NULL to ignore |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_remap_identifiers(MobileSyncClientHandle, out PlistHandle)
Receives any remapped identifiers reported after the device merged submitted changes. MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does not permit this call MOBILESYNC_E_CANCELLED if the device explicitly cancelled the session
Declaration
public virtual MobileSyncError mobilesync_remap_identifiers(MobileSyncClientHandle client, out PlistHandle mapping)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
PlistHandle | mapping | A pointer to an array plist containing a dict of identifier remappings |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_send(MobileSyncClientHandle, PlistHandle)
Sends mobilesync data to the device
Declaration
public virtual MobileSyncError mobilesync_send(MobileSyncClientHandle client, PlistHandle plist)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
PlistHandle | plist | The location of the plist to send |
Returns
Type | Description |
---|---|
MobileSyncError | an error code |
Remarks
This function is low-level and should only be used if you need to send a new type of message.
mobilesync_send_changes(MobileSyncClientHandle, PlistHandle, Char, PlistHandle)
Sends changed entities of the currently set data class to the device MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid, MOBILESYNC_E_WRONG_DIRECTION if the current sync direction does not permit this call
Declaration
public virtual MobileSyncError mobilesync_send_changes(MobileSyncClientHandle client, PlistHandle entities, char isLastRecord, PlistHandle actions)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
PlistHandle | entities | The changed entity records as a PLIST_DICT |
System.Char | isLastRecord | |
PlistHandle | actions | Additional actions for the device created with mobilesync_actions_new() or NULL if no actions should be passed |
Returns
Type | Description |
---|---|
MobileSyncError |
mobilesync_start(MobileSyncClientHandle, Byte[], MobileSyncAnchorsHandle, UInt64, ref MobileSyncSyncType, ref UInt64, out String)
Requests starting synchronization of a data class with the device MOBILESYNC_E_SUCCESS on success MOBILESYNC_E_INVALID_ARG if one of the parameters is invalid MOBILESYNC_E_PLIST_ERROR if the received plist is not of valid form MOBILESYNC_E_SYNC_REFUSED if the device refused to sync MOBILESYNC_E_CANCELLED if the device explicitly cancelled the sync request
Declaration
public virtual MobileSyncError mobilesync_start(MobileSyncClientHandle client, byte[] dataClass, MobileSyncAnchorsHandle anchors, ulong computerDataClassVersion, ref MobileSyncSyncType syncType, ref ulong deviceDataClassVersion, out string errorDescription)
Parameters
Type | Name | Description |
---|---|---|
MobileSyncClientHandle | client | The mobilesync client |
System.Byte[] | dataClass | |
MobileSyncAnchorsHandle | anchors | The anchors required to exchange with the device. The anchors allow the device to tell if the synchronization information on the computer and device are consistent to determine what sync type is required. |
System.UInt64 | computerDataClassVersion | |
MobileSyncSyncType | syncType | |
System.UInt64 | deviceDataClassVersion | |
System.String | errorDescription |
Returns
Type | Description |
---|---|
MobileSyncError |