fastlane-plugin-line_notify 0.1.1 → 0.2.0

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
  SHA1:
3
- metadata.gz: 9fd30f264ce0bdeec56c83f20514a3ee3f3d356b
4
- data.tar.gz: a4399d2cf24a312985fda0bad08e2a0a023affa9
3
+ metadata.gz: b0b962bb825195c0a264f11d7c90c05d1ca4e349
4
+ data.tar.gz: d7b53743dcb3d39211acab82fdbe24216f8ebb5c
5
5
  SHA512:
6
- metadata.gz: 4002178562c5eb183535d24f53a9872a7ebbb780691bc76bfdde1c0a6c8d1712180ad412e8ca1858e478b0ad1a45043a073e6a4c8d6da5a5df83e42bef4a94af
7
- data.tar.gz: a47d972397252799961aa9de4231797291544dfb918b2faed88c1069cae227dadad985f7b4b363ee7f4a330ef7d00d9e986eaa1d7b3091a9e11b5f1ae7208b21
6
+ metadata.gz: ae905fa1c2e97ebec3699c52eeac5b48cfd87ef9d02b5149eb289b378170ffda28c49b30c5e0711f40f87dab4a5c8427f6c9035e6a22ab3edfb0b2d591ffaf9a
7
+ data.tar.gz: f5dfbaec139071c5e155d30717b55f56fdc6e7862b977a4bbd171f1597f40f2d7d1529373d20500841fbfbc52ae1aa31566ee4771af4dd2862eb8eb696738668
data/README.md CHANGED
@@ -10,6 +10,9 @@ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To
10
10
  fastlane add_plugin line_notify
11
11
  ```
12
12
 
13
+ You can generate access token from **My Page** https://notify-bot.line.me/my/
14
+ Check out the sticker list. https://devdocs.line.me/files/sticker_list.pdf
15
+
13
16
  ## About line_notify
14
17
 
15
18
  To be able to send message to Line Notify
@@ -18,6 +21,17 @@ To be able to send message to Line Notify
18
21
 
19
22
  ## Example
20
23
 
24
+ ```ruby
25
+ line_notify(
26
+ access_token: 'Your Access Token',
27
+ message: 'Hello World', #Optional String
28
+ sticker_package_id: '1', #Optional String
29
+ sticker_id: '133', #Optional String
30
+ image_full_size: nil, #Optional **URL** String
31
+ image_thumbnail: nil, #Optional **URL** String
32
+ )
33
+ ```
34
+
21
35
  Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
22
36
 
23
37
  **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
@@ -31,6 +45,7 @@ rake
31
45
  ```
32
46
 
33
47
  To automatically fix many of the styling issues, use
48
+
34
49
  ```
35
50
  rubocop -a
36
51
  ```
@@ -1,4 +1,5 @@
1
1
  require 'fastlane/action'
2
+ require 'net/https'
2
3
  require_relative '../helper/line_notify_helper'
3
4
 
4
5
  module Fastlane
@@ -7,15 +8,29 @@ module Fastlane
7
8
  def self.run(params)
8
9
 
9
10
  access_token = params[:access_token]
10
- message = params[:message]
11
+
12
+ uri = URI.parse('https://notify-api.line.me/api/notify')
13
+ Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |req|
14
+ request = Net::HTTP::Post.new(uri)
15
+ request["Authorization"] = "Bearer #{access_token}"
16
+ request.set_form_data({
17
+ message: params[:message],
18
+ imageThumbnail: params[:image_thumbnail],
19
+ imageFullsize: params[:image_full_size],
20
+ stickerPackageId: params[:sticker_package_id],
21
+ stickerId: params[:sticker_id],
22
+ })
11
23
 
12
- cmd = ['curl']
13
- cmd << 'https://notify-api.line.me/api/notify'
14
- cmd << '-X POST'
15
- cmd << "-H 'Content-Type: application/x-www-form-urlencoded'"
16
- cmd << "-H 'Authorization: Bearer #{access_token}'"
17
- cmd << "-d message='#{message}'"
18
- sh cmd.join(' ') end
24
+ req.request(request)
25
+ end
26
+ end
27
+ # cmd = ['curl']
28
+ # cmd << 'https://notify-api.line.me/api/notify'
29
+ # cmd << '-X POST'
30
+ # cmd << "-H 'Content-Type: application/x-www-form-urlencoded'"
31
+ # cmd << "-H 'Authorization: Bearer #{access_token}'"
32
+ # cmd << "-d message='#{message}'"
33
+ # sh cmd.join(' ') end
19
34
 
20
35
  def self.description
21
36
  "You can use this action to send message via Line Notify"
@@ -45,7 +60,29 @@ module Fastlane
45
60
  end),
46
61
  FastlaneCore::ConfigItem.new(key: :message,
47
62
  env_name: "LINE_NOTIFY_MESSAGE",
48
- description: "The message that should be displayed on Line Notify"),
63
+ description: "The message that should be displayed on Line Notify",
64
+ optional: true),
65
+
66
+ FastlaneCore::ConfigItem.new(key: :image_thumbnail,
67
+ env_name: "LINE_NOTIFY_IMAGE_THUMBNAIL",
68
+ description: "imageThumbnail Maximum size of 240×240px JPEG",
69
+ optional: true),
70
+
71
+ FastlaneCore::ConfigItem.new(key: :image_full_size,
72
+ env_name: "LINE_NOTIFY_IMAGE_FULL_SIZE",
73
+ description: "imageFullsize Maximum size of 1024×1024px JPEG",
74
+ optional: true),
75
+
76
+ FastlaneCore::ConfigItem.new(key: :sticker_package_id,
77
+ env_name: "LINE_NOTIFY_STICKER_PACKAGE_ID",
78
+ description: "stickerPackageId Package ID",
79
+ optional: true),
80
+
81
+ FastlaneCore::ConfigItem.new(key: :sticker_id,
82
+ env_name: "LINE_NOTIFY_STICKER_ID",
83
+ description: "stickerId Sticker ID",
84
+ optional: true),
85
+
49
86
  ]
50
87
  end
51
88
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module LineNotify
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-line_notify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AKKHARAWAT CHAYAPIWAT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-06 00:00:00.000000000 Z
11
+ date: 2018-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry