Knowledgebase
How to Create new Record in QuickBlox custom table?
Posted by on 15 May 2014 11:01 AM

How to Create new Record in QuikcBlox custom table?

Android.

In order to create record you need to be logged in http://quickblox.com/developers/SimpleSample-users-android#Sign_In_.26_Social_authorization

Next, the following can be used:

HashMap<String, Object> fields = new HashMap<String, Object>();

        fields.put("senderLoginID", ""+mylogin.toString());
    fields.put("receiverLoginID", ""+friendLogin.toString());
    fields.put("messages", messageString);

    fields.put("isRead", false);


QBCustomObject qbCustomObject = new QBCustomObject();
qbCustomObject.setClassName("Movie");  // your Class name
qbCustomObject.setFields(fields);
QBCustomObjects.createObject(qbCustomObject, new QBCallbackImpl() {
    @Override
    public void onComplete(Result result) {
        if (result.isSuccess()) {
            QBCustomObjectResult qbCustomObjectResult = (QBCustomObjectResult) result;
            QBCustomObject qbCustomObject = qbCustomObjectResult.getCustomObject();
            Log.d("New record: ",newCustomObject.toString());
        } else {
            Log.e("Errors",result.getErrors().toString());
        }
    }
});

 

iOS.

 

How to use custom objects

http://quickblox.com/developers/SimpleSample-customObjects-ios

 

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: