简体   繁体   中英

How to receive message in wechat itegrated in ios?

I have integrate wechat sdk in iphone app. I can send a message with using SendMessageToWXReq class. But How i should receive the message within the my app.How GetMessageFromWXReq and ShowMessageFromWXReq works? Please provide me sample code.

onResp not called.

AppDelegate.m

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { 
        return [WXApi handleOpenURL:url delegate:self]; 
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
        return [WXApi handleOpenURL:url delegate:self]; 
}

Here,if you set delegate to self ,you will get onResp called in AppDelegate.m

If you set delegate to some other viewController instance, you will get onResp called in viewController.m

If this helps you, please let me know.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM