Want to create new Record in QuickBlox Custom Table which allready created. i have Follow the guideline Url and using below method, here i m using my Table name
HashMap<String, Object> fields = new HashMap<String, Object>();
fields.put("User ID",String.valueOf(myID));
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());
}
}
});
Error getting Like
** '{"errors":{"base":["Forbidden. Need user."]}}'
… Request has been completed with error: [base Forbidden. Need user.]
1st off all, you don't need to use this
fields.put("User ID",String.valueOf(myID));
This field will be filled on the server based on your token information
Next, you have to be logged in in order to create record, just do the next
http://quickblox.com/developers/SimpleSample-users-android#Sign_In_.26_Social_authorization