From 6ae3d20d60ee5da4a21cd6adb0927c16bed377b5 Mon Sep 17 00:00:00 2001 From: OneSignal Date: Tue, 25 Aug 2026 00:34:39 +0000 Subject: [PATCH] feat: add v5.13.0 package updates --- README.md | 6 ++-- docs/StartLiveActivityRequest.md | 2 +- docs/UpdateLiveActivityRequest.md | 10 ++++-- lib/onesignal/api_client.rb | 2 +- .../models/start_live_activity_request.rb | 2 +- .../models/update_live_activity_request.rb | 33 +++++++++++++++---- lib/onesignal/version.rb | 2 +- .../update_live_activity_request_spec.rb | 12 +++++++ 8 files changed, 53 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 393d4a3..05abb5f 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/docs/StartLiveActivityRequest.md b/docs/StartLiveActivityRequest.md index 5a1a3ec..6934710 100644 --- a/docs/StartLiveActivityRequest.md +++ b/docs/StartLiveActivityRequest.md @@ -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] | diff --git a/docs/UpdateLiveActivityRequest.md b/docs/UpdateLiveActivityRequest.md index db07c6a..3f40372 100644 --- a/docs/UpdateLiveActivityRequest.md +++ b/docs/UpdateLiveActivityRequest.md @@ -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 @@ -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 ) ``` diff --git a/lib/onesignal/api_client.rb b/lib/onesignal/api_client.rb index 7c4d222..ab02c87 100644 --- a/lib/onesignal/api_client.rb +++ b/lib/onesignal/api_client.rb @@ -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] || {} diff --git a/lib/onesignal/models/start_live_activity_request.rb b/lib/onesignal/models/start_live_activity_request.rb index c9f7272..b3359a2 100644 --- a/lib/onesignal/models/start_live_activity_request.rb +++ b/lib/onesignal/models/start_live_activity_request.rb @@ -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 diff --git a/lib/onesignal/models/update_live_activity_request.rb b/lib/onesignal/models/update_live_activity_request.rb index dbb5cbb..cb81390 100644 --- a/lib/onesignal/models/update_live_activity_request.rb +++ b/lib/onesignal/models/update_live_activity_request.rb @@ -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 @@ -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 @@ -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 @@ -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 @@ -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? @@ -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 @@ -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 diff --git a/lib/onesignal/version.rb b/lib/onesignal/version.rb index a9db917..dc592ac 100644 --- a/lib/onesignal/version.rb +++ b/lib/onesignal/version.rb @@ -10,5 +10,5 @@ =end module OneSignal - VERSION = '5.12.0' + VERSION = '5.13.0' end diff --git a/spec/models/update_live_activity_request_spec.rb b/spec/models/update_live_activity_request_spec.rb index f082c4f..64d1b82 100644 --- a/spec/models/update_live_activity_request_spec.rb +++ b/spec/models/update_live_activity_request_spec.rb @@ -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 @@ -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