WXApiObject.h 22 KB

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