WXApiObject.h 26 KB

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