Can anyone help me to send a comment/reply on a particular post in linkedin?
I am able to send direct message to linked in via my android application using following code using person id.
id = update.getUpdateContent().getPerson().getId()
.....
LinkedInAccessToken accessToken = new LinkedInAccessToken(
linkedInTokens[0], linkedInTokens[1]);
LinkedInApiClientFactory clientFactory = LinkedInApiClientFactory
.newInstance(LinkedInConstants.LINKEDIN_CONSUMER_KEY,
LinkedInConstants.LINKEDIN_CONSUMER_SECRET);
LinkedInApiClient client = clientFactory
.createLinkedInApiClient(accessToken);
client.sendMessage(Arrays.asList(id), "subjectText",
"postingText");
can anyone help me to reply a post?
Thank you
Assuming you know the network update key of the update you'd like to comment on, the API call to do this would be:
POST http://api.linkedin.com/v1/people/~/network/updates/key={NETWORK UPDATE KEY}/update-comments
An example of the XML body of the comment:
<?xml version='1.0' encoding='UTF-8'?>
<update-comment>
<comment>Really great article!</comment>
</update-comment>
Related
Sorry for my english. I try use FCM for my test application, everething work fine i use documentation, and in this documentation write if you want unsubscribe from topik use unsubscribeFromTopic, and i use it like this:
public void unscribeChannel(final String chanel) {
FirebaseMessaging.getInstance().unsubscribeFromTopic("/topics/topik" + chanel);
}
but after this nothink happens, I still get notifications(
Then i try delete token like this:
FirebaseInstanceId.getInstance().deleteToken(getToken(), "/topics/topik" + chanel);
but i think it not good and it not help me too
Just write the topic without slashes, like this :
FirebaseMessaging.getInstance().unsubscribeFromTopic("topic_name_only_no_slashes");
Example :
Update:
You can get list of topics of a user using this:
HTTP GET Request
https://iid.googleapis.com/iid/info/<TOKEN>?details=true
Content-Type:application/json
Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA
I am trying to develop XMPP chat in Android and while creating new user using AccountManager I am having the following exception :
jid-malformed(400)
My user-connection code goes like this:
AccountManager manager = connection.getAccountManager();
try {
manager.createAccount(username, password);
}
catch(XMPPException e){
e..printStackTrace();
}
here my
username = abc#xyz.com
password = 12345678
I learned that we need not require to send service name with the username from post
But in my username the format says that my user is "abc" and my service is "xyz.com"
what should I do to keep '#' in my username?
Thank You. :)
JID escaping is done as per XEP-0106. Specifically, the "#" character should be replaced by "\40" to keep the "#" as part of the JID.
I am creating one chatting application which will work on both iOS and Android platform. Sometimes 'both' subscription is not received at both end. Can anyone tell me what can be the possible issue?
===================== For iOS =====================
Sending request,
XMPPJID *XMPPJIDObj=[XMPPJID jidWithString:aStrOtherJabberId];
[appDelegateObj.xmppRoster addUser:XMPPJIDObj withNickname:nil];
Accepting request,
[appDelegateObj.xmppRoster acceptPresenceSubscriptionRequestFrom:aReceiverJID andAddToRoster:TRUE];
Removing user,
[appDelegateObj.xmppRoster removeUser:[XMPPJID jidWithString:aPresenceObj.userJabberID]];
===================== For Android =====================
Sending request,
Roster.setDefaultSubscriptionMode(SubscriptionMode.manual);
myApp.getXmppConnection().getRoster().createEntry(visitorJabberId, visitorUserName, null);
Accepting request,
final Presence presence1 = new Presence(Type.subscribed);
presence1.setFrom(myApp.getUserJabberId());
presence1.setType(Type.subscribed);
presence1.setTo(visitorJabberId);
myApp.getXmppConnection().sendPacket(presence1);
myApp.getXmppConnection().getRoster().createEntry(visitorJabberId, visitorUserName, null);
Removing user,
final RosterPacket rosterPacket = new RosterPacket();
rosterPacket.setType(IQ.Type.SET);
final RosterPacket.Item item = new RosterPacket.Item(visitorJabberId, null);
item.setItemType(RosterPacket.ItemType.remove);
rosterPacket.addRosterItem(item);
myApp.getXmppConnection().sendPacket(rosterPacket);
Hi Leena for the iOS we have used save thing but I think you have forgot some thing. The actual flow is call add user method of roster class then call subscribe method with subscription value YES and finally send presence tag with subscribe type to the serve. Following are the code here I used XMPPSharedPreference singleton class rather than appdelegate. Hope this will work for you...
XMPPJID *newBuddy = [XMPPJID jidWithString:JIDString];
[[XMPPSharedPreference sharedPreferences].xmppRoster addUser:newBuddy withNickname:#"nicknameValue"];
[[XMPPSharedPreference sharedPreferences].xmppRoster acceptPresenceSubscriptionRequestFrom:newBuddy andAddToRoster:YES];
NSXMLElement *presence = [NSXMLElement elementWithName:#"presence"];
[presence addAttributeWithName:#"to" stringValue:JIDString];
[presence addAttributeWithName:#"type" stringValue:#"subscribe"];
[[self xmppStream] sendElement:presence];
When you add a user to your roster you have to make sure you also subscribe to the friend's presence. That completes the cycle.
So, for iOS for example, you're adding a friend to roster like this:
[appDelegateObj.xmppRoster addUser:XMPPJIDObj withNickname:nil];
But you need to do use this instead:
- (void)addUser:(XMPPJID *)jid withNickname:(NSString *)optionalName groups:(NSArray *)groups subscribeToPresence:(BOOL)subscribe
and make sure you set subscribe to YES
Or, you could keep the code you have but manually subscribe to the user's presence by doing this:
[appDelegateObj.xmppRoster subscribePresenceToUser:XMPPJIDObj]
Let me know how that works out for you.
I am using Google Spreadsheet API in my simple Android application. This is the piece of code:
URL spreadSheetUrl = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full");
SpreadsheetQuery query = new SpreadsheetQuery(spreadSheetUrl);
query.setTitleQuery("xyz");
query.setTitleExact(true);
SpreadsheetFeed spreadSheetFeed = service.getFeed(query, SpreadsheetFeed.class);
This piece of code is called from my application's sync adapter.
I am getting this error:
com.google.gdata.util.ParseException: Unrecognized content type:application/binary
com.google.gdata.client.Service.parseResponseData(Service.java:2136)
com.google.gdata.client.Service.parseResponseData(Service.java:2098)
com.google.gdata.client.Service.getFeed(Service.java:1136)
com.google.gdata.client.Service.getFeed(Service.java:1077)
com.google.gdata.client.GoogleService.getFeed(GoogleService.java:676)
com.google.gdata.client.Service.getFeed(Service.java:1034)
Can someone suggest how I can solve this issue?
It turns out that I did not set the user credentials before executing this piece of code.
service.setUserCredentials(user, password);
Adding this line helped solve this issue. Weird.
https://api.twitter.com/1.1/users/show.json?screen_name=screen-name&include_entities=true
is not working.
Getting Bad Authentication data error.
Twitter integration is also getting same error. How to solve this error?
you need to use oAuth.
use for example this class - https://github.com/abraham/twitteroauth
also must create app to get needed KEYs ($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret).
and to get for example tweets from timeline just execute this code
require_once(dirname(__FILE__) . '/libs/twitteroauth.php');
$connection = new TwitterOAuth($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
$response = $connection->get('statuses/user_timeline', array('screen_name' => $twitter_name));
echo '<pre>'.print_r($response,1).'</pre>';