WXApiObject.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. //
  2. // MMApiObject.h
  3. // Api对象,包含所有接口和对象数据定义
  4. //
  5. // Created by Wechat on 12-2-28.
  6. // Copyright (c) 2012年 Tencent. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. /*! @brief 错误码
  11. *
  12. */
  13. enum WXErrCode {
  14. WXSuccess = 0, /**< 成功 */
  15. WXErrCodeCommon = -1, /**< 普通错误类型 */
  16. WXErrCodeUserCancel = -2, /**< 用户点击取消并返回 */
  17. WXErrCodeSentFail = -3, /**< 发送失败 */
  18. WXErrCodeAuthDeny = -4, /**< 授权失败 */
  19. WXErrCodeUnsupport = -5, /**< 微信不支持 */
  20. };
  21. /*! @brief 请求发送场景
  22. *
  23. */
  24. enum WXScene {
  25. WXSceneSession = 0, /**< 聊天界面 */
  26. WXSceneTimeline = 1, /**< 朋友圈 */
  27. WXSceneFavorite = 2, /**< 收藏 */
  28. };
  29. enum WXAPISupport {
  30. WXAPISupportSession = 0,
  31. };
  32. /*! @brief 跳转profile类型
  33. *
  34. */
  35. enum WXBizProfileType{
  36. WXBizProfileType_Normal = 0, //**< 普通公众号 */
  37. WXBizProfileType_Device = 1, //**< 硬件公众号 */
  38. };
  39. /*! @brief 跳转mp网页类型
  40. *
  41. */
  42. enum WXMPWebviewType {
  43. WXMPWebviewType_Ad = 0, /**< 广告网页 **/
  44. };
  45. /*! @brief 应用支持接收微信的文件类型
  46. *
  47. */
  48. typedef NS_ENUM(UInt64, enAppSupportContentFlag)
  49. {
  50. MMAPP_SUPPORT_NOCONTENT = 0x0,
  51. MMAPP_SUPPORT_TEXT = 0x1,
  52. MMAPP_SUPPORT_PICTURE = 0x2,
  53. MMAPP_SUPPORT_LOCATION = 0x4,
  54. MMAPP_SUPPORT_VIDEO = 0x8,
  55. MMAPP_SUPPORT_AUDIO = 0x10,
  56. MMAPP_SUPPORT_WEBPAGE = 0x20,
  57. // Suport File Type
  58. MMAPP_SUPPORT_DOC = 0x40, // doc
  59. MMAPP_SUPPORT_DOCX = 0x80, // docx
  60. MMAPP_SUPPORT_PPT = 0x100, // ppt
  61. MMAPP_SUPPORT_PPTX = 0x200, // pptx
  62. MMAPP_SUPPORT_XLS = 0x400, // xls
  63. MMAPP_SUPPORT_XLSX = 0x800, // xlsx
  64. MMAPP_SUPPORT_PDF = 0x1000, // pdf
  65. };
  66. #pragma mark - BaseReq
  67. /*! @brief 该类为微信终端SDK所有请求类的基类
  68. *
  69. */
  70. @interface BaseReq : NSObject
  71. /** 请求类型 */
  72. @property (nonatomic, assign) int type;
  73. /** 由用户微信号和AppID组成的唯一标识,发送请求时第三方程序必须填写,用于校验微信用户是否换号登录*/
  74. @property (nonatomic, retain) NSString* openID;
  75. @end
  76. #pragma mark - BaseResp
  77. /*! @brief 该类为微信终端SDK所有响应类的基类
  78. *
  79. */
  80. @interface BaseResp : NSObject
  81. /** 错误码 */
  82. @property (nonatomic, assign) int errCode;
  83. /** 错误提示字符串 */
  84. @property (nonatomic, retain) NSString *errStr;
  85. /** 响应类型 */
  86. @property (nonatomic, assign) int type;
  87. @end
  88. #pragma mark - WXMediaMessage
  89. @class WXMediaMessage;
  90. #ifndef BUILD_WITHOUT_PAY
  91. /*! @brief 第三方向微信终端发起支付的消息结构体
  92. *
  93. * 第三方向微信终端发起支付的消息结构体,微信终端处理后会向第三方返回处理结果
  94. * @see PayResp
  95. */
  96. @interface PayReq : BaseReq
  97. /** 商家向财付通申请的商家id */
  98. @property (nonatomic, retain) NSString *partnerId;
  99. /** 预支付订单 */
  100. @property (nonatomic, retain) NSString *prepayId;
  101. /** 随机串,防重发 */
  102. @property (nonatomic, retain) NSString *nonceStr;
  103. /** 时间戳,防重发 */
  104. @property (nonatomic, assign) UInt32 timeStamp;
  105. /** 商家根据财付通文档填写的数据和签名 */
  106. @property (nonatomic, retain) NSString *package;
  107. /** 商家根据微信开放平台文档对数据做的签名 */
  108. @property (nonatomic, retain) NSString *sign;
  109. @end
  110. #endif
  111. #ifndef BUILD_WITHOUT_PAY
  112. #pragma mark - PayResp
  113. /*! @brief 微信终端返回给第三方的关于支付结果的结构体
  114. *
  115. * 微信终端返回给第三方的关于支付结果的结构体
  116. */
  117. @interface PayResp : BaseResp
  118. /** 财付通返回给商家的信息 */
  119. @property (nonatomic, retain) NSString *returnKey;
  120. @end
  121. #endif
  122. #pragma mark - SendAuthReq
  123. /*! @brief 第三方程序向微信终端请求认证的消息结构
  124. *
  125. * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,
  126. * 向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。
  127. * @see SendAuthResp
  128. */
  129. @interface SendAuthReq : BaseReq
  130. /** 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。
  131. * @see SendAuthResp
  132. * @note scope字符串长度不能超过1K
  133. */
  134. @property (nonatomic, retain) NSString* scope;
  135. /** 第三方程序本身用来标识其请求的唯一性,最后跳转回第三方程序时,由微信终端回传。
  136. * @note state字符串长度不能超过1K
  137. */
  138. @property (nonatomic, retain) NSString* state;
  139. @end
  140. #pragma mark - SendAuthResp
  141. /*! @brief 微信处理完第三方程序的认证和权限申请后向第三方程序回送的处理结果。
  142. *
  143. * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。
  144. * 微信终端处理完后会向第三方程序发送一个SendAuthResp。
  145. * @see onResp
  146. */
  147. @interface SendAuthResp : BaseResp
  148. @property (nonatomic, retain) NSString* code;
  149. /** 第三方程序发送时用来标识其请求的唯一性的标志,由第三方程序调用sendReq时传入,由微信终端回传
  150. * @note state字符串长度不能超过1K
  151. */
  152. @property (nonatomic, retain) NSString* state;
  153. @property (nonatomic, retain) NSString* lang;
  154. @property (nonatomic, retain) NSString* country;
  155. @end
  156. #pragma mark - SendMessageToWXReq
  157. /*! @brief 第三方程序发送消息至微信终端程序的消息结构体
  158. *
  159. * 第三方程序向微信发送信息需要传入SendMessageToWXReq结构体,信息类型包括文本消息和多媒体消息,
  160. * 分别对应于text和message成员。调用该方法后,微信处理完信息会向第三方程序发送一个处理结果。
  161. * @see SendMessageToWXResp
  162. */
  163. @interface SendMessageToWXReq : BaseReq
  164. /** 发送消息的文本内容
  165. * @note 文本长度必须大于0且小于10K
  166. */
  167. @property (nonatomic, retain) NSString* text;
  168. /** 发送消息的多媒体内容
  169. * @see WXMediaMessage
  170. */
  171. @property (nonatomic, retain) WXMediaMessage* message;
  172. /** 发送消息的类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */
  173. @property (nonatomic, assign) BOOL bText;
  174. /** 发送的目标场景,可以选择发送到会话(WXSceneSession)或者朋友圈(WXSceneTimeline)。 默认发送到会话。
  175. * @see WXScene
  176. */
  177. @property (nonatomic, assign) int scene;
  178. @end
  179. #pragma mark - SendMessageToWXResp
  180. /*! @brief 微信终端向第三方程序返回的SendMessageToWXReq处理结果。
  181. *
  182. * 第三方程序向微信终端发送SendMessageToWXReq后,微信发送回来的处理结果,该结果用SendMessageToWXResp表示。
  183. */
  184. @interface SendMessageToWXResp : BaseResp
  185. @property(nonatomic, retain) NSString* lang;
  186. @property(nonatomic, retain) NSString* country;
  187. @end
  188. #pragma mark - GetMessageFromWXReq
  189. /*! @brief 微信终端向第三方程序请求提供内容的消息结构体。
  190. *
  191. * 微信终端向第三方程序请求提供内容,微信终端会向第三方程序发送GetMessageFromWXReq消息结构体,
  192. * 需要第三方程序调用sendResp返回一个GetMessageFromWXResp消息结构体。
  193. */
  194. @interface GetMessageFromWXReq : BaseReq
  195. @property (nonatomic, retain) NSString* lang;
  196. @property (nonatomic, retain) NSString* country;
  197. @end
  198. #pragma mark - GetMessageFromWXResp
  199. /*! @brief 微信终端向第三方程序请求提供内容,第三方程序向微信终端返回的消息结构体。
  200. *
  201. * 微信终端向第三方程序请求提供内容,第三方程序调用sendResp向微信终端返回一个GetMessageFromWXResp消息结构体。
  202. */
  203. @interface GetMessageFromWXResp : BaseResp
  204. /** 向微信终端提供的文本内容
  205. @note 文本长度必须大于0且小于10K
  206. */
  207. @property (nonatomic, retain) NSString* text;
  208. /** 向微信终端提供的多媒体内容。
  209. * @see WXMediaMessage
  210. */
  211. @property (nonatomic, retain) WXMediaMessage* message;
  212. /** 向微信终端提供内容的消息类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */
  213. @property (nonatomic, assign) BOOL bText;
  214. @end
  215. #pragma mark - ShowMessageFromWXReq
  216. /*! @brief 微信通知第三方程序,要求第三方程序显示的消息结构体。
  217. *
  218. * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。
  219. * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。
  220. */
  221. @interface ShowMessageFromWXReq : BaseReq
  222. /** 微信终端向第三方程序发送的要求第三方程序处理的多媒体内容
  223. * @see WXMediaMessage
  224. */
  225. @property (nonatomic, retain) WXMediaMessage* message;
  226. @property (nonatomic, retain) NSString* lang;
  227. @property (nonatomic, retain) NSString* country;
  228. @end
  229. #pragma mark - ShowMessageFromWXResp
  230. /*! @brief 微信通知第三方程序,要求第三方程序显示或处理某些消息,第三方程序处理完后向微信终端发送的处理结果。
  231. *
  232. * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。
  233. * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。
  234. */
  235. @interface ShowMessageFromWXResp : BaseResp
  236. @end
  237. #pragma mark - LaunchFromWXReq
  238. /*! @brief 微信终端打开第三方程序携带的消息结构体
  239. *
  240. * 微信向第三方发送的结构体,第三方不需要返回
  241. */
  242. @interface LaunchFromWXReq : BaseReq
  243. @property (nonatomic, retain) WXMediaMessage* message;
  244. @property (nonatomic, retain) NSString* lang;
  245. @property (nonatomic, retain) NSString* country;
  246. @end
  247. #pragma mark - OpenTempSessionReq
  248. /* ! @brief 第三方通知微信,打开临时会话
  249. *
  250. * 第三方通知微信,打开临时会话
  251. */
  252. @interface OpenTempSessionReq : BaseReq
  253. /** 需要打开的用户名
  254. * @attention 长度不能超过512字节
  255. */
  256. @property (nonatomic, retain) NSString* username;
  257. /** 开发者自定义参数,拉起临时会话后会发给开发者后台,可以用于识别场景
  258. * @attention 长度不能超过32位
  259. */
  260. @property (nonatomic, retain) NSString* sessionFrom;
  261. @end
  262. #pragma mark - OpenTempSessionResp
  263. /*! @brief 微信终端向第三方程序返回的OpenTempSessionReq处理结果。
  264. *
  265. * 第三方程序向微信终端发送OpenTempSessionReq后,微信发送回来的处理结果,该结果用OpenTempSessionResp表示。
  266. */
  267. @interface OpenTempSessionResp : BaseResp
  268. @end
  269. #pragma mark - OpenWebviewReq
  270. /* ! @brief 第三方通知微信启动内部浏览器,打开指定网页
  271. *
  272. * 第三方通知微信启动内部浏览器,打开指定Url对应的网页
  273. */
  274. @interface OpenWebviewReq : BaseReq
  275. /** 需要打开的网页对应的Url
  276. * @attention 长度不能超过1024
  277. */
  278. @property(nonatomic,retain)NSString* url;
  279. @end
  280. #pragma mark - OpenWebviewResp
  281. /*! @brief 微信终端向第三方程序返回的OpenWebviewReq处理结果
  282. *
  283. * 第三方程序向微信终端发送OpenWebviewReq后,微信发送回来的处理结果,该结果用OpenWebviewResp表示
  284. */
  285. @interface OpenWebviewResp : BaseResp
  286. @end
  287. #pragma mark - OpenRankListReq
  288. /* ! @brief 第三方通知微信,打开硬件排行榜
  289. *
  290. * 第三方通知微信,打开硬件排行榜
  291. */
  292. @interface OpenRankListReq : BaseReq
  293. @end
  294. #pragma mark - OpenRanklistResp
  295. /*! @brief 微信终端向第三方程序返回的OpenRankListReq处理结果。
  296. *
  297. * 第三方程序向微信终端发送OpenRankListReq后,微信发送回来的处理结果,该结果用OpenRankListResp表示。
  298. */
  299. @interface OpenRankListResp : BaseResp
  300. @end
  301. #pragma mark - JumpToBizProfileReq
  302. /* ! @brief 第三方通知微信,打开指定微信号profile页面
  303. *
  304. * 第三方通知微信,打开指定微信号profile页面
  305. */
  306. @interface JumpToBizProfileReq : BaseReq
  307. /** 跳转到该公众号的profile
  308. * @attention 长度不能超过512字节
  309. */
  310. @property (nonatomic, retain) NSString* username;
  311. /** 如果用户加了该公众号为好友,extMsg会上传到服务器
  312. * @attention 长度不能超过1024字节
  313. */
  314. @property (nonatomic, retain) NSString* extMsg;
  315. /**
  316. * 跳转的公众号类型
  317. * @see WXBizProfileType
  318. */
  319. @property (nonatomic, assign) int profileType;
  320. @end
  321. #pragma mark - JumpToBizWebviewReq
  322. /* ! @brief 第三方通知微信,打开指定usrname的profile网页版
  323. *
  324. */
  325. @interface JumpToBizWebviewReq : BaseReq
  326. /** 跳转的网页类型,目前只支持广告页
  327. * @see WXMPWebviewType
  328. */
  329. @property(nonatomic, assign) int webType;
  330. /** 跳转到该公众号的profile网页版
  331. * @attention 长度不能超过512字节
  332. */
  333. @property(nonatomic, retain) NSString* tousrname;
  334. /** 如果用户加了该公众号为好友,extMsg会上传到服务器
  335. * @attention 长度不能超过1024字节
  336. */
  337. @property(nonatomic, retain) NSString* extMsg;
  338. @end
  339. #pragma mark - WXCardItem
  340. @interface WXCardItem : NSObject
  341. /** 卡id
  342. * @attention 长度不能超过1024字节
  343. */
  344. @property (nonatomic,retain) NSString* cardId;
  345. /** ext信息
  346. * @attention 长度不能超过2024字节
  347. */
  348. @property (nonatomic,retain) NSString* extMsg;
  349. /**
  350. * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。
  351. */
  352. @property (nonatomic,assign) UInt32 cardState;
  353. /**
  354. * @attention req不需要填,chooseCard返回的。
  355. */
  356. @property (nonatomic,retain) NSString* encryptCode;
  357. /**
  358. * @attention req不需要填,chooseCard返回的。
  359. */
  360. @property (nonatomic,retain) NSString* appID;
  361. @end;
  362. #pragma mark - WXInvoiceItem
  363. @interface WXInvoiceItem : NSObject
  364. /** 卡id
  365. * @attention 长度不能超过1024字节
  366. */
  367. @property (nonatomic,retain) NSString* cardId;
  368. /** ext信息
  369. * @attention 长度不能超过2024字节
  370. */
  371. @property (nonatomic,retain) NSString* extMsg;
  372. /**
  373. * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。
  374. */
  375. @property (nonatomic,assign) UInt32 cardState;
  376. /**
  377. * @attention req不需要填,chooseCard返回的。
  378. */
  379. @property (nonatomic,retain) NSString* encryptCode;
  380. /**
  381. * @attention req不需要填,chooseCard返回的。
  382. */
  383. @property (nonatomic,retain) NSString* appID;
  384. @end
  385. #pragma mark - AddCardToWXCardPackageReq
  386. /* ! @brief 请求添加卡券至微信卡包
  387. *
  388. */
  389. @interface AddCardToWXCardPackageReq : BaseReq
  390. /** 卡列表
  391. * @attention 个数不能超过40个 类型WXCardItem
  392. */
  393. @property (nonatomic,retain) NSArray* cardAry;
  394. @end
  395. #pragma mark - AddCardToWXCardPackageResp
  396. /** ! @brief 微信返回第三方添加卡券结果
  397. *
  398. */
  399. @interface AddCardToWXCardPackageResp : BaseResp
  400. /** 卡列表
  401. * @attention 个数不能超过40个 类型WXCardItem
  402. */
  403. @property (nonatomic,retain) NSArray* cardAry;
  404. @end
  405. #pragma mark - WXChooseCardReq
  406. /* ! @brief 请求从微信选取卡券
  407. *
  408. */
  409. @interface WXChooseCardReq : BaseReq
  410. @property(nonatomic, strong) NSString *appID;
  411. @property(nonatomic, assign) UInt32 shopID;
  412. @property(nonatomic, assign) UInt32 canMultiSelect;
  413. @property(nonatomic, strong) NSString *cardType;
  414. @property(nonatomic, strong) NSString *cardTpID;
  415. @property(nonatomic, strong) NSString *signType;
  416. @property(nonatomic, strong) NSString *cardSign;
  417. @property(nonatomic, assign) UInt32 timeStamp;
  418. @property(nonatomic, strong) NSString *nonceStr;
  419. @end
  420. #pragma mark - WXChooseCardResp
  421. /** ! @brief 微信返回第三方请求选择卡券结果
  422. *
  423. */
  424. @interface WXChooseCardResp : BaseResp
  425. @property (nonatomic,retain) NSArray* cardAry;
  426. @end
  427. #pragma mark - WXChooseInvoiceReq
  428. /* ! @brief 请求从微信选取发票
  429. *
  430. */
  431. @interface WXChooseInvoiceReq : BaseReq
  432. @property (nonatomic, strong) NSString *appID;
  433. @property (nonatomic, assign) UInt32 shopID;
  434. @property (nonatomic, strong) NSString *signType;
  435. @property (nonatomic, strong) NSString *cardSign;
  436. @property (nonatomic, assign) UInt32 timeStamp;
  437. @property (nonatomic, strong) NSString *nonceStr;
  438. @end
  439. #pragma mark - WXChooseInvoiceResp
  440. /** ! @brief 微信返回第三方请求选择发票结果
  441. *
  442. */
  443. @interface WXChooseInvoiceResp : BaseResp
  444. @property (nonatomic, strong) NSArray* cardAry;
  445. @end
  446. #pragma mark - WXSubscriptionReq
  447. @interface WXSubscribeMsgReq : BaseReq
  448. @property (nonatomic, assign) UInt32 scene;
  449. @property (nonatomic, strong) NSString * templateId;
  450. @property (nonatomic, strong) NSString * reserved;
  451. @end
  452. #pragma mark - WXSubscriptionReq
  453. @interface WXSubscribeMsgResp : BaseResp
  454. @property (nonatomic, strong) NSString *templateId;
  455. @property (nonatomic, assign) UInt32 scene;
  456. @property (nonatomic, strong) NSString *action;
  457. @property (nonatomic, strong) NSString * reserved;
  458. @property (nonatomic, strong) NSString * openId;
  459. @end
  460. #pragma mark - WXMediaMessage
  461. #pragma mark - WXMediaMessage
  462. /*! @brief 多媒体消息结构体
  463. *
  464. * 用于微信终端和第三方程序之间传递消息的多媒体消息内容
  465. */
  466. @interface WXMediaMessage : NSObject
  467. +(WXMediaMessage *) message;
  468. /** 标题
  469. * @note 长度不能超过512字节
  470. */
  471. @property (nonatomic, retain) NSString *title;
  472. /** 描述内容
  473. * @note 长度不能超过1K
  474. */
  475. @property (nonatomic, retain) NSString *description;
  476. /** 缩略图数据
  477. * @note 大小不能超过32K
  478. */
  479. @property (nonatomic, retain) NSData *thumbData;
  480. /**
  481. * @note 长度不能超过64字节
  482. */
  483. @property (nonatomic, retain) NSString *mediaTagName;
  484. /**
  485. *
  486. */
  487. @property (nonatomic, retain) NSString *messageExt;
  488. @property (nonatomic, retain) NSString *messageAction;
  489. /**
  490. * 多媒体数据对象,可以为WXImageObject,WXMusicObject,WXVideoObject,WXWebpageObject等。
  491. */
  492. @property (nonatomic, retain) id mediaObject;
  493. /*! @brief 设置消息缩略图的方法
  494. *
  495. * @param image 缩略图
  496. * @note 大小不能超过32K
  497. */
  498. - (void) setThumbImage:(UIImage *)image;
  499. @end
  500. #pragma mark - WXImageObject
  501. /*! @brief 多媒体消息中包含的图片数据对象
  502. *
  503. * 微信终端和第三方程序之间传递消息中包含的图片数据对象。
  504. * @note imageData成员不能为空
  505. * @see WXMediaMessage
  506. */
  507. @interface WXImageObject : NSObject
  508. /*! @brief 返回一个WXImageObject对象
  509. *
  510. * @note 返回的WXImageObject对象是自动释放的
  511. */
  512. +(WXImageObject *) object;
  513. /** 图片真实数据内容
  514. * @note 大小不能超过10M
  515. */
  516. @property (nonatomic, retain) NSData *imageData;
  517. @end
  518. #pragma mark - WXMusicObject
  519. /*! @brief 多媒体消息中包含的音乐数据对象
  520. *
  521. * 微信终端和第三方程序之间传递消息中包含的音乐数据对象。
  522. * @note musicUrl和musicLowBandUrl成员不能同时为空。
  523. * @see WXMediaMessage
  524. */
  525. @interface WXMusicObject : NSObject
  526. /*! @brief 返回一个WXMusicObject对象
  527. *
  528. * @note 返回的WXMusicObject对象是自动释放的
  529. */
  530. +(WXMusicObject *) object;
  531. /** 音乐网页的url地址
  532. * @note 长度不能超过10K
  533. */
  534. @property (nonatomic, retain) NSString *musicUrl;
  535. /** 音乐lowband网页的url地址
  536. * @note 长度不能超过10K
  537. */
  538. @property (nonatomic, retain) NSString *musicLowBandUrl;
  539. /** 音乐数据url地址
  540. * @note 长度不能超过10K
  541. */
  542. @property (nonatomic, retain) NSString *musicDataUrl;
  543. /**音乐lowband数据url地址
  544. * @note 长度不能超过10K
  545. */
  546. @property (nonatomic, retain) NSString *musicLowBandDataUrl;
  547. @end
  548. #pragma mark - WXVideoObject
  549. /*! @brief 多媒体消息中包含的视频数据对象
  550. *
  551. * 微信终端和第三方程序之间传递消息中包含的视频数据对象。
  552. * @note videoUrl和videoLowBandUrl不能同时为空。
  553. * @see WXMediaMessage
  554. */
  555. @interface WXVideoObject : NSObject
  556. /*! @brief 返回一个WXVideoObject对象
  557. *
  558. * @note 返回的WXVideoObject对象是自动释放的
  559. */
  560. +(WXVideoObject *) object;
  561. /** 视频网页的url地址
  562. * @note 长度不能超过10K
  563. */
  564. @property (nonatomic, retain) NSString *videoUrl;
  565. /** 视频lowband网页的url地址
  566. * @note 长度不能超过10K
  567. */
  568. @property (nonatomic, retain) NSString *videoLowBandUrl;
  569. @end
  570. #pragma mark - WXWebpageObject
  571. /*! @brief 多媒体消息中包含的网页数据对象
  572. *
  573. * 微信终端和第三方程序之间传递消息中包含的网页数据对象。
  574. * @see WXMediaMessage
  575. */
  576. @interface WXWebpageObject : NSObject
  577. /*! @brief 返回一个WXWebpageObject对象
  578. *
  579. * @note 返回的WXWebpageObject对象是自动释放的
  580. */
  581. +(WXWebpageObject *) object;
  582. /** 网页的url地址
  583. * @note 不能为空且长度不能超过10K
  584. */
  585. @property (nonatomic, retain) NSString *webpageUrl;
  586. @end
  587. #pragma mark - WXAppExtendObject
  588. /*! @brief 多媒体消息中包含的App扩展数据对象
  589. *
  590. * 第三方程序向微信终端发送包含WXAppExtendObject的多媒体消息,
  591. * 微信需要处理该消息时,会调用该第三方程序来处理多媒体消息内容。
  592. * @note url,extInfo和fileData不能同时为空
  593. * @see WXMediaMessage
  594. */
  595. @interface WXAppExtendObject : NSObject
  596. /*! @brief 返回一个WXAppExtendObject对象
  597. *
  598. * @note 返回的WXAppExtendObject对象是自动释放的
  599. */
  600. +(WXAppExtendObject *) object;
  601. /** 若第三方程序不存在,微信终端会打开该url所指的App下载地址
  602. * @note 长度不能超过10K
  603. */
  604. @property (nonatomic, retain) NSString *url;
  605. /** 第三方程序自定义简单数据,微信终端会回传给第三方程序处理
  606. * @note 长度不能超过2K
  607. */
  608. @property (nonatomic, retain) NSString *extInfo;
  609. /** App文件数据,该数据发送给微信好友,微信好友需要点击后下载数据,微信终端会回传给第三方程序处理
  610. * @note 大小不能超过10M
  611. */
  612. @property (nonatomic, retain) NSData *fileData;
  613. @end
  614. #pragma mark - WXEmoticonObject
  615. /*! @brief 多媒体消息中包含的表情数据对象
  616. *
  617. * 微信终端和第三方程序之间传递消息中包含的表情数据对象。
  618. * @see WXMediaMessage
  619. */
  620. @interface WXEmoticonObject : NSObject
  621. /*! @brief 返回一个WXEmoticonObject对象
  622. *
  623. * @note 返回的WXEmoticonObject对象是自动释放的
  624. */
  625. +(WXEmoticonObject *) object;
  626. /** 表情真实数据内容
  627. * @note 大小不能超过10M
  628. */
  629. @property (nonatomic, retain) NSData *emoticonData;
  630. @end
  631. #pragma mark - WXFileObject
  632. /*! @brief 多媒体消息中包含的文件数据对象
  633. *
  634. * @see WXMediaMessage
  635. */
  636. @interface WXFileObject : NSObject
  637. /*! @brief 返回一个WXFileObject对象
  638. *
  639. * @note 返回的WXFileObject对象是自动释放的
  640. */
  641. +(WXFileObject *) object;
  642. /** 文件后缀名
  643. * @note 长度不超过64字节
  644. */
  645. @property (nonatomic, retain) NSString *fileExtension;
  646. /** 文件真实数据内容
  647. * @note 大小不能超过10M
  648. */
  649. @property (nonatomic, retain) NSData *fileData;
  650. @end
  651. #pragma mark - WXLocationObject
  652. /*! @brief 多媒体消息中包含的地理位置数据对象
  653. *
  654. * 微信终端和第三方程序之间传递消息中包含的地理位置数据对象。
  655. * @see WXMediaMessage
  656. */
  657. @interface WXLocationObject : NSObject
  658. /*! @brief 返回一个WXLocationObject对象
  659. *
  660. * @note 返回的WXLocationObject对象是自动释放的
  661. */
  662. +(WXLocationObject *) object;
  663. /** 地理位置信息
  664. * @note 经纬度
  665. */
  666. @property (nonatomic, assign) double lng; //经度
  667. @property (nonatomic, assign) double lat; //纬度
  668. @end
  669. @interface WXMiniProgramObject : NSObject
  670. /*! @brief WXMiniProgramObject对象
  671. *
  672. * @note 返回的WXMiniProgramObject对象是自动释放的
  673. */
  674. +(WXMiniProgramObject *) object;
  675. @property (nonatomic, strong) NSString *webpageUrl; //低版本网页链接
  676. @property (nonatomic, strong) NSString *userName; //小程序username
  677. @property (nonatomic, strong) NSString *path; //小程序页面的路径
  678. @property (nonatomic, strong) NSData *hdImageData; // 小程序新版本的预览图 128k
  679. @end
  680. #pragma mark - WXTextObject
  681. /*! @brief 多媒体消息中包含的文本数据对象
  682. *
  683. * 微信终端和第三方程序之间传递消息中包含的文本数据对象。
  684. * @see WXMediaMessage
  685. */
  686. @interface WXTextObject : NSObject
  687. /*! @brief 返回一个WXTextObject对象
  688. *
  689. * @note 返回的WXTextObject对象是自动释放的
  690. */
  691. +(WXTextObject *) object;
  692. /** 地理位置信息
  693. * @note 文本内容
  694. */
  695. @property (nonatomic, retain) NSString *contentText;
  696. @end