kamiliff 0.18.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b7f6b3d3e1e6b57b4003c1ed2a95d7cdb1726a922ebb23eba0310e6ba05f338
4
- data.tar.gz: ab0f41161cafea016541fd7dd05a51b989385137ce3f27bcd624acb54b050093
3
+ metadata.gz: d8d9f1e36c1dc706651145146649792d8f128784824c476d688e1b7c42b0e6ba
4
+ data.tar.gz: 2bc4437b67d94a0bb39456d470a615d63363aadf43bb1fbf6301659fc80e982e
5
5
  SHA512:
6
- metadata.gz: 95b6417918ce52ec75516cc177154e19c368b8d6f93096f75847203e81a8d818908457b8da220574981d45d3f0a34d26b2f03834433b72fc85ddaa70b09ece7d
7
- data.tar.gz: 4219c16cd1fe13f91832c57303d97f154a41c1ecb5f1241f2221756d37f5993638940e448bf4320a0bb1cae641fb4ce1462e5061fb935227c41ad6edd9ef933b
6
+ metadata.gz: 7debaefba5c60a6327e74db069680dbcd4462a42c1ad31a10ea28456651302032e7c6c4c8a9a625509ee095731a8292f6e6424a63b629065483e769215607d71
7
+ data.tar.gz: ce34f047195fe836f37f3da058902aef6218448efacc0c0bf5e1d11235e9b0e6d57a3d16d02ba95f462e51af1c83d782a9240411cae49eea95863a881ada2172
data/README.md CHANGED
@@ -41,6 +41,8 @@ Since the compact size is default. You could only create the compact one.
41
41
 
42
42
  **NOTICE:** As LINE announcement, due to a function enhancement with LIFF v2, you should add LIFF apps to LINE Login channel. The LIFF apps added to Messaging API channels are still allowed to use.
43
43
 
44
+ For the [Behaviors from accessing the LIFF URL to opening the LIFF app](https://developers.line.biz/en/docs/liff/opening-liff-app/#redirect-flow) setting, please use the Concatenate mode. That's the default value in the Kamiliff. If you want to use the Replace mode([will be removed on March 1, 2021](https://developers.line.biz/en/news/2020/11/20/discontinue-replace-mode-announcement/)), you can add an enviroment variable `LIFF_MODE` and set the value to `replace`.
45
+
44
46
  ### Set environment variables
45
47
  Create a file `.env` with the following content under the root directory. Kamiliff provides two setting ways, you can choose the one based on the position where LIFF apps added.
46
48
 
@@ -16,8 +16,9 @@ class LiffController < ActionController::Base
16
16
  end
17
17
 
18
18
  def route
19
- path = params["path"]
20
- @body = reserve_route(path, request_params: source_info, format: :liff)
19
+ path, query = params["path"].split("?")
20
+ query = Rack::Utils.parse_nested_query(query)
21
+ @body = reserve_route(path, request_params: source_info.merge(query), format: :liff)
21
22
  end
22
23
 
23
24
  private
@@ -5,12 +5,28 @@
5
5
  <%= csrf_meta_tags %>
6
6
  <%= csp_meta_tag %>
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1" >
8
- <script src="https://static.line-scdn.net/liff/edge/2.1/sdk.js"></script>
9
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
8
+ <script src="https://static.line-scdn.net/liff/edge/versions/2.5.0/sdk.js"></script>
9
+
10
+ <% asset_application_js_path = Dir.glob("#{Rails.root}/app/assets/javascripts/application.*").first %>
11
+ <% if asset_application_js_path.present? %>
12
+ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
13
+ <% end %>
14
+
15
+ <% webpacker_application_js_path = Dir.glob("#{Rails.root}/app/javascript/packs/application.*").first %>
16
+ <% if webpacker_application_js_path.present? %>
17
+ <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
18
+ <% end %>
19
+
20
+ <% has_jquery = [asset_application_js_path, webpacker_application_js_path].compact.map do |path|
21
+ (File.read(path) =~ /jquery/i).present?
22
+ end.any? %>
23
+
24
+ <% unless has_jquery %>
25
+ <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
26
+ <% end %>
10
27
 
11
28
  <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
12
29
  <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
13
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
14
30
  <script>
15
31
  function liff_send_text_message(text){
16
32
  liff.sendMessages(
@@ -20,7 +20,7 @@ class LiffService
20
20
  self.size = size.to_s.upcase
21
21
  raise "liff_size should be compact, tall or full." unless size.in? %w[COMPACT TALL FULL]
22
22
  self.url = ENV["LIFF_#{size}"]
23
- raise "LIFF_#{size} should be in the env variables" if url.empty?
23
+ raise "LIFF_#{size} should be in the env variables" if url.blank?
24
24
  self.id = url[(url.rindex('/')+1)..-1]
25
25
  end
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module Kamiliff
2
- VERSION = '0.18.0'
2
+ VERSION = '0.23.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamiliff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - etrex kuo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-06 00:00:00.000000000 Z
11
+ date: 2020-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails