iOS開發之友盟分享的使用

來源:互聯網
上載者:User

標籤:

iOS開發之友盟分享的使用1. 準備工作

  (1) 註冊友盟帳號, 擷取Appkey

  (2) 根據需要下載分享庫(注意: 最好64位)

2. 基本分享

  (1) 庫檔案拖進工程中 umeng_ios_social_sdk_4.2

  (2) 添加必要二進位庫

若你的工程設定了all_load,需要添加手機QQ SDK需要的系統framework:

  Security.framework,

  libiconv.dylib,

  SystemConfiguration.framework,

  CoreGraphics.framework,

  libsqlite3.dylib,

  CoreTelephony.framework,

  libstdc++.dylib,

  libz.dylib

  (3) AppDelegate初始化庫

//AppDelegate.m加標頭檔#import "UMSocial.h"//注意: 支援新浪微博,支援簡訊和郵件, 暫不支援分享    [UMSocialData setAppKey:@"507fcab25270157b37000010"];

 

  (4)分享

//分享頁面添加標頭檔#import "UMSocial.h"//分享的代碼//注意:分享到好友、朋友圈、收藏、QQ空間、QQ好友、來往好友、來往朋友圈、易信好友、易信朋友圈、Facebook、Twitter、Instagram等平台需要參考各自的整合方法        NSString *text = [NSString stringWithFormat:@"最近有個應用 %@ 蠻不錯哦, 朋友們快來一起跟我玩, 地址是%@",self.model.name,self.model.itunesUrl];        //使用UMShareToWechatSession,UMShareToWechatTimeline,UMShareToWechatFavorite分別代表好友、朋友圈、收藏        [[UMSocialDataService defaultDataService]  postSNSWithTypes:@[

UMShareToSina

] content:text image:_iconImageView.image location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){            if (response.responseCode == UMSResponseCodeSuccess) {                NSLog(@"分享成功!");            }        }];

 

3.添加其他需要的分享

    添加分享請查看 友盟 分享相關文檔

iOS開發之友盟分享的使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.