V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
iYu
V2EX  ›  iDev

微信SDK是怎么能在App与微信之间传递数据的

  •  
  •   iYu ·
    iiiyu · 2012-08-22 17:53:47 +08:00 · 5938 次点击
    这是一个创建于 4257 天前的主题,其中的信息可能已经有所发展或是发生改变。
    微信SDK是怎么能在App与微信之间传递数据的。今天看了一下微信开放平台。下了SDK跑了跑。然后就产生了这个疑问。或者问iOS中有App之间传递数据的方法么。
    主要是怎么传递的图片,一开始以为是他存在了相册里面,找了找没有看见。然后以为是上传到了tx自己的服务器然后。微信自己去找。然后断网试试。还是可以传过去。
    具体方法贴一下
    - (void) sendImageContent
    {
    //发送内容给微信
    WXMediaMessage *message = [WXMediaMessage message];
    [message setThumbImage:[UIImage imageNamed:@"res2.jpg"]];

    WXImageObject *ext = [WXImageObject object];
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"res2" ofType:@"jpg"];
    ext.imageData = [NSData dataWithContentsOfFile:filePath] ;

    message.mediaObject = ext;

    SendMessageToWXReq* req = [[[SendMessageToWXReq alloc] init]autorelease];
    req.bText = NO;
    req.message = message;
    req.scene = _scene;

    [WXApi sendReq:req];
    }

    - (void) RespImageContent
    {
    WXMediaMessage *message = [WXMediaMessage message];
    [message setThumbImage:[UIImage imageNamed:@"res2.jpg"]];
    WXImageObject *ext = [WXImageObject object];
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"res2" ofType:@"jpg"];
    ext.imageData = [NSData dataWithContentsOfFile:filePath] ;
    message.mediaObject = ext;

    GetMessageFromWXResp* resp = [[[GetMessageFromWXResp alloc] init] autorelease];
    resp.message = message;
    resp.bText = NO;

    [WXApi sendResp:resp];
    }


    大家有app之间传递数据的方法么?
    4 条回复    1970-01-01 08:00:00 +08:00
    iYu
        1
    iYu  
    OP
       2012-08-22 17:59:03 +08:00
    qdvictory
        2
    qdvictory  
       2012-08-22 18:13:01 +08:00   ❤️ 2
    qdvictory
        3
    qdvictory  
       2012-08-22 18:14:24 +08:00   ❤️ 1
    flexih
        4
    flexih  
       2012-08-23 10:17:53 +08:00
    楼上正解
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3244 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 14:09 · PVG 22:09 · LAX 07:09 · JFK 10:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.