When configurations with the same account name exist in both database and yml file or environment parameter, the one in the database will take precedence. When database account configuration is enabled, database configurations will be loaded after yml configuration file or environment parameters. Running wechat command in the root folder of Rails application will be using the Rails configuration first ( default section), if can not find it, will relay on ~\.wechat.yml, such behavior enables managing more wechat public account and enterprise account without changing your home ~\.wechat.yml file. Path to jsapi ticket storage file.Īfter updating database account configurations, you need to restart the server, or call Wechat.reload_config! to reload the updates. Either this attribute or appid must be specified.Ĭorp account configuration. Required when appid exists.Ĭorp account id. Either this attribute or corpid must be specified. Account names must be unique within each environment. For example, a production config will only be available in production. Typical values are: production, development and test. <<: *default appid: "my_appid " secret: "my_secret " # `mp` is short for **mini program** type: 'mp ' Database wechat account configurationĪfter enabling database account configuration, the following table will be created: Attribute # Mini Program Accounts mini_development: Where development, test, production segments are the default configuration, one needs to add wx2_development, wx2_test, wx2_production in order to add additional account named wx2.ĭeclaration of additional wechat_responder: Notes about supporting multiple accounts of WeChat Official Accounts Platform / WeChat Enterprise (for example, adding account wx2):Ĭonfiguration for multiple accounts is similar to multi-database configuration in config/database.yml, # jsapi_ticket: "tmp/wechat_jsapi_ticket2" # access_token: "tmp/wechat_access_token2" Jsapi_ticket: "C:/Users//wechat_jsapi_ticket" InstallationĪccess_token: "C:/Users//wechat_access_token" There is a more complete wechat-starter demo available, which futher includes the payment SDK feature. If tencent's weui UI style is adoped in your project, gem weui-rails is available for you.įor web page only wechat application, please use wechat_api, which only contains web features, compared with traditional message type wechat_responder. If Wechat OAuth 2.0 is required by your app, omniauth-wechat-oauth2 is recommended in order to apply devise authentication. Wechat command shares the same API in console, so you can interact with wechat server quickly without starting up web environment/code.Ī responder DSL can be used in Rails controller, which gives an event based interface to handle messages sent by end users. Record session when receiving message from user (Optional).Receiving message(rails server is required to be running).Sending message API(can be both accessed via console or rails server). WeChat gem helps Rails developers integrate WeChat Official Accounts Platform or Wechat mini program easily, including features: It was first released in 2011, and by 2018 it was one of the world's largest standalone mobile apps by monthly active users, with over 1 billion monthly active users (902 million daily active users). Wechat is a Chinese multi-purpose messaging, social media and mobile payment app developed by Tencent.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |