问题
I want to logout programatically from wechat just like we do in Facebook and Twitter. Is it possible?
Righty now I have successfully integrated the wechat into my application using WeChat SDK, but when I am pressing the share button (in my application) to share the image on wechat then I am redirected to the wechat application and then after successful uploading return to my application.
But is it possible to stop being redirected to WeChat application? I just simply want to share image without redirect to WeChat application. And also how to share multiple image in once on WeChat?
回答1:
Try this may be its works for you..
-(void) weChatDidLogout
{
NSLog(@"Logged out of wechat");
NSHTTPCookie *cookie;
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (cookie in [storage cookies])
{
NSString* domainName = [cookie domain];
NSRange domainRange = [domainName rangeOfString:@"wechat"];
if(domainRange.length > 0)
{
[storage deleteCookie:cookie];
}
}
}
回答2:
It seems WeChat SDK
does not provide a way in which could share something without redirect to WeChat
.
This is because the share function of WeChat
does not store any user credential (like OAuth) in your app locally, so it need to redirect every time to know who want to share.
来源:https://stackoverflow.com/questions/25286387/how-to-logout-from-wechat-programmatically-in-ios