Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ OneSignal - the Ruby gem for OneSignal

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

- API version: 5.12.0
- Package version: 5.12.0
- API version: 5.13.0
- Package version: 5.13.0

## Installation

Add to your `Gemfile`:

```ruby
gem 'onesignal', '~> 5.12.0'
gem 'onesignal', '~> 5.13.0'
```

Then run `bundle install`.
Expand Down
2 changes: 1 addition & 1 deletion docs/StartLiveActivityRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
| **headings** | [**LanguageStringMap**](LanguageStringMap.md) | | |
| **stale_date** | **Integer** | Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale. | [optional] |
| **priority** | **Integer** | Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. | [optional] |
| **ios_relevance_score** | **Float** | iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1. | [optional] |
| **ios_relevance_score** | **Float** | A value between 0 and 1. When more than one Live Activity is active for your app, the one with the highest relevance score shows in the Dynamic Island. If the scores are equal, the system shows the Live Activity that started first. The score also sets the order of Live Activities on the Lock Screen. Only available on iOS 16.2 and later. | [optional] |
| **idempotency_key** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] |
| **include_aliases** | **Hash<String, Array<String>>** | Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Keys must match API spellings exactly (for example the label for External ID is the string `external_id`; arbitrary keys such as camelCase variants are not aliases and may yield no recipients). Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms. | [optional] |
| **include_subscription_ids** | **Array<String>** | Specific subscription ids to target. Not compatible with other targeting parameters. | [optional] |
Expand Down
10 changes: 7 additions & 3 deletions docs/UpdateLiveActivityRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
| **event_updates** | **Object** | This must match the ContentState interface you have defined within your Live Activity in your app. | |
| **contents** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] |
| **headings** | [**LanguageStringMap**](LanguageStringMap.md) | | [optional] |
| **sound** | **String** | Sound file that is included in your app to play instead of the default device notification sound. Omit to disable vibration and sound for the notification. | [optional] |
| **sound** | **String** | Deprecated. The API ignores this field. Use `ios_sound`. | [optional] |
| **ios_sound** | **String** | Sound file that is included in your app to play instead of the default device notification sound. Omit to disable vibration and sound for the notification. Requires `headings` on the same request: ActivityKit ignores an update whose alert has no title, which silently drops the sound. Supersedes the deprecated `sound` field. | [optional] |
| **stale_date** | **Integer** | Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale. | [optional] |
| **dismissal_date** | **Integer** | Accepts Unix timestamp in seconds; only allowed if event is \"end\" | [optional] |
| **priority** | **Integer** | Delivery priority through the the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. Some providers (APNs) allow for a limited budget of high priority notifications per hour, and if that budget is exceeded, the provider may throttle notification delivery. | [optional] |
| **priority** | **Integer** | Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. Some providers (APNs) allow for a limited budget of high priority notifications per hour, and if that budget is exceeded, the provider may throttle notification delivery. | [optional] |
| **ios_relevance_score** | **Float** | A value between 0 and 1. When more than one Live Activity is active for your app, the one with the highest relevance score shows in the Dynamic Island. If the scores are equal, the system shows the Live Activity that started first. The score also sets the order of Live Activities on the Lock Screen. Only available on iOS 16.2 and later. | [optional] |

## Example

