Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[storekit] Add nullability to (generated and manual) bindings #14896

Merged
merged 7 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 2 additions & 0 deletions src/StoreKit/NativeMethods.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using System;
using System.Runtime.InteropServices;
using ObjCRuntime;
Expand Down
2 changes: 2 additions & 0 deletions src/StoreKit/SKAdNetworkCompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// Copyright 2018 Microsoft Corporation.
//

#nullable enable

using System;
using System.ComponentModel;

Expand Down
6 changes: 5 additions & 1 deletion src/StoreKit/SKCloudServiceSetupOptions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

#if __IOS__

using System;
Expand All @@ -10,10 +12,12 @@ partial class SKCloudServiceSetupOptions {

public virtual SKCloudServiceSetupAction? Action {
get {
if (_Action is null)
return null;
return (SKCloudServiceSetupAction?) (SKCloudServiceSetupActionExtensions.GetValue (_Action));
}
set {
_Action = value != null ? SKCloudServiceSetupActionExtensions.GetConstant (value.Value) : null;
_Action = value is not null ? SKCloudServiceSetupActionExtensions.GetConstant (value.Value) : null;
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/StoreKit/SKOverlayAppClipConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

#if __IOS__
using System;

Expand All @@ -10,7 +12,7 @@ namespace StoreKit {
#if !COREBUILD
public partial class SKOverlayAppClipConfiguration
{
public NSObject this[string i] {
public NSObject? this[string i] {
get => GetAdditionalValue (i);
set => SetAdditionalValue (value, i);
}
Expand Down
4 changes: 3 additions & 1 deletion src/StoreKit/SKOverlayAppConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

#if __IOS__
using System;

Expand All @@ -10,7 +12,7 @@ namespace StoreKit {
#if !COREBUILD
public partial class SKOverlayAppConfiguration
{
public NSObject this[string i] {
public NSObject? this[string i] {
get => GetAdditionalValue (i);
set => SetAdditionalValue (value, i);
}
Expand Down
2 changes: 2 additions & 0 deletions src/StoreKit/SKPayment.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright 2015 Xamarin Inc.

#nullable enable

using System;

using StoreKit;
Expand Down
2 changes: 2 additions & 0 deletions src/StoreKit/SKPaymentTransactionObserver.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright 2015-2016 Xamarin Inc.

#nullable enable

#if !XAMCORE_3_0

using System;
Expand Down
3 changes: 3 additions & 0 deletions src/StoreKit/SKReceiptProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
//
// Copyright 2013 Xamarin Inc.
//

#nullable enable

using ObjCRuntime;
using Foundation;
using CoreFoundation;
Expand Down
6 changes: 4 additions & 2 deletions src/StoreKit/StoreProductParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

#nullable enable

#if !WATCH

using System;
Expand Down Expand Up @@ -54,7 +56,7 @@ public int? ITunesItemIdentifier {
}
}

public string AffiliateToken {
public string? AffiliateToken {
get {
return GetStringValue (SKStoreProductParameterKey.AffiliateToken);
}
Expand All @@ -63,7 +65,7 @@ public string AffiliateToken {
}
}

public string CampaignToken {
public string? CampaignToken {
get {
return GetStringValue (SKStoreProductParameterKey.CampaignToken);
}
Expand Down