I am using Digits by Twitter alongside Applozic SDK. I am creating a custom contact list, by using Find Friends provided by Digits, and then using their friends' IDs to get their display name from Applozic.
This my code:
Log.e("Friend ID", user.idStr);
AppContactService appContactService = new AppContactService(context);
Contact contact = appContactService.getContactById(user.idStr);
Log.e("Friend Display Name", contact.getDisplayName());
This is my logcat output:
E/Friend ID: 753958303214870528
E/Friend Display Name: 753958303214870528
E/Friend ID: 751769088456790016
E/Friend Display Name: 751769088456790016
As you can see, even getDisplayName() returns UserID. This is my Applozic Dashboard
.
Is there anything I am doing wrong??
For this you need to make server call and get the User details from server. The above method which your are using it will only check from local data base
You can user this method to get the details from server
Set<String> userIds = new HashSet<>();
userIds.add("user1");
userIds.add("user2");
userIds.add("user3");
UserService.getInstance(context).processUserDetails(userIds); //server call
AppContactService appContactService = new AppContactService(context);
Contact contact = appContactService.getContactById("user1");
if(contact != null){
Log.e("Friend Display Name", contact.getDisplayName());
}
Related
DocuSigns' report section includes tables containing the column name Recipient Company Name
I had a look through all DocuSign models inside the SDK, but I couldn't find any way to fill this column. Is there a way to do so using the SDK?
This can only be filled if the recipient is either a :
Saved contact in your DocuSign account.
Has their own DocuSign account.
If your recipient is just a random email/name you added to a one-time envelope - there's no way to enter the company information.
You can update contacts in your account and add the company name, see this article I wrote about how to do that in 6 languages including Java:
(note the "Organization" field which is the compan)
// You will need to obtain an access token using your chosen authentication flow
Configuration config = new Configuration(new ApiClient(basePath));
config.addDefaultHeader("Authorization", "Bearer " + accessToken);
UsersApi usersApi = new UsersApi(config);
UserProfile userProfile = new UserProfile();
Contact contact = new Contact();
contact.setName("Inbar Gazit");
contact.setEmails(new java.util.ArrayList<String>());
contact.getEmails().add("inbar.gazit#docusign.com");
contact.setOrganization("DocuSign");
ContactPhoneNumber contactPhoneNumber = new ContactPhoneNumber();
contactPhoneNumber.setPhoneNumber("212-555-1234");
contactPhoneNumber.setPhoneType("mobile");
contact.setContactPhoneNumbers(new java.util.ArrayList<ContactPhoneNumber>());
contact.getContactPhoneNumbers().add(contactPhoneNumber);
ContactModRequest contactModificationRequest = new ContactModRequest();
contactModificationRequest.setContactList(new java.util.ArrayList<Contact>());
contactModificationRequest.getContactList().add(contact);
usersApi.postContacts(accountId, contactModificationRequest);
Currently I am adding my user class to a firebase database using this code:
public void onClick(View v)
{
Firebase ref = new Firebase("https://xxxxxx.firebaseio.com/");
createAccount(emailString, passwordString);
User user = new User ();
user.setEmail(emailString);
user.setPassword(passwordString);
ref.child("users").push().setValue(user);
}
Right now, since I use the .push() method, I am creating a unique ID in my database. How do I pull that unique ID? I looked at this tutorial but I don't understand how to implement it.
DatabaseReference dbRef = FirebaseDatabase.getInstance().getReference(); //get the reference to your database
User user = new User ();
user.setEmail(emailString);
user.setPassword(passwordString);
String yourKey = dbRef.child("users").push().getKey(); //get the key
dbRef.child("users").child(yourKey).setValue(user); //insert user in that node
But if you want to access that node (yourKey) later, you will need to store it in some sort of permanent storage like a database on your web server.
Great example of how to get key check these docs out helped me a lot.
Firebase Docs
// Get a key for a new Post.
var newPostKey = firebase.database().ref().child('posts').push().key;
I use VK Android SDK (com.perm.kate.api) https://bitbucket.org/ruX/android-vk-sdk/overview
The last line of the code i provide below one day began returning KException.
From the documentation:
If some sort of action is completed too often, then the request to API may return the error "Captcha needed". The user will need to enter a code from the image and send the request again with the entered Captcha code in the request parameters:
captcha_sid - captcha identifier captcha_img
link to the image thatshould be shown to the user so that they can enter the text from the image.
The question is where should I enter this parameters?
I use the method to get user profile which doesn't contain these arguments:
public ArrayList<User> getProfiles(Collection<Long> uids, Collection<String> domains, String fields, String name_case) throws MalformedURLException, IOException, JSONException, KException
The code to get a user profile:
Api vkApi=new Api(account.access_token, Constants.API_ID);
//get user
Collection<Long>userIds=new ArrayList<Long>();
userIds.add(account.user_id);
ArrayList<User> users=vkApi.getProfiles(userIds, null, null, null); //KException
You need to set all parameters. Not null but array with empty string, and empty string. My example:
Collection<Long> u = new ArrayList<Long>();
u.add(user_id);
Collection<String> d = new ArrayList<String>();
d.add("");
response = vkApi.getProfiles(u, d, "", "", "", "");
I'm using restfb 1.6.5 (the same problem in 1.6.4) and have problems getting the uids of my friends. This works fine (me-query):
User fbUserMe = fbClient.fetchObject("me", com.restfb.types.User.class);
logger.debug(fbUserMe.getId());
The response body contains something like: {"id":"1234","name":"ME" ...} and fbUserMe.getId() returns my uid. With the next code snipped I want to get the uids of my friends (friends-query):
StringBuffer sb = new StringBuffer();
sb.append("SELECT uid, first_name, last_name FROM user");
sb.append(" WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())");
List<User> users = fbClient.executeQuery(sb.toString(), User.class);
for(User fbUser : users)
{
logger.debug(fbUser.getId());
}
But this always outputs null, although the response body contains this: [{"uid":5678,"first_name":"Peter" ...} ...].
The obvious difference in the response by is id=1234 for the me-query and uid=5678 for the friends-query. If I use a custom class FqlUser like described in RestFB I'm able to get the uid. Now I'm uncertain of the uid. Do I really get same same id (the same my friend would get in a me-Query) or do I get something like the third_party_id described in Facebook: FQL-user?
You're getting the uid. The same id your friend would get in a "me query".
Does anybody know how to get a photo from Picasa by its title without knowing the album it belongs to? I'm already authenticated.
I suppose you can do something like this:-
URL baseSearchUrl = new URL("yourPicasaURL");
Query myQuery = new Query(baseSearchUrl);
myQuery.setStringCustomParameter("kind", "photo");
myQuery.setMaxResults(10);
myQuery.setFullTextQuery("hello"); // search photo that has the word "hello"
AlbumFeed searchResultsFeed = myService.query(myQuery, AlbumFeed.class);
for (PhotoEntry photo : searchResultsFeed.getPhotoEntries()) {
System.out.println(photo.getTitle().getPlainText());
}