ios - How to send URL to Friend in Twitter -
ios - How to send URL to Friend in Twitter -
how can send url twitter friend in ios. can send direct message not allow me send url in it.
here code posting drirect message twitter friend , working.
-(void)postmessagetofriend:(nsstring *)id withmessage:(nsstring *)message { notificationame = notificationnamestr; acaccounttype *accounttype = [accountstore accounttypewithaccounttypeidentifier:acaccounttypeidentifiertwitter]; [accountstore requestaccesstoaccountswithtype:accounttype options:nil completion:^(bool granted, nserror *error) { if (granted && !error) { nsarray *accountslistary = [accountstore accountswithaccounttype:accounttype]; int noofaccounts = [accountslistary count]; if (noofaccounts >0) { nsurl *url = [nsurl urlwithstring:@"https://api.twitter.com/1.1/direct_messages/new.json"]; twitteraccount = [accountslistary lastobject]; nsdictionary *p =@{@"status":@"posted",@"screen_name":id, @"text":message}; slrequest *postrequest = [slrequest requestforservicetype:slservicetypetwitter requestmethod:slrequestmethodpost url:url parameters:p]; [postrequest setaccount:twitteraccount]; [postrequest performrequestwithhandler:^(nsdata *responsedata, nshttpurlresponse *urlresposnse, nserror *error){ if (error) { nslog(@"error : %@",error); }else{ nserror *jsonerror = nil; nsstring * responsestr = [[nsstring alloc] initwithdata:responsedata encoding:nsjsonwritingprettyprinted]; nsarray *friendsdata = [nsjsonserialization jsonobjectwithdata: [responsestr datausingencoding:nsutf8stringencoding] options: nsjsonreadingmutablecontainers error: &jsonerror]; nslog(@"response value is: %@ %d ",friendsdata,[urlresposnse statuscode]); } }]; } } }]; }
but if seek add together url in message homecoming me error
{ errors = ( { code = 226; message = "this request looks might automated. protect our users spam , other malicious activity, can't finish action right now. please seek 1 time again later."; } ); }
i think has nil code, twitter. apparently, they're not allowing send links in direct messages. https://support.twitter.com/articles/14606-posting-or-deleting-direct-messages.
you can't user official twitter client or website. afaik, it's known issue , they're said working on it. it's been long since said that.
ios iphone twitter
Comments
Post a Comment