Module: MotionWechat::Config
Instance Method Summary collapse
- #info_plist_key ⇒ Object
- #key ⇒ Object
-
#setup(app, key, secret) ⇒ Object
Setup wechat information to rubymotion app, i.e.
Instance Method Details
#info_plist_key ⇒ Object
5 |
# File 'lib/motion-wechat/config.rb', line 5 def info_plist_key; "WechatConfig"; end |
#key ⇒ Object
6 |
# File 'lib/motion-wechat/config.rb', line 6 def key; @key; end |
#setup(app, key, secret) ⇒ Object
Setup wechat information to rubymotion app, i.e. key, secret…
Example: (in Rakefile)
Motion::Project::App.setup do |app|
...
MotionWechat::Config.setup(app, 'app_key', 'app_secret')
end
Arguments:
RubyMotion app: (Motion::Project::App)
Wechat key: (String)
Wechat secret: (String)
other options: (Hash)
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/motion-wechat/config.rb', line 22 def setup(app, key, secret) @key = key @secret = secret app.info_plist[info_plist_key] = { key: @key, secret: @secret } bundle_url_types = [ { 'CFBundleURLName' => "weixin", 'CFBundleURLSchemes' => [app.info_plist[info_plist_key][:key]] } ] app.info_plist['CFBundleURLTypes'] ||= [] app.info_plist['CFBundleURLTypes'] += bundle_url_types end |