whatsapp_sdk 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +8 -4
- data/example.rb +7 -9
- data/lib/whatsapp_sdk/version.rb +1 -3
- data/whatsapp_sdk.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e174b898e076d20337b2566c9467a0fc6ab2e8aa5d3f4185dd8bcec6a754d25f
|
4
|
+
data.tar.gz: 2fbb40187adeb8006b345c6b37de12c575cd9f6d1625f5e1befff2caaa3c0568
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd4aa67163bb7ebcab95865b583d779d209453b383df131d46ac7baddf6002f37276c627a332f4ac3f792549a2f4d4d9bed27486e9500042b850c17e4ba03dcd
|
7
|
+
data.tar.gz: 1ed23faa24804aebf48733a24c8d42ada544f5895ff5323fc0cac172c0bf4becf51abf3e75eadb85f3d5ead98beb3c1cd0d18fc329e10fdc1ce0b4139a07c3c2
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -324,21 +324,25 @@ Visit [the example file](/example.rb) with examples to call the API in a single
|
|
324
324
|
- Ensure your Meta App uses an API version greater than or equal to `v.14`.
|
325
325
|
- Ensure that the Panel in the Facebook dashboard doesn't display any error.
|
326
326
|
|
327
|
+
Note: Sometimes the messages are delayed, see [Meta documentation](https://developers.facebook.com/docs/whatsapp/on-premises/guides/send-message-performance#delays).
|
328
|
+
|
327
329
|
## Development
|
328
330
|
|
329
331
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
|
330
332
|
|
331
333
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
332
334
|
|
333
|
-
## Contributing
|
334
|
-
|
335
|
-
Bug reports and pull requests are welcome on GitHub at [https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk) This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
336
|
-
|
337
335
|
### Run all the tests
|
338
336
|
- **Unit tests:** Run `rake test`
|
339
337
|
- **Sorbet Typecheck:** run `srb tc`
|
340
338
|
- **Linters:** `bundle exec rubocop`
|
341
339
|
|
340
|
+
## Contributing
|
341
|
+
|
342
|
+
Bug reports and pull requests are welcome on GitHub at [https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk) This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
343
|
+
|
344
|
+
If you want a feature to be implemented in the gem, please, open an issue and we will take a look as soon as we can.
|
345
|
+
|
342
346
|
## License
|
343
347
|
|
344
348
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/example.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
# 1) Copy this code into a file and save it `example.rb`
|
@@ -12,7 +11,7 @@ gemfile(true) do
|
|
12
11
|
|
13
12
|
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
14
13
|
|
15
|
-
gem "whatsapp_sdk"
|
14
|
+
gem "whatsapp_sdk"
|
16
15
|
gem "pry"
|
17
16
|
gem "pry-nav"
|
18
17
|
end
|
@@ -22,12 +21,12 @@ require "pry"
|
|
22
21
|
require "pry-nav"
|
23
22
|
|
24
23
|
################# UPDATE CONSTANTS #################
|
25
|
-
ACCESS_TOKEN = "EAAZAvvr0DZBs0BAHyg1bIPxEVV8dfI6woMaCxGNdjEEWYbZAkrMDuSqJcwXuIX10AmUW5TQLMEQCHM07dYzpGW5rTbZCZAoDt0aixPyZBB2nKFCTGhd3OnyZCZCzAxEdZBbZC4IY9uYkYbC9KCSLfOpAdgBU1dLGCTR2brwAvpWZAosgjXwgQZBLwrOSEpblsMVTGDkNaxAbi8zZBLijYRi6gsaSK" # replace this with a valid access_token # TODO replace
|
26
|
-
BUSINESS_ID = 102261539298487
|
27
|
-
SENDER_ID = 111591145018464
|
28
|
-
RECIPIENT_NUMBER = 13437772910
|
29
24
|
|
30
|
-
|
25
|
+
ACCESS_TOKEN = "<TODO replace>"
|
26
|
+
SENDER_ID = "<TODO replace>"
|
27
|
+
RECIPIENT_NUMBER = "<TODO replace>"
|
28
|
+
BUSINESS_ID = "<TODO replace>"
|
29
|
+
IMAGE_LINK = "<TODO replace>"
|
31
30
|
|
32
31
|
################# Initialize Client #################
|
33
32
|
WhatsappSdk.configure do |config|
|
@@ -47,7 +46,6 @@ end
|
|
47
46
|
medias_api = WhatsappSdk::Api::Medias.new
|
48
47
|
messages_api = WhatsappSdk::Api::Messages.new
|
49
48
|
phone_numbers_api = WhatsappSdk::Api::PhoneNumbers.new
|
50
|
-
binding.pry
|
51
49
|
|
52
50
|
############################## Phone Numbers API ##############################
|
53
51
|
registered_number = phone_numbers_api.registered_number(SENDER_ID)
|
@@ -90,7 +88,7 @@ print_message_sent(location_sent)
|
|
90
88
|
######### SEND AN IMAGE
|
91
89
|
# Send an image with a link
|
92
90
|
image_sent = messages_api.send_image(
|
93
|
-
sender_id: SENDER_ID, recipient_number: RECIPIENT_NUMBER, link: media.url, caption: "
|
91
|
+
sender_id: SENDER_ID, recipient_number: RECIPIENT_NUMBER, link: media.url, caption: "Ignacio Chiazzo Profile"
|
94
92
|
)
|
95
93
|
print_message_sent(image_sent)
|
96
94
|
|
data/lib/whatsapp_sdk/version.rb
CHANGED
data/whatsapp_sdk.gemspec
CHANGED
@@ -8,7 +8,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
8
8
|
|
9
9
|
Gem::Specification.new do |spec|
|
10
10
|
spec.name = "whatsapp_sdk"
|
11
|
-
spec.version = WhatsappSdk::
|
11
|
+
spec.version = WhatsappSdk::VERSION
|
12
12
|
spec.authors = ["ignacio-chiazzo"]
|
13
13
|
spec.email = ["ignaciochiazzo@gmail.com"]
|
14
14
|
spec.summary = "Use the Ruby Whatsapp SDK to comunicate with Whatsapp API using the Cloud API"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whatsapp_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ignacio-chiazzo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -243,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
243
243
|
- !ruby/object:Gem::Version
|
244
244
|
version: '0'
|
245
245
|
requirements: []
|
246
|
-
rubygems_version: 3.
|
246
|
+
rubygems_version: 3.3.3
|
247
247
|
signing_key:
|
248
248
|
specification_version: 4
|
249
249
|
summary: Use the Ruby Whatsapp SDK to comunicate with Whatsapp API using the Cloud
|