相关ane:flash 广告ane http://code.google.com/p/adoble-flash-air-ad-network-framework/ 微信ane1.0 基于WeChatSDK_1.4.2.1(发布日sdk最新版本),air sdk3.9编译 下载地址:http://wechat-ane-for-flash-air.googlecode.com/svn/trunk/wechat-ane-for-flash-air.7z 接口 获取微信实例 - public static function getInstance():WeChat;
复制代码
测试当前设备是否支持此ane,ios真机返回true - public function get supportDevice():Boolean
复制代码
设置应用id,应用的id是在http://open.weixin.qq.com/注册创建应用得到的应用唯一ID - public function registerApp(appID:String):Boolean
复制代码
检测机器上是否安装了微信 - public function isWXAppInstalled():Boolean
复制代码
检测微信是否支持当前sdk版本 - public function isWXAppSupportApi():Boolean
复制代码
获取微信微信的下载地址 - public function getWXAppInstallUrl():String
复制代码
获取微信的版本号 - public function getApiVersion():String
复制代码
打开微信 - public function openWXApp():Boolean
复制代码
发布一条消息到微信里面,scene设置发布的地址,0 聊天界面,1 朋友圈,2 收藏 - public function sendTextMessage(context:String,scene:int):Boolean
复制代码
发布一条消息到微信里面,imagePath是图片路径,本地文件路径,网址型图片地址是否支持未测试,title为图片标题,scene和sendTextMessage一致 - public function sendImageMessage(imagePath:String,title:String,scene:int):Boolean
复制代码
发布一条消息到微信里面,url是点击图片后跳转到的地址,一般是你的网站或者应用下载地址,title是图片标题,其他同sendImageMessage - public function sendLinkMessage(imagePath:String,url:String,title:String,des:String,scene:int):Boolean
复制代码
发送完消息后会有事件 onSendResult 注意:图片不要超过10m,标题不要太长,否则发送会失败,并且无任何反馈(腾讯竟然如此水平),应用要审核过了才能发消息 使用: xxx-app.xml中配置: 扩展ID
- <extensionID>so.cuo.platform.wechat</extensionID>
复制代码
ios平台设置:样式如下,wx21fb4d35f5eba37b替换为你自己的应用ID
flash as3 代码使用微信ane - var wx:WeChat=WeChat.getInstance();
- if(!wx.supportDevice){
- trace("not support device");
- return;
- }else{
- wx.registerApp("wx21fb4d35f5eba37b");
- var url:String=file.nativePath;
- trace(wx.sendLinkMessage(url,"http://www.cuo.so/","m game","zui h",WeChat.WXSceneTimeline));
- }
复制代码
更详细和完整的代码看demo.as和demo-app.xml 注意:目前只支持ios平台
本文来自:http://bbs.9ria.com/thread-280184-1-1.html
|