firebase_dynamic_link 1.0.5 → 1.1.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
  SHA256:
3
- metadata.gz: 85ef82823db14e8e061661f732e49baaedb5a4a9502870efbdee88b4a10ad818
4
- data.tar.gz: 91b28eccfece2fd776cb0fe7e6ed983c849ac38c9d7c52c6e8a656b2b1ec6954
3
+ metadata.gz: 8674b44e3f8742867c46b5b61c5337e8e85f57644a715996336ee27ff3a53369
4
+ data.tar.gz: 46c54ae920029f11f03f32329bfe49ad884345b4aab986b206a50505509b6b54
5
5
  SHA512:
6
- metadata.gz: dd303538bd66b8ed2fb8fe92fceecdbb6ab2c0c72f9949d13b4e797ed31a0d6dd11e14727a72bfc835ba91064104e9757016b765f6e991f2b179906e7f59e9cb
7
- data.tar.gz: '04785a853c9ab191d9533ce0f1c0a7c462c11515944fe64d7cdd373c962ca6b046e986eec967c29374aaa454120b67e96f609509106134b5fe8dc3e1fc1afb52'
6
+ metadata.gz: 6e91c5a93e650ba597ce2ab03d76db9d48ef1fae276ca4fd0447aafcd423d3fc3366d2fc12dfbb62204d037a2eadbcf9d92b59d78b8be0e7b924b8fd1fe70fad
7
+ data.tar.gz: 8aa69a65b06a2fa9019f2e380eadb3373df55672d10a53ebf096a00dba3601aff6b0eee9ae7a5900b92bf786d4f13312ef78b3431ccf2bea418c42b060a04c6f
@@ -15,7 +15,7 @@ jobs:
15
15
  - name: Set up Ruby
16
16
  uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
17
17
  with:
18
- ruby-version: 2.7
18
+ ruby-version: 3.0
19
19
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
20
20
  - name: Install cc-test-reporter and prebuild notification
21
21
  run: |
data/README.md CHANGED
@@ -11,6 +11,7 @@ Firebase Dynamic Link is a tool to create a deep link of your webpage. It can be
11
11
  - [Configure the HTTP client](#configure-the-http-client)
12
12
  - [Shorten a link](#shorten-a-link)
13
13
  - [Shorten parameters](#shorten-parameters)
14
+ - [More than one firebase project](#more-than-one-firebase-project)
14
15
  - [CHANGELOG](#changelog)
15
16
  - [V1.0.5](#v105)
16
17
  - [V1.0.3](#v103)
@@ -56,8 +57,8 @@ Or install it yourself as:
56
57
  # Faraday.default_adapter is the default adapter
57
58
  config.adapter = :httpclient # optional, default is net_http
58
59
 
59
- # required
60
- config.api_key = 'API_KEY' # required
60
+ # required, taken as default firebase api key when api_key parameter isn't passed to FirebaseDynamicLink::Client constructor
61
+ config.api_key = 'API_KEY'
61
62
 
62
63
  # default 'UNGUESSABLE'
63
64
  config.suffix_option = 'SHORT' or 'UNGUESSABLE'
@@ -159,6 +160,16 @@ Or if the request reached daily quota, client will throw `FirebaseDynamicLink::Q
159
160
 
160
161
  Otherwise it will throw `FirebaseDynamicLink::ConnectionError` error, with message = http error message
161
162
 
163
+ ### More than one firebase project
164
+
165
+ If you have more than one firebase project you can pass your `api_key` to `FirebaseDynamicLink::Client` constructor additionally to `FirebaseDynamicLink` configuration.
166
+ Api key provided by constructor has precendece over this provided by `FirebaseDynamicLink` configuration.
167
+
168
+ ```
169
+ client = FirebaseDynamicLink::Client.new(api_key: 'API_KEY')
170
+ ```
171
+
172
+
162
173
  ## CHANGELOG
163
174
 
164
175
  ### V1.0.5
@@ -10,9 +10,10 @@ module FirebaseDynamicLink
10
10
  class Client
11
11
  extend Forwardable
12
12
 
13
- def initialize
13
+ def initialize(api_key: config.api_key)
14
14
  @link_renderer = FirebaseDynamicLink::LinkRenderer.new
15
- @connection = FirebaseDynamicLink::Connection.new(end_point)
15
+ short_links_url = end_point(api_key)
16
+ @connection = FirebaseDynamicLink::Connection.new(short_links_url)
16
17
  end
17
18
 
18
19
  # @param link [String] required
@@ -156,8 +157,8 @@ module FirebaseDynamicLink
156
157
  "#{dynamic_link_domain}?link=#{link}"
157
158
  end
158
159
 
159
- def end_point
160
- "https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=#{config.api_key}"
160
+ def end_point(api_key)
161
+ "https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=#{api_key}"
161
162
  end
162
163
  end
163
164
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FirebaseDynamicLink
4
- VERSION = '1.0.5'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firebase_dynamic_link
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - M Saiqul Haq
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-05 00:00:00.000000000 Z
11
+ date: 2022-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: case_transform2