fastlane-plugin-pgyer_jvtd 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 432b6b3841a84b965633e0fd1c75c1bd291fbcf47084507ed65860faf03b7669
4
- data.tar.gz: 4e57879c20d840ca51540f552fa5752afe172bbe58d09332ec352ec89132eddf
3
+ metadata.gz: 992372b718d83b14a52c6d05afc402aa0474bf38b6079f1ad994382246125204
4
+ data.tar.gz: 50dbf14c5efc6c1728656b41932fa0bf3fdec33cf8ca87055b1079a1f46a0ea9
5
5
  SHA512:
6
- metadata.gz: 79fbf352fed2ff66d2d8d0b77d3544ed2d09324d7a784cb569d7ea0a3bb1174f7fd958f15ac0334cd49c1814b1a5731ba8fafb1de705a5a7c6c68af07de7748f
7
- data.tar.gz: 11732bebc85e7bb1aefd6ea835cacd7a8f28050ce4da9f28b33b03265b615d966e501041371d32bad6c2014fb2bb8c02cf1ba46438df25e7a2b135b92828d755
6
+ metadata.gz: 67c5c15f8fa582ac2f6a3531fe0599e780a8db4966f62f2fdfeefaee75dc8ddad58abed10059a06f5d624e07cab3211efbc45418d64e0da939a8b6d8f7f85f23
7
+ data.tar.gz: b2e2cc3f1b547487ff33c366504ba46529892ac52837cd705672cf341e5ac86a06ac08b3985c59e42b50d37c0f3da028c96c1c07d2a8c21c19b0b6e5295da5ab
@@ -103,24 +103,44 @@ module Fastlane
103
103
  appUrl = "https://www.pgyer.com/#{info['data']['appShortcutUrl']}"
104
104
 
105
105
  unless access_token.nil?
106
- DingBot.endpoint = 'https://oapi.dingtalk.com/robot/send'
107
- DingBot.access_token = access_token
108
-
109
- message = DingBot::Message::Link.new(
110
- "#{appType} App发布",
111
- "请下载最新版本#{appVersion}(#{appBuildVersion})",
112
- appUrl,
113
- appIcon
114
- )
115
- DingBot.send_msg(message)
106
+ # 将应用信息发送到钉钉
107
+ uri = URI.parse("https://oapi.dingtalk.com/robot/send?access_token=#{access_token}")
108
+ https = Net::HTTP.new(uri.host, uri.port)
109
+ https.use_ssl = true
110
+ req = Net::HTTP::Post.new(uri.request_uri)
111
+ req.body = {
112
+ "msgtype"=> "link",
113
+ "link"=> {
114
+ "text"=> "#{appType} App发布"。
115
+ "title"=> "请下载最新版本#{appVersion}(#{appBuildVersion})",
116
+ "picUrl"=> appIcon,
117
+ "messageUrl"=> appUrl}
118
+ }.to_json
119
+ req.content_type = 'application/json'
120
+ resp = https.request(req)
121
+ json = JSON.parse(resp.body)
116
122
 
117
- message = DingBot::Message::Text.new(
118
- "#{appType} App最新版本已发布",
119
- [],
120
- is_at_all == "1"
121
- )
122
- DingBot.send_msg(message)
123
- UI.success "Message send success."
123
+ if json["errcode"] != 0
124
+ UI.error('ding talk error message: ' + json["errmsg"])
125
+ end
126
+
127
+ req1 = Net::HTTP::Post.new(uri.request_uri)
128
+ req1.body = {
129
+ "msgtype"=> "link",
130
+ "link"=> {
131
+ "text"=> "#{appType} App发布"。
132
+ "title"=> "请下载最新版本#{appVersion}(#{appBuildVersion})",
133
+ "picUrl"=> appIcon,
134
+ "messageUrl"=> appUrl}
135
+ }.to_json
136
+ req1.content_type = 'application/json'
137
+ resp1 = https.request(req1)
138
+ json1 = JSON.parse(resp1.body)
139
+
140
+ if json1["errcode"] != 0
141
+ UI.error('ding talk error message: ' + json1["errmsg"])
142
+ end
143
+ UI.success("Successfully send qr code to ding talk!")
124
144
  else
125
145
  end
126
146
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module PgyerJvtd
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-pgyer_jvtd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - 陈磊的MacBook Pro