IOS Integrated Friends League share

Source: Internet
Author: User

#import <Foundation/Foundation.h>@interface   umsocialsinahandler : NSObject + (void)openssowithredirecturl:(NSString *) RedirectURL; @end

#import "AppDelegate.h"#import "UMSocial.h"  #import "UMSocialSinaHandler.h"@interfaceappdelegate ()@end @implementation  appdelegate -(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchoptions {//Override point for customization after application launch.  //  set up secret keys shared by Friends [Umsocialdata setappkey:@ "5458264dfd98c5b5c9007064"        ];  // Open the Sina Weibo SSO switch and set the Sina Weibo callback address, which must match the callback address you set up in the background of Sina Weibo. If you set up our callback address in the background of Sina, "http://sns.whalecloud.com/sina2/callback", here can pass nil [ Umsocialsinahandler openssowithredirecturl:@ "http://sns.whalecloud.com/sina2/ Callback" ];      returnYES;}-(BOOL) Application: (UIApplication *) application Handleopenurl: (Nsurl *) url{return[Umsocialsnsservice Handleopenurl:url];}-(BOOL) Application: (UIApplication *) Application OpenURL: (Nsurl*) URL sourceapplication: (NSString*) sourceapplication annotation: (ID) annotation{return[Umsocialsnsservice Handleopenurl:url];}@end

#import "ViewController.h"#import "UMSocial.h"@interfaceViewcontroller ()@end @implementation  viewcontroller - (void) Touchesbegan: (Nsset *) touches withevent: (Uievent *)Event{    //Note: Share to friends, Friends Circle, collection, QQ space, QQ friends, friends, friends Circle, easy friends, easy friends Circle, Facebook, Twitter, Instagram and other platforms need to refer to their respective integration methods    /*Sheetview: Which view you need to show AppKey: The current app's allies share key sharetext: Text to share shareimage: images to share Sharetosnsname S: the platform you need to share*/    /*[Umsocialsnsservice presentsnsiconsheetview:self appkey:@ "5458264dfd98c5b5 c9007064 "sharetext:@" the words you want to share "Shareimage:[uiimag E imagenamed:@ "Icon.png"] Sharetosnsnames:[nsarray Arraywithobjects:umsharetosina,umshareto                                       Tencent,umsharetorenren, Umsharetodouban, Umsharetofacebook, Umsharetoflickr, Umsharetoinstagram, nil]     Delegate:nil]; */[Umsocialsnsservice presentsnsiconsheetview:self AppKey:@"5458264dfd98c5b5c9007064"Sharetext:@"Friends Alliance social sharing allows you to quickly realize social functions such as sharing, Www.umeng.com/social"shareimage:[uiimage imagenamed:@"Icon.png"] Sharetosnsnames:@[umsharetosina]Delegate: self];}@end

IOS Integrated Friends League share

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.