Quickblox QBDialogCustomData never submitted - android

When submitting dialog to Quickblox I add QBDialogCustomData using the code below
QBDialogCustomData qbDialogCustomData=new QBDialogCustomData("UserInfoDialog");
qbDialogCustomData.putString("FBID1", myApp.getFbid());
qbDialogCustomData.putString("FBID2", fbid);
qbDialogCustomData.putString("USERID1", String.valueOf(myApp.getUserID()));
qbDialogCustomData.putString("USERID2", String.valueOf(userId));
qbDialogCustomData.putString("FULLNAME1", myApp.getFullname());
qbDialogCustomData.putString("FULLNAME2", fullname);
dialog.setCustomData(qbDialogCustomData);
However when later using the getCustomData method it returns null, what is missing to submit the QBDialogCustomData, I have the Custom object class created with the right fields so that shouldn't be an issue.

Im using QuickBlox with RESTFUL API and it works for me if I create the dialog first with the custom data/parameters then send a message but before that you must create the custom object in the admin.quickblox site first. Have you tried that method ?
I referred to this link to create the custom object in the admin quickblox site
Link : http://quickblox.com/developers/Custom_Objects#Create_data_schema

Related

How to do 3-D Secure Authentication in Mastercard Gateway Android SDK?

I followed https://github.com/Mastercard-Gateway/gateway-android-sdk/wiki this to make payment in my application.
Used test Merchant Id initially to create session by below API.
https://mtf.gateway.mastercard.com/api/rest/version/56/merchant/DB***/session/SESSION000****
Which gave session id in response and with that updated my card details in update session API.
Got success message like
{"session":{"updateStatus":"SUCCESS","version":"cd9f6b9602"}}
After that I generate a random 3DSecureId for testing and passed sessionId, AMOUNT, CURRENCY, 3dSecureId in check3DSecureEnrollment API.
But getting - Error Unexpected response code 400. I couldn't able to figure what is the issue in this params?
Another try is -
https://github.com/Mastercard-Gateway/gateway-android-sdk/wiki/3D-Secure-Authentication
Checked for option 1 & 2 in the above link. Showing Error inflating class layout InflateException.
Needed help to resolve these issues?
Me too was facing the same issue. Since there is no good documentation its hard to fix these kinds of issues. To solve the issue you mentioned, my approach was to take Gateway3DSecureActivity out of the library
Intent intent = new Intent(this, Gateway3DSecureActivity.class);
intent.putExtra(Gateway3DSecureActivity.EXTRA_HTML, html);
intent.putExtra(Gateway3DSecureActivity.EXTRA_TITLE, title); // optional
startActivityForResult(intent, YOUR_3DS_REQUEST_CODE);
So I replaced Gateway3DSecureActivity in the code above with my custom activity
I was working on Kotlin so I created my own activity to handle the response which works fine. The Exception is due to the structure of the layout. The layout starts with layout tag which is the reason for the crash. So we can create our own activity without this tag that's what I have done.
Please have a look at my gist

Can we set custom data while creating a Private QBDialog?

I am using QuickBlox Android SDK. While creating a new private dialog, I need to add some meta data in QBDialog.
As I understand, a private dialog should be created using PrivateChatManager. And it only provides a way to create a dialog with participant ID with following method signature.
createDialog(int participantID)
But according to my requirement, I need to pass some other meta data like the name of the participant. That is required while retrieving the Dialogs.
Otherwise, I will have to do a separate API call to get the user details!
So, Can't we pass meta data to a private Chat Dialog? Are there any solutions to overcome this problem?
You may try to use the following workaround with custom parameters:
custom parameters

Facebook SDK request api

I have been reading the Facebook documentation. The Facebook documentation for asking/sending gifts mentioned a YOUR_OBJECT_IDfor this call:
FB.ui({method: 'apprequests',
message: 'Take this bomb and blast your way to victory!',
to: 'RECIPIENT_USER_ID'
action_type:'send',`enter code here`
object_id: 'YOUR_OBJECT_ID', // Where do I get this ?
data: 'Friend Smash Custom Tracking 1'
}, function(response) {
console.log(response);
});
How do I get get it? I have already created my object inside Open Graph, but there is no object id specified. Do I need to initiate a create request for the user from my app for that object or how is this suppose to work?
The request_object_id is what you will get back from the dialog, after the user sent the gift – it is part of the dialog’s return value. It is simply the identifier for the request that was send.
https://developers.facebook.com/docs/games/requests/v2.1#response
You can use it to read details of the request back from the API.
OK, so since this is about the object id that one can pass to the dialog:
That documentation section already links to https://developers.facebook.com/docs/sharing/opengraph/custom, where this is explained in more detail.
Basically, you need to set up your own Open Graph action and Open Graph object. This will define what your object is, and what players of the game can do with it.
Open Graph objects can be created in two ways:
You can host them yourself. To do this, you simply provide URLs to HTML pages which include the Open Graph meta data that specifies the object property values. Facebook will then read the meta data from those URLs (“scraping”). In that case, you would simply pass the object URL to the dialog as object_id.
You can use the Object API to create objects that Facebook will host for you. These can either be “app-owned” or “user-owned” – depends on if the are specific to a certain user, or “common” objects to be used by all users of your app. Creating an object via that API will give you back an object id, that you can then pass to the dialog.
If you are not familiar with the whole Open Graph Story concept yet, then I recommend you start by having a look at the whole Open Graph section, https://developers.facebook.com/docs/sharing/opengraph

How to get the Facebook FriendPicker to return the selected friend username?

I am trying to create an invite system that uses the facebook usernames. However the friendpicker provided by facebook only returns GraphUser objects for each selected friend with their name and id. Is there a way to change the FriendPicker to also return the username?
"username" is not a regular field that's passed down from the graph API for friends. The good news is that FriendPickerFragment inherits from PickerFragment, and if you look at the docs for PickerFragment, you'll see that there's a method called setExtraFields.
So if you did something like:
friendPicker.setExtraFields(Arrays.asList("name", "username"))
that should do the trick, and you'll be able to call graphuser.getUserName().

How to create a object to post score?

I'm developing a game on Android and want to integrate with facebook, so user can share his results.
I'm using the Open Graph to create the actions, the objects and so on from my app.
Already done some progress using direct Graph API requests like this.
Bundle params = new Bundle();
params.putString("my_object", "http://samples.ogp.me/251143638264597" );
mAsyncRunner.request("me/MY_APP_NAMESPACE:beat", params, "POST",
new WallPostRequestListener(), null);
This way the post is made. But ,as you can see on the code above, i'm using the sample object created by Open Graph.
My problem is: how can i create an object dynamically, in java? It's possible? I've already tried to create a JSON object, but didn't have success.
I saw on the tutorials an HTML metadata, but this is the only way to do it?

Categories

Resources