Expand All @@ -26,9 +28,11 @@ instance = OneSignal::UpdateLiveActivityRequest.new(
contents: nil,
headings: nil,
sound: nil,
ios_sound: nil,
stale_date: nil,
dismissal_date: nil,
priority: nil
priority: nil,
ios_relevance_score: nil
)
```

2 changes: 1 addition & 1 deletion lib/onesignal/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def build_request(http_method, path, opts = {})
url = build_request_url(path, opts)
http_method = http_method.to_sym.downcase

opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=5.12.0'
opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=5.13.0'
header_params = @default_headers.merge(opts[:header_params] || {})
query_params = opts[:query_params] || {}
form_params = opts[:form_params] || {}
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/start_live_activity_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class StartLiveActivityRequest
# Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10.
attr_accessor :priority

# iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1.
# A value between 0 and 1. When more than one Live Activity is active for your app, the one with the highest relevance score shows in the Dynamic Island. If the scores are equal, the system shows the Live Activity that started first. The score also sets the order of Live Activities on the Lock Screen. Only available on iOS 16.2 and later.
attr_accessor :ios_relevance_score

# Correlation and idempotency key. A request received with this parameter will first look for another notification with the same idempotency key. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same idempotency key will be sent again. See Idempotent Notification Requests for more details writeOnly: true
Expand Down
33 changes: 27 additions & 6 deletions lib/onesignal/models/update_live_activity_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,24 @@ class UpdateLiveActivityRequest

attr_accessor :headings

# Sound file that is included in your app to play instead of the default device notification sound. Omit to disable vibration and sound for the notification.
# Deprecated. The API ignores this field. Use `ios_sound`.
attr_accessor :sound

# Sound file that is included in your app to play instead of the default device notification sound. Omit to disable vibration and sound for the notification. Requires `headings` on the same request: ActivityKit ignores an update whose alert has no title, which silently drops the sound. Supersedes the deprecated `sound` field.
attr_accessor :ios_sound

# Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale.
attr_accessor :stale_date

# Accepts Unix timestamp in seconds; only allowed if event is \"end\"
attr_accessor :dismissal_date

# Delivery priority through the the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. Some providers (APNs) allow for a limited budget of high priority notifications per hour, and if that budget is exceeded, the provider may throttle notification delivery.
# Delivery priority through the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. Some providers (APNs) allow for a limited budget of high priority notifications per hour, and if that budget is exceeded, the provider may throttle notification delivery.
attr_accessor :priority

# A value between 0 and 1. When more than one Live Activity is active for your app, the one with the highest relevance score shows in the Dynamic Island. If the scores are equal, the system shows the Live Activity that started first. The score also sets the order of Live Activities on the Lock Screen. Only available on iOS 16.2 and later.
attr_accessor :ios_relevance_score

class EnumAttributeValidator
attr_reader :datatype
attr_reader :allowable_values
Expand Down Expand Up @@ -69,9 +75,11 @@ def self.attribute_map
:'contents' => :'contents',
:'headings' => :'headings',
:'sound' => :'sound',
:'ios_sound' => :'ios_sound',
:'stale_date' => :'stale_date',
:'dismissal_date' => :'dismissal_date',
:'priority' => :'priority'
:'priority' => :'priority',
:'ios_relevance_score' => :'ios_relevance_score'
}
end

Expand All @@ -89,15 +97,18 @@ def self.openapi_types
:'contents' => :'LanguageStringMap',
:'headings' => :'LanguageStringMap',
:'sound' => :'String',
:'ios_sound' => :'String',
:'stale_date' => :'Integer',
:'dismissal_date' => :'Integer',
:'priority' => :'Integer'
:'priority' => :'Integer',
:'ios_relevance_score' => :'Float'
}
end

# List of attributes with nullable: true
def self.openapi_nullable
Set.new([
:'ios_relevance_score'
])
end

Expand Down Expand Up @@ -140,6 +151,10 @@ def initialize(attributes = {})
self.sound = attributes[:'sound']
end

if attributes.key?(:'ios_sound')
self.ios_sound = attributes[:'ios_sound']
end

if attributes.key?(:'stale_date')
self.stale_date = attributes[:'stale_date']
end
Expand All @@ -151,6 +166,10 @@ def initialize(attributes = {})
if attributes.key?(:'priority')
self.priority = attributes[:'priority']
end

if attributes.key?(:'ios_relevance_score')
self.ios_relevance_score = attributes[:'ios_relevance_score']
end
end

# Show invalid properties with the reasons. Usually used together with valid?
Expand Down Expand Up @@ -204,9 +223,11 @@ def ==(o)
contents == o.contents &&
headings == o.headings &&
sound == o.sound &&
ios_sound == o.ios_sound &&
stale_date == o.stale_date &&
dismissal_date == o.dismissal_date &&
priority == o.priority
priority == o.priority &&
ios_relevance_score == o.ios_relevance_score
end

# @see the `==` method
Expand All @@ -218,7 +239,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[name, event, event_updates, contents, headings, sound, stale_date, dismissal_date, priority].hash
[name, event, event_updates, contents, headings, sound, ios_sound, stale_date, dismissal_date, priority, ios_relevance_score].hash
end

# Builds the object from hash
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
=end

module OneSignal
VERSION = '5.12.0'
VERSION = '5.13.0'
end
12 changes: 12 additions & 0 deletions spec/models/update_live_activity_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
end
end

describe 'test attribute "ios_sound"' do
it 'should work' do
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end

describe 'test attribute "stale_date"' do
it 'should work' do
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
Expand All @@ -82,4 +88,10 @@
end
end

describe 'test attribute "ios_relevance_score"' do
it 'should work' do
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
end
end

end