How to exit WeChat programmatically in iOS?

I want to exit the program programmatically from wechat, as on Facebook and Twitter. Is it possible?

Now I have successfully integrated wechat into my application using the WeChat SDK , but when I click the sharing button (in my application) to share the image on wechat, I am redirected to the wechat application, and then after successful loading back to my application.

But is it possible to stop being redirected to the WeChat application? I just want to share the image without being redirected to the WeChat app. And also how to split multiple images at once on WeChat?

+1
source share
2 answers

Try this, perhaps its work 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];
                }
            }
        }
0
source

It WeChat SDKdoesn't seem to provide a way to share something without redirecting to WeChat.

This is because the sharing function WeChatdoes not store user credentials (for example, OAuth) in your application locally, so every time you need to redirect information about who wants to share.

0
source

All Articles