2.3.前往Parse用戶注冊並下載SDK。
選中工程項目進入“Build Phases”在“Link Binary With Libraries”中點擊“+”號,按照ShareSDK的集成文檔與Parse的文檔說明把需要引入的庫加入到項目中
注意: 新浪微博需要提供回調地址才行
回調地址去新浪開發者平台獲取
[ShareSDK connectSinaWeiboWithAppKey:@"3819780424"
appSecret:@"6ce8dba1a8baa6803b6e3824518422b3"
redirectUri:@"http://www.baidu.com"];
redirectUri 要和開發平台的回調頁面相同

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[ShareSDK registerApp:@"288fe15ac67e"]; //參數為ShareSDK官網中添加應用後得到的AppKey
//Parse Key
[Parse setApplicationId:@"gKROXKemyAYT1JEQPwFjcuNRL7qPLguXpYWS1qb9"
clientKey:@"U48G8pla1trx8voPeOpH8Hts9QN475g27STuxuWo"];
///新浪微博:
//App Key:3819780424
//App Secret:6ce8dba1a8baa6803b6e3824518422b3
//騰訊微博:
//App key:2620460989
//App secret:58c55f572d5ae35e0c355f4c0ee11283
//分享內容URL
[ShareSDK connectSinaWeiboWithAppKey:@"3819780424"
appSecret:@"6ce8dba1a8baa6803b6e3824518422b3"
redirectUri:@"http://www.baidu.com"];
// //新浪微博
// //App Key:801498670
// //App Secret:882c5581fa08e4068e9b920b65dac4ac
//
// //添加騰訊微博應用
// [ShareSDK connectTencentWeiboWithAppKey:@"801307650"
// appSecret:@"ae36f4ee3946e1cbb98d6965b0b2ff5c"
// redirectUri:@"http://www.sharesdk.cn"];
// //添加豆瓣應用
// [ShareSDK connectDoubanWithAppKey:@"07d08fbfc1210e931771af3f43632bb9"
// appSecret:@"e32896161e72be91"
// redirectUri:@"http://dev.kumoway.com/braininference/infos.php"];
//
// //添加人人網應用
// [ShareSDK connectRenRenWithAppKey:@"fc5b8aed373c4c27a05b712acba0f8c3"
// appSecret:@"f29df781abdd4f49beca5a2194676ca4"];
//
//
//
// //添加Facebook應用
// [ShareSDK connectFacebookWithAppKey:@"107704292745179"
// appSecret:@"38053202e1a5fe26c80c753071f0b573"];
return YES;
}
其中傳入ShareSDK的參數則是之前創建應用的AppKey,而Parse的ApplicationId和clientKey可在應用信息面板中獲取。
