whatsapp_sdk 0.9.1 → 0.9.2
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/README.md +13 -9
- data/lib/whatsapp_sdk/resource/media_types.rb +2 -1
- data/lib/whatsapp_sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acff9c2aa69b398017bced8fbbf81d3d82eb4088f91b2dda24e3638da6c2240a
|
4
|
+
data.tar.gz: '0269bed60b15e5c8f1f1e4057f7683f5fe2ea8d931549390037f040530f125ad'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70225a9c4b03a4c80e5c300d04eb61b8db45e0933a3aaef35fee71562c021adf80e33e3917b5439946b1d5690820ed4348e108f95692a8e614b221a7010761a1
|
7
|
+
data.tar.gz: b0ce380977fc51bf9f79f5fdd40c75ae533239ee78e40a15081b9f9bc19c827b94399373d979b82ad940fd9ac0a3d1ad4b3493ce27ae6f021e4df04d7c834d66
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# v 0.9.2
|
4
|
+
- Add Support to image/webp sticker media. @renatovico [#94](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/issues/94)
|
5
|
+
|
3
6
|
# v 0.9.1
|
4
7
|
- Invalidate unsupported and invalid media types @ignacio-chiazzo [#89](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/pull/89)
|
5
8
|
|
data/README.md
CHANGED
@@ -31,25 +31,26 @@ Or install it yourself as:
|
|
31
31
|
|
32
32
|
## Quick Start
|
33
33
|
|
34
|
-
There are three primary resources, `Messages`, `Media` and `PhoneNumbers`. `Messages` allows users to send any
|
34
|
+
There are three primary resources, `Messages`, `Media` and `PhoneNumbers`. `Messages` allows users to send any message (text, audio, location, video, image, etc.). `Media` allows users to manage media, and `Phone Numbers` enable clients to query the associated phone numbers.
|
35
35
|
|
36
|
-
To use `Messages`, `Media` or `PhoneNumbers`, you need to initialize the `Client` that contains auth information. There are two ways to do it
|
36
|
+
To use `Messages`, `Media` or `PhoneNumbers`, you need to initialize the `Client` that contains auth information. There are two ways to do it.
|
37
37
|
|
38
|
-
1)
|
38
|
+
1) Use an initializer
|
39
39
|
|
40
40
|
```ruby
|
41
|
+
# config/initializers/whatsapp_sdk.rb
|
41
42
|
WhatsappSdk.configure do |config|
|
42
43
|
config.access_token = ACCESS_TOKEN
|
43
44
|
end
|
44
45
|
```
|
45
|
-
OR 2)
|
46
|
+
OR 2) Create a `Client` instance and pass it to the `Messages`, `Medias` or `PhoneNumbers` instance like this:
|
46
47
|
|
47
48
|
```ruby
|
48
49
|
client = WhatsappSdk::Api::Client.new("<ACCESS TOKEN>") # replace this with a valid access token
|
49
50
|
messages_api = WhatsappSdk::Api::Messages.new(client)
|
50
51
|
```
|
51
52
|
|
52
|
-
Each API operation returns a `WhatsappSdk::Api::Response` that contains `data` and `error` and a couple of helpful functions such as `ok?` and `error?`. There are three types of
|
53
|
+
Each API operation returns a `WhatsappSdk::Api::Response` that contains `data` and `error` and a couple of helpful functions such as `ok?` and `error?`. There are three types of responses `WhatsappSdk::Api::MessageDataResponse`, `WhatsappSdk::Api::PhoneNumberDataResponse` and `WhatsappSdk::Api::PhoneNumbersDataResponse`. Each of them contains different attributes.
|
53
54
|
|
54
55
|
## Set up a Meta app
|
55
56
|
|
@@ -480,17 +481,17 @@ Visit [the example file](/example.rb) with examples to call the API in a single
|
|
480
481
|
|
481
482
|
## Troubleshooting
|
482
483
|
|
483
|
-
- If the API response is `success`, but the message is not delivered, ensure the device you're sending the message to is using a supported Whatsapp version. [Check documentation](https://developers.facebook.com/docs/whatsapp/cloud-api/support/troubleshooting#message-not-delivered). Try also replying a message to the number
|
484
|
+
- If the API response is `success`, but the message is not delivered, ensure the device you're sending the message to is using a supported Whatsapp version. [Check documentation](https://developers.facebook.com/docs/whatsapp/cloud-api/support/troubleshooting#message-not-delivered). Try also replying a message to the number you are registered on your Whatsapp.
|
484
485
|
- Ensure your Meta App uses an API version greater than or equal to `v.14`.
|
485
|
-
- Ensure that the Panel in the Facebook dashboard doesn't display any
|
486
|
+
- Ensure that the Panel in the Facebook dashboard doesn't display any errors.
|
486
487
|
|
487
|
-
Note: Sometimes the messages are delayed
|
488
|
+
Note: Sometimes the messages are delayed; see [Meta documentation](https://developers.facebook.com/docs/whatsapp/on-premises/guides/send-message-performance#delays).
|
488
489
|
|
489
490
|
## Development
|
490
491
|
|
491
492
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
|
492
493
|
|
493
|
-
|
494
|
+
Run ' bundle exec rake install ' to install this gem onto your local machine. 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).
|
494
495
|
|
495
496
|
### Run all the tests
|
496
497
|
- **Unit tests:** Run `rake test`
|
@@ -506,6 +507,9 @@ Bug reports and pull requests are welcome on GitHub at [https://github.com/ignac
|
|
506
507
|
|
507
508
|
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.
|
508
509
|
|
510
|
+
|
511
|
+
Do you want to contribute and are unsure where to start? Ping me on Twitter, and I will help you!
|
512
|
+
|
509
513
|
## License
|
510
514
|
|
511
515
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -22,9 +22,10 @@ module WhatsappSdk
|
|
22
22
|
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
23
23
|
].freeze
|
24
24
|
IMAGE_TYPES = %w[image/jpeg image/png].freeze
|
25
|
+
STICKER_TYPES = %w[image/webp].freeze
|
25
26
|
VIDEO_TYPES = %w[video/mp4 video/3gp].freeze
|
26
27
|
|
27
|
-
SUPPORTED_MEDIA_TYPES = [AUDIO_TYPES + DOCUMENT_TYPES + IMAGE_TYPES + VIDEO_TYPES].flatten.freeze
|
28
|
+
SUPPORTED_MEDIA_TYPES = [AUDIO_TYPES + DOCUMENT_TYPES + IMAGE_TYPES + STICKER_TYPES + VIDEO_TYPES].flatten.freeze
|
28
29
|
end
|
29
30
|
end
|
30
31
|
end
|
data/lib/whatsapp_sdk/version.rb
CHANGED
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.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ignacio-chiazzo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|