jnorthr / socialauth

Automatically exported from code.google.com/p/socialauth
0 stars 0 forks source link

get Profile Contact Image #192

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.I want to get the profile image of my network contacts, but I don't know how 
to di it.

What is the expected output? What do you see instead?
NULLPOINTEREXCEPTION

What version of the product are you using? On what operating system?
Android 2.3.3

Please provide any additional information below.

Original issue reported on code.google.com by albert.m...@gmail.com on 6 Jul 2012 at 12:00

GoogleCodeExporter commented 8 years ago
For which provider you want to get contacts images.

There is one api() method in all providers through which you can make custom 
call.
Search the URL to get the image and call this method of respective provider.

Regards
Tarun

Original comment by tar...@brickred.com on 9 Jul 2012 at 7:12

GoogleCodeExporter commented 8 years ago
I want the profile contact image from :

- LinkedIn
- Facebook
- Twitter
- Google

But I don't Know if it's possible to add this api() method option on
socialAuth because it is like the socialAuth has some option closed.

sorry for my English.

Original comment by albert.m...@gmail.com on 17 Jul 2012 at 10:34

GoogleCodeExporter commented 8 years ago

For twitter you can simply use the URL in image src as given below:
https://api.twitter.com/1/users/profile_image?screen_name=SCREEN_NAME&size=bigge
r 

replace the SCREEN_NAME with display name. You can get the display name of 
contact using getDisplayName() method.

<c:forEach var="contact" items="${contacts}" varStatus="index">
                    <tr class='<c:if test="${index.count % 2 == 0}">sectiontableentry2</c:if><c:if test="${index.count % 2 != 0}">sectiontableentry1</c:if>'>
                        <td><c:out value="${contact.firstName}"/> <c:out value="${contact.lastName}"/></td>
                        <td><c:out value="${contact.email}"/></td>
                        <td><a href='<c:out value="${contact.profileUrl}"/>' target="_new"><c:out value="${contact.profileUrl}"/></a></td>
                        <td><img src='https://api.twitter.com/1/users/profile_image?screen_name=<c:out value="${contact.displayName}"/>&size=bigger' ></td>
                    </tr>
                </c:forEach>

For Facebook 

you can use the following URL
http://graph.facebook.com/CONTACT_ID/picture

you can getthe CONTACT_ID from contact object using getId() method

<c:forEach var="contact" items="${contacts}" varStatus="index">
                    <tr class='<c:if test="${index.count % 2 == 0}">sectiontableentry2</c:if><c:if test="${index.count % 2 != 0}">sectiontableentry1</c:if>'>
                        <td><c:out value="${contact.firstName}"/> <c:out value="${contact.lastName}"/></td>
                        <td><c:out value="${contact.email}"/></td>
                        <td><a href='<c:out value="${contact.profileUrl}"/>' target="_new"><c:out value="${contact.profileUrl}"/></a></td>
                        <td><img src='http://graph.facebook.com/<c:out value="${contact.id}"/>/picture' ></td>
                    </tr>
                </c:forEach>

Original comment by tar...@brickred.com on 18 Jul 2012 at 5:49

GoogleCodeExporter commented 8 years ago
thank you very much!!

And now I have one more question... I'm using socialauth on a simulator,
but when I try to use it on a device (Samsung Galaxy S Player) it doesen't
works and I don't know why..

thanks!!

Original comment by albert.m...@gmail.com on 19 Jul 2012 at 9:16

GoogleCodeExporter commented 8 years ago
I have problems with the keys, but only on my device, not in my simulator.

on my simulator all is working perfect..

Original comment by albert.m...@gmail.com on 20 Jul 2012 at 10:04

GoogleCodeExporter commented 8 years ago
Please have a look our android version and try this.

http://code.google.com/p/socialauth-android/

If you are still facing any issue then please post issue on that wiki.

Regards
Tarun

Original comment by tar...@brickred.com on 1 Aug 2012 at 5:18