Using RhoConnect without Rhodes: Objective C Client API === The RhoConnect Client is a library that adds sync data capability to your non-Rhodes applications, such as applications created in XCode or Android Java. Using this library, you can enable synchronized data between your Objective C iOS device application and a RhoConnect server. Source Code ----------- The source code for the RhoConnect client store example is located here. * [rhoconnect-client\Samples\ObjectiveC\store](http://github.com/rhomobile/rhodes/tree/master/rhoconnect-client/Samples/ObjectiveC/store/) Pre-requisite Reading --------------------- * [iOS development](http://developer.apple.com/devcenter/ios/index.action) ## Features supported
Feature | Ruby | ObjectiveC |
---|---|---|
Property bag model | yes | yes |
Fixed schema mode | yes | yes |
Model associations | yes | yes |
BLOB attributes | yes | yes |
Bulk sync | yes | yes |
Sync | yes | yes |
Notifications | yes | yes |
Database reset | yes | yes |
Authentication | yes | yes |
DB partitioning | yes | not yet |
models |
NSArray containing the model objects. |
usr |
NSString containing the user name. |
pwd |
NSString containing the password. |
usr |
NSString containing the user name. |
pwd |
NSString containing the password. |
callback:(SEL) callback target:(id)target |
The reference to the callback method. An example could be callback:@selector(loginComplete:) target:self . You would write the callback method loginComplete to perform actions when the login process completes. |
callback:(SEL) target:(id)target |
The reference to the callback method that performs actions upon a sync notification. |
models |
NSArray containing the names of the model names to search in. |
from |
(Optional) NSString. Sets the RhoConnect path that the records are fetched with. Default = "search". |
params |
NSString. A string containing the name/value search items, in the form "param1=val1¶m2=val2¶m3=val3". The values must be url-encoded. |
sync_changes |
BOOL. TRUE if data with local changes is pushed to the server before the search is performed, FALSE otherwise. |
progress_step |
(Optional) int. Define how often the search callback will be executed when the RhoConnectNotify status is "in_progress". |
(SEL) callback target:(id)target |
The name of your callback method. |
nSrcID |
int. The object ID of the source on the server with which this RHoConnectClient syncs. You can provide this with the "source\_id" property value. |
szObject |
NSString. The object ID of the item created to track the changes to this RhoConnectClient. |
notify |
RhoConnectNotify. Notification object passed to notification callback. |
action |
NSString. May be "delete" or "recreate": "delete" just remove object from client, "recreate" will push this object to server again at next sync. |
notify |
RhoConnectNotify. Notification object passed to notification callback. |
action |
NSString. May be "retry" or "rollback": "retry" will push update object operation to server again at next sync, "rollback" will write rollback objects(comes from server) to client database. |
notify |
RhoConnectNotify. Notification object passed to notification callback. |
action |
NSString. May be "retry" - will push delete object operation to server again at next sync. |
callback:(SEL) target:(id)target |
The reference to the callback method that performs actions upon a sync notification. |
data |
NSMutableDictionary. The object containing the attribute data for this model. |
object_id |
NSString. The object id. |
cond |
A NSDictionary object containing the model attributes to find. |
cond |
A NSDictionary object containing the model attributes to find. |
data |
A NSDictionary object containing the attribute data for the model object that is saved. |
data |
A NSDictionary object containing the attribute data for the model objects that are to be deleted. |
total_count |
@property int. Total number of records that exist for this RhoConnect source. |
processed_count |
@property int. Number of records included in this sync page for an in\_progress (status = incremental) sync. |
cumulative_count |
@property int. Number of records the SyncEngine has processed so far for this source. |
source_id |
@property int. The id of the current model that is synchronizing. |
error_code |
@property int. The HTTP response code of the RhoConnect server error: 401, 500, 404, etc. |
source_name |
@property(assign) NSString*. Name of the model (i.e. "Product"). |
status |
@property(assign) NSString*. Status of the current sync process: "in\_progress", "error", "ok", "complete", "schema-changed". |
sync_type |
@property(assign) NSString*. Type of sync used for this model: "incremental" or "bulk". |
error_message |
@property(assign) NSString*. Response body of error message (if any). |
callback_params |
@property(assign) NSString*. Callback parameters. |
hasCreateErrors |
(Boolean). Return true if server return create-errors. |
hasUpdateErrors |
(Boolean). Return true if server return update-errors. |
hasDeleteErrors |
(Boolean). Return true if server return delete-errors. |
isUnknownClientError |
(Boolean). Return true if server return unknown client error. |
deleted_objects |
@property(readonly) NSMutableArray*. An array containing the deleted objects. |
updated_objects |
@property(readonly) NSMutableArray*. An array containing the updated objects. |
created_objects |
@property(readonly) NSMutableArray*. An array containing the created objects. |
deleted_source_ids |
@property(readonly) NSMutableArray*. An array containing the deleted source ids. |
updated_source_ids |
@property(readonly) NSMutableArray*. An array containing the updated source ids. |
created_source_ids |
@property(readonly) NSMutableArray*. An array containing the created source ids. |