EzDevInfo.com

wechat.js

微信相关的 js 操作:分享、网络、菜单 Wechat.js

Pop WeChat/Weixin Safari-like Share Sheet in my app UIActivityViewController?

I'm trying to pop the built in Safari share WeChat in my iOS app. But can't find a way to make WeChat app show up in the UIActivityViewController!

enter image description here

I noticed that the WeChat app icon shows up when sharing images from the Photo Gallery, and Safari link sharing. The native Notes app doesn't have WeChat option.

Not sure how that's working, any help is appreciated! Thanks!


Source: (StackOverflow)

SSLError: Can't connect to HTTPS URL because the SSL module is not available on google app engine

Want to use wechat sdk to create menu

WeChat.create_menu({
     "button":[
     {    
          "type":"click",
          "name":"Daily Song",
          "key":"V1001_TODAY_MUSIC"
      },
      {
           "type":"click",
           "name":" Artist Profile",
           "key":"V1001_TODAY_SINGER"
      },
      {
           "name":"Menu",
           "sub_button":[
           {    
               "type":"view",
               "name":"Search",
               "url":"http://www.soso.com/"
            },
            {
               "type":"view",
               "name":"Video",
               "url":"http://v.qq.com/"
            },
            {
               "type":"click",
               "name":"Like us",
               "key":"V1001_GOOD"
            }]
       }]
 })

Currently not work because of this error:

Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 267, in Handle
    result = handler(dict(self._environ), self._StartResponse)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1519, in __call__
    response = self._internal_error(e)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
    rv = self.handle_exception(request, response, e)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
    rv = self.router.dispatch(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1253, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1077, in __call__
    return handler.dispatch()
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 547, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 545, in dispatch
    return method(*args, **kwargs)
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/wechatAPIHandler.py", line 72, in post
    "key":"V1001_GOOD"
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/wechat_sdk/basic.py", line 355, in create_menu
    data=menu_data
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/wechat_sdk/basic.py", line 949, in _post
    **kwargs
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/wechat_sdk/basic.py", line 907, in _request
    "access_token": self.access_token,
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/wechat_sdk/basic.py", line 849, in access_token
    self.grant_token()
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/wechat_sdk/basic.py", line 273, in grant_token
    "secret": self.__appsecret,
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/wechat_sdk/basic.py", line 935, in _get
    **kwargs
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/wechat_sdk/basic.py", line 917, in _request
    **kwargs
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/requests/api.py", line 50, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/requests/sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/base/data/home/apps/s~project-boom/1.384461758981660124/requests/adapters.py", line 431, in send
    raise SSLError(e, request=request)
SSLError: Can't connect to HTTPS URL because the SSL module is not available.

python request module is include in the app engine project. Using python 2.7. Being look for ways to solve this problem but have not find very clear way to solve the problem yet


Source: (StackOverflow)

Advertisements

Obtain openid by using WeixinJSBridge from wechat

I was wondering if any WeChat experts out there can tell me if there is a way to obtain the users open id by using WeixinJSBridge or some other way when they are viewing a URL inside of wechat?

Most of the resources I find out there is in Chinese and I can't use it.

Thanks


Source: (StackOverflow)

how to get mobile number using wechat api in android

how to get mobile number using wechat api in android. We can get mobile number and email-id by using Whatsapp api through this code

     AccountManager am = AccountManager.get(this);
     Account[] accounts = am.getAccounts();

So like that is it possible to get mobile number using wechat api ????


Source: (StackOverflow)

Getting Started with the WeChat Android SDK

I have downloaded the SDK example from WeChat website: http://dev.wechat.com/document/gettingstart/android/

I used Eclipse and ADT, target platform Android 2.2 on Samsung Galaxy Spica i5700.

The problem is that the provided demo application is only capable of starting WeChat messenger, while all other function calls do not make any effect on WeChat app.

I was debugging through Eclipse and I saw that API calls to WeChat return success, but weChat is not really responding to any request from the demo app. For example, if I want to share text on "Moments" or to send an image to current scene (chat session), nothing happens, but also no error occurs.

Has anyone made it work this demo application?

Thanks.


Source: (StackOverflow)

WeChat sharing, how to change re-share description and thumbail?

Question

Is there a way to provide a custom title, description and thumbnail for when my website pages are shared from within WeChat?

Background

We have an iPhone app from which users can publish/share posts with their friends using WeChat (aka Weixin).

When sharing from the app a title, a description and an image are posted via the API for the shared page (these display as desired when shared from the app). Once shared the friends open these pages in WeChat (and not our app).

The problem is that when the friends re-share our pages using WeChat's own share button it loses the description we provided. It will re-share with the HTML title tag, the first image on the page (stretched or squished to a square thumbnail) and where the description was originally it just shows the URL of the page.

I have tried providing descriptions in a description meta tag but to no luck. I have even tried Facebook style/open graph og:description meta tags.

Sidenote

I have looked through the source on a Chinese site that seems to have overcome this issue. I think it's solved using a javascript plugin of some sort called WeixinJSBridge. Unfortunately I have been unable to uncover any documentation in English - My Chinese isn't great, and by not great I mean, I can't read a word.


Source: (StackOverflow)

WeChat SDK on arm64

I was trying to use libWeChatSDK.a library in my iPhone application and on iPhone 5 it works as it should. However I encountered problems with the newest iPhone, it seems that this library does not support arm64 architecture.

The error I've got is the following:

ld: warning: ignoring file .../libWeChatSDK.a, missing required architecture arm64 in file .../libWeChatSDK.a (3 slices)
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_SendMessageToWXReq", referenced from:
      objc-class-ref in WeChatCustomActivity.o
  "_OBJC_CLASS_$_WXApi", referenced from:
      objc-class-ref in WeChatCustomActivity.o
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Do you know if there are some kind of workarounds for this problem?


Source: (StackOverflow)

Link to follow someone on WeChat / Weixin

I have a page with my company WeChat / Weixin QR Code. You cannot scan the QR code if you are viewing the site on your mobile (quite a paradox for a mobile-based social network).
I would like to add a button that is only visible on touch enabled devices (<--This part I know how to do) that will automatically open WeChat / Weixin to the "Follow user" page.

I've found several sites that claim it is possible, but they are all in Chinese. I tried copying their code and just changing the unique WeChat / Weixin user ID code, but it does nothing.

Also, the official WeChat dev page gives no info on how to do this.

Optimally, this should work on any mobile OS.


Source: (StackOverflow)

Open Wechat official account via link on external page

I couldn't find any reference to that question, and I hope someone here knows.

I created a promotional html5 page for a client. This page is on my server. I am sharing the page address via WeChat to the client, and he is re-sharing it to his friends. When they open the page, it's opening in the WeChat APP Browser.

So far so good.

He asked me to implement a button / link on that page, directing users to his official account on WeChat. And that's where I am stuck, because I couldn't find any reference for doing this, but I know it's possible.

I found some QR codes, that when scanned via the WeChat APP, are opening an official page, inside the WeChat APP. Yet I couldn't find any way via HTML to do this.

Anyone has a suggestion?

PS:

weixin://contacts/profile/name 

is not working for me.

The process in steps:

  1. User scans QR code via WeChat APP, gets to landing page (inside WeChat)
  2. User clicks on link / button and is being redirected to an "official page/profile" inside WeChat

Thanks a lot!

George


Source: (StackOverflow)

Not getting WeChat Follow response

I have a Debugging Official Account with WeChat. I have entered my public URL and Token into the field provided http://admin.wechat.com/debug/sandbox and also attempted debugging the request with http://admin.wechat.com/debug/

My ASP.Net [.Net4.5] Web API application's POST Method looks like the following :

public HttpResponseMessage PostMessage([FromBody]Strikemedia.Api.WeChat.TextMessage value)
    {
        if (value == null)
        {
            var richMediaMessage = new RichMediaMessage();
            richMediaMessage.touser = value.FromuserName;

            //Create Article
            var item = new Article()
            {
                title = "Didn't receive anything back",
                description = "Mind entering 'test'",
                picurl = "URL",
                url = "URL"
            };
            var articles = new List<Article>();
            articles.Add(item);
            richMediaMessage.articles = articles;
            richMediaMessage.articleCount = articles.Count;
            return Request.CreateResponse(HttpStatusCode.OK, richMediaMessage, "application/json");
        }

        var exploded = value.Content.Split(' ')[0];

        var richMedia = new RichMediaMessage();
        richMedia.touser = value.FromuserName;

        //Create Article
        var article = new Article() { 
            title = response.KeywordDescription,
            description = response.Response,
            picurl = "URL",
            url = "URL"
        };
        var _articles = new List<Article>();
        _articles.Add(article);
        richMedia.articles = _articles;
        richMedia.articleCount = _articles.Count;

        //Return response
        var resp = Request.CreateResponse(HttpStatusCode.OK, richMedia, "application/json");
        //resp.RequestMessage.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
        return resp;
    }

It needs to respond with a RichMessageType in JSON format and is received in XML format

Am i missing something or have i overlooked something?


Source: (StackOverflow)

How to logout from WeChat programmatically in iOS?

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?


Source: (StackOverflow)

wechat android app api not Working

I m facing problem using wechat android apis. We chat android apis are not working in my app. I registered my app in app registration page but, I haven't yet put the signature of the application in the registration page. Please someone let me know how to get the signature of the application from debug.keystore so that the app gets approved.


Source: (StackOverflow)

weChat SDK Build Errors

I'm trying to get weChat SDK working with my app. I followed the link below to download the arm64 file but had no luck. I still get the following 3 errors:

WeChat SDK on arm64

Undefined symbols for architecture arm64:
  "operator new[](unsigned long)", referenced from:
      +[WeChatApiUtil EncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil NsDataEncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeWithBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
  "operator delete[](void*)", referenced from:
      +[WeChatApiUtil EncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil NsDataEncodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeWithBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
      +[WeChatApiUtil DecodeBase64:] in libWeChatSDK.a(WeChatApiUtil.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please help...


Source: (StackOverflow)

How do you obtain a WeChat access_token certificate from api.wechat.com?

This site tries to explain the process: http://admin.wechat.com/wiki/index.php?title=Access_token

The problem is nowhere do they tell you where to get the AppID or what exactly the secret is.Has anyone else succeeded in communicating with WeChat?


Source: (StackOverflow)

how to set default value as text and auto increment in mysql table [closed]

I am trying to set the default username as like wechat which have something like wxid_1234 so can we set default username in our mysql table?

There is a table named 'username' and have two columns: 'username' and 'phone'. Since 'username' needs to be set something like foo_123 and may be auto increased with foo_124, foo_125 etc. It could be changed afterwards.

So is it possible to set the username like that? if not what is the other method to do it.


Source: (StackOverflow)