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 · Aug 22, 2012 · 6725 views
    This topic created in 5010 days ago, the information mentioned may be changed or developed.
    微信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 replies    1970-01-01 08:00:00 +08:00
    iYu
        1
    iYu  
    OP
       Aug 22, 2012
    qdvictory
        2
    qdvictory  
       Aug 22, 2012   ❤️ 2
    qdvictory
        3
    qdvictory  
       Aug 22, 2012   ❤️ 1
    flexih
        4
    flexih  
       Aug 23, 2012
    楼上正解
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5596 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 84ms · UTC 09:05 · PVG 17:05 · LAX 02:05 · JFK 05:05
    ♥ Do have faith in what you're doing.