Share content directly to Sina without pop-up editing interface
[[Umsocialdataservice Defaultdataservice] Setsocialdata:[umsocialdata Defaultdata]];
Umsocialurlresource *urlresource = [[Umsocialurlresource alloc] Initwithsnsresourcetype: Umsocialurlresourcetypeimage URL:
_detailmodel.productinfo.imageurl];
UIImage * image = [UIImage imagewithdata:[nsdata datawithcontentsofurl:[nsurl urlwithstring:_ DetailModel.productInfo.info]];
[[Umsocialdataservice Defaultdataservice] Postsnswithtypes:@[umsharetosina] content:[nsstring stringWithFormat:@ "% @%@ ", _detailmodel.productinfo.info,_detailmodel.productinfo.shareurl] image:image location:nil urlResource: Urlresource presentedcontroller:self completion:^ (umsocialresponseentity *shareresponse) {
btn.enabled = YES;
if (Shareresponse.responsecode = = umsresponsecodesuccess) {
[[Activityremindview Loadfromxib] ShowActivityViewInView:self.view withmsg:@ " sharing success " inseconds:1];
}else{
[[Activityremindview Loadfromxib] ShowActivityViewInView:self.view withmsg:@ " sharing failed " inseconds:1];
}
}];
/*************** with edit page to share to Sina *************/
[umsocialconfig setfinishtoastishidden:YES position: Umsocialitoastpositiontop];
umsocialdata * socialdata = [umsocialdata defaultdata];
Socialdata. Urlresource = [[umsocialurlresource alloc] initwithsnsresourcetype: Umsocialurlresourcetypeimage URL:
_detailmodel. ProductInfo. ImageUrl];
socialdata. Shareimage = [uiimage imagewithdata< Span class= "S1" >:[nsdata datawithcontentsofurl :[nsurl urlwithstring:< Span class= "S6" >_detailmodel. Productinfo. Info
socialdata. Sharetext = [nsstring stringwithformat:@ "%@\n%@\n" ,_detailmodel.productinfo. Info,_detailmodel. Productinfo. Shareurl
__unsafe_unretained productdetailinfocontroller * productcontroller = self;
umsocialcontrollerservice * umsvc = [[umsocialcontrollerservice defaultcontrollerservice ] initwithumsocialdata: socialdata];
Umsvc. socialuidelegate = productcontroller;
//[[Umsocialcontrollerservice Defaultcontrollerservice] setsharetext:[nsstring stringwithformat:@ "%@%@", _ Detailmodel.productinfo.info,_detailmodel.productinfo.shareurl] Shareimage:[uiimage ImageWithData:[NSData Datawithcontentsofurl:[nsurl Urlwithstring:_detailmodel.productinfo.info]] [Socialuidelegate:productcontroller];
// set shared content and callback objects
[umsocialsnsplatformmanager getsocialplatformwithname:umsharetosina]. Snsclickhandler(self, [umsocialcontrollerservice defaultcontrollerservice], YES);
Share to a circle of friends
[umsocialconfig setfinishtoastishidden:YES position: Umsocialitoastpositiontop];
[umsocialdata Defaultdataextconfig. Wechattimelinedata. Url = _detailmodel. Productinfo. Shareurl
umsocialurlresource * Urlresource = [[umsocialurlresource alloc] initwithsnsresourcetype :umsocialurlresourcetypeimage URL:_detailmodel. ProductInfo. ImageUrl];
UIImage * image = [UIImage imagewithdata: [nsdata datawithcontentsofurl: [ Nsurl urlwithstring:_detailmodel. ProductInfo. Info]];
[[Umsocialdataservice defaultdataservice] postsnswithtypes: @[umsharetowechattimeline] Content:_detailmodel. Productinfo. Info image:image location:< Span class= "S3" >nil urlresource:urlresource Presentedcontroller:self completion :^ (umsocialresponseentity *response) {
if (response. Responsecode = = umsresponsecodesuccess) {
[[activityremindview loadfromxib] showactivityviewinview:self. View withmsg:@ " sharing success " inseconds:1];
}Else{
[[activityremindview loadfromxib] showactivityviewinview:self. View withmsg:@ " sharing failed " inseconds:1];
}
}];
Key code for custom sharing after integration with the Friends League SDK