diff --git a/README.md b/README.md index f4d62e1..84f5f06 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ 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 -- SDK version: 5.13.0 +- API version: 5.13.0 +- SDK version: 5.14.0 ## Installation diff --git a/docs/StartLiveActivityRequest.md b/docs/StartLiveActivityRequest.md index 7d3c5f9..1d01959 100644 --- a/docs/StartLiveActivityRequest.md +++ b/docs/StartLiveActivityRequest.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **Headings** | [**LanguageStringMap**](LanguageStringMap.md) | | **StaleDate** | **int** | 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** | **int** | 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] -**IosRelevanceScore** | **decimal?** | iOS 15+. A score to indicate how a notification should be displayed when grouped. Use a float between 0-1. | [optional] +**IosRelevanceScore** | **decimal?** | 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] **IdempotencyKey** | **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] **IncludeAliases** | **Dictionary<string, List<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] **IncludeSubscriptionIds** | **List<string>** | Specific subscription ids to target. Not compatible with other targeting parameters. | [optional] diff --git a/docs/UpdateLiveActivityRequest.md b/docs/UpdateLiveActivityRequest.md index 0eb215b..3289638 100644 --- a/docs/UpdateLiveActivityRequest.md +++ b/docs/UpdateLiveActivityRequest.md @@ -9,10 +9,12 @@ Name | Type | Description | Notes **EventUpdates** | **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] +**IosSound** | **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] **StaleDate** | **int** | 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] **DismissalDate** | **int** | Accepts Unix timestamp in seconds; only allowed if event is \"end\" | [optional] -**Priority** | **int** | 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** | **int** | 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] +**IosRelevanceScore** | **decimal?** | 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] [[Back to API list]](https://github.com/OneSignal/onesignal-dotnet-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-dotnet-api) diff --git a/src/OneSignalApi/Client/ApiClient.cs b/src/OneSignalApi/Client/ApiClient.cs index a12ab28..49e0d85 100644 --- a/src/OneSignalApi/Client/ApiClient.cs +++ b/src/OneSignalApi/Client/ApiClient.cs @@ -156,7 +156,7 @@ private RestRequest NewRequest( } // Always add the One Signal telemetry to the request. - request.AddHeader("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-dotnet, version=5.13.0"); + request.AddHeader("OS-Usage-Data", "kind=sdk, sdk-name=onesignal-dotnet, version=5.14.0"); if (configuration.DefaultHeaders != null) { diff --git a/src/OneSignalApi/Client/Configuration.cs b/src/OneSignalApi/Client/Configuration.cs index 5086c44..e1f4e44 100644 --- a/src/OneSignalApi/Client/Configuration.cs +++ b/src/OneSignalApi/Client/Configuration.cs @@ -31,7 +31,7 @@ public class Configuration : IReadableConfiguration /// Version of the package. /// /// Version of the package. - public const string Version = "5.13.0"; + public const string Version = "5.14.0"; /// /// Identifier for ISO 8601 DateTime Format @@ -108,7 +108,7 @@ public class Configuration : IReadableConfiguration public Configuration() { Proxy = null; - UserAgent = "OpenAPI-Generator-5.13.0-csharp"; + UserAgent = "OpenAPI-Generator-5.14.0-csharp"; BasePath = "https://api.onesignal.com"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); @@ -515,8 +515,8 @@ public static string ToDebugReport() string report = "C# SDK (OneSignalApi) Debug Report:\n"; report += " OS: " + System.Environment.OSVersion + "\n"; report += " .NET Framework Version: " + System.Environment.Version + "\n"; - report += " Version of the API: 5.12.0\n"; - report += " SDK Package Version: 5.13.0\n"; + report += " Version of the API: 5.13.0\n"; + report += " SDK Package Version: 5.14.0\n"; return report; } diff --git a/src/OneSignalApi/Model/StartLiveActivityRequest.cs b/src/OneSignalApi/Model/StartLiveActivityRequest.cs index 65f416e..0588242 100644 --- a/src/OneSignalApi/Model/StartLiveActivityRequest.cs +++ b/src/OneSignalApi/Model/StartLiveActivityRequest.cs @@ -68,7 +68,7 @@ protected StartLiveActivityRequest() { } /// headings (required). /// 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.. /// 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.. - /// 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.. /// 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 . /// 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.. /// Specific subscription ids to target. Not compatible with other targeting parameters.. @@ -180,9 +180,9 @@ protected StartLiveActivityRequest() { } public int Priority { get; set; } /// - /// 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. /// - /// 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. [DataMember(Name = "ios_relevance_score", EmitDefaultValue = true)] public decimal? IosRelevanceScore { get; set; } diff --git a/src/OneSignalApi/Model/UpdateLiveActivityRequest.cs b/src/OneSignalApi/Model/UpdateLiveActivityRequest.cs index 99cbb6b..be9e7de 100644 --- a/src/OneSignalApi/Model/UpdateLiveActivityRequest.cs +++ b/src/OneSignalApi/Model/UpdateLiveActivityRequest.cs @@ -70,11 +70,13 @@ protected UpdateLiveActivityRequest() { } /// This must match the ContentState interface you have defined within your Live Activity in your app. (required). /// contents. /// 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`.. + /// 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. . /// 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.. /// Accepts Unix timestamp in seconds; only allowed if event is \"end\". - /// 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.. - public UpdateLiveActivityRequest(string name = default(string), EventEnum _event = default(EventEnum), Object eventUpdates = default(Object), LanguageStringMap contents = default(LanguageStringMap), LanguageStringMap headings = default(LanguageStringMap), string sound = default(string), int staleDate = default(int), int dismissalDate = default(int), int priority = default(int)) + /// 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.. + /// 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.. + public UpdateLiveActivityRequest(string name = default(string), EventEnum _event = default(EventEnum), Object eventUpdates = default(Object), LanguageStringMap contents = default(LanguageStringMap), LanguageStringMap headings = default(LanguageStringMap), string sound = default(string), string iosSound = default(string), int staleDate = default(int), int dismissalDate = default(int), int priority = default(int), decimal? iosRelevanceScore = default(decimal?)) { // to ensure "name" is required (not null) if (name == null) @@ -92,9 +94,11 @@ protected UpdateLiveActivityRequest() { } this.Contents = contents; this.Headings = headings; this.Sound = sound; + this.IosSound = iosSound; this.StaleDate = staleDate; this.DismissalDate = dismissalDate; this.Priority = priority; + this.IosRelevanceScore = iosRelevanceScore; } /// @@ -124,12 +128,20 @@ protected UpdateLiveActivityRequest() { } public LanguageStringMap Headings { get; set; } /// - /// 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`. /// - /// 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`. [DataMember(Name = "sound", EmitDefaultValue = false)] + [Obsolete] public string Sound { get; set; } + /// + /// 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. + /// + /// 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. + [DataMember(Name = "ios_sound", EmitDefaultValue = false)] + public string IosSound { get; set; } + /// /// 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. /// @@ -145,12 +157,19 @@ protected UpdateLiveActivityRequest() { } public int DismissalDate { get; set; } /// - /// 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. /// - /// 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. [DataMember(Name = "priority", EmitDefaultValue = false)] public int Priority { get; set; } + /// + /// 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. + /// + /// 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. + [DataMember(Name = "ios_relevance_score", EmitDefaultValue = true)] + public decimal? IosRelevanceScore { get; set; } + /// /// Returns the string presentation of the object /// @@ -165,9 +184,11 @@ public override string ToString() sb.Append(" Contents: ").Append(Contents).Append("\n"); sb.Append(" Headings: ").Append(Headings).Append("\n"); sb.Append(" Sound: ").Append(Sound).Append("\n"); + sb.Append(" IosSound: ").Append(IosSound).Append("\n"); sb.Append(" StaleDate: ").Append(StaleDate).Append("\n"); sb.Append(" DismissalDate: ").Append(DismissalDate).Append("\n"); sb.Append(" Priority: ").Append(Priority).Append("\n"); + sb.Append(" IosRelevanceScore: ").Append(IosRelevanceScore).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -232,6 +253,11 @@ public bool Equals(UpdateLiveActivityRequest input) (this.Sound != null && this.Sound.Equals(input.Sound)) ) && + ( + this.IosSound == input.IosSound || + (this.IosSound != null && + this.IosSound.Equals(input.IosSound)) + ) && ( this.StaleDate == input.StaleDate || this.StaleDate.Equals(input.StaleDate) @@ -243,6 +269,11 @@ public bool Equals(UpdateLiveActivityRequest input) ( this.Priority == input.Priority || this.Priority.Equals(input.Priority) + ) && + ( + this.IosRelevanceScore == input.IosRelevanceScore || + (this.IosRelevanceScore != null && + this.IosRelevanceScore.Equals(input.IosRelevanceScore)) ); } @@ -276,9 +307,17 @@ public override int GetHashCode() { hashCode = (hashCode * 59) + this.Sound.GetHashCode(); } + if (this.IosSound != null) + { + hashCode = (hashCode * 59) + this.IosSound.GetHashCode(); + } hashCode = (hashCode * 59) + this.StaleDate.GetHashCode(); hashCode = (hashCode * 59) + this.DismissalDate.GetHashCode(); hashCode = (hashCode * 59) + this.Priority.GetHashCode(); + if (this.IosRelevanceScore != null) + { + hashCode = (hashCode * 59) + this.IosRelevanceScore.GetHashCode(); + } return hashCode; } } diff --git a/src/OneSignalApi/OneSignalApi.csproj b/src/OneSignalApi/OneSignalApi.csproj index b742ae3..724c209 100644 --- a/src/OneSignalApi/OneSignalApi.csproj +++ b/src/OneSignalApi/OneSignalApi.csproj @@ -12,7 +12,7 @@ OneSignal is a free push notification service for mobile apps. Integrate OneSignal with your backend events, data, and more. Copyrite 2022 OneSignal OneSignalApi - 5.13.0 + 5.14.0 bin\$(Configuration)\$(TargetFramework)\OneSignalApi.xml https://github.com/OneSignal/onesignal-dotnet-api.git git