How to logout from WeChat programmatically in iOS?
Asked Answered
F

2

1

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?

Fortunna answered 13/8, 2014 at 12:38 Comment(4)
pragmatically?Nightwalker
Isn't there any Controller like MFMailComposeViewController in WeChat SDK? Just share from right within the app...Jape
Hi Can you tell me how can I login with using we chat and get user information in my iPhone application?Job
aksh can you please share your code for which you successfully integrated the wechat into my application.Sheepherder
S
0

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];
                }
            }
        }
Shelleyshellfire answered 13/8, 2014 at 12:46 Comment(0)
C
0

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.

Choreographer answered 27/8, 2014 at 15:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.