From 64d4831802639d56b2eb6411af4237f18f9e0902 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 5 Apr 2019 18:46:40 +0200 Subject: [PATCH] [Intents] Update according to breaking changes from Apple. (#5850) * [Intents] Update according to breaking changes from Apple. Reference: https://trello.com/c/dtVv2a6R/131-43425168-inworkoutintentresponsecode-enum-values-changed Reference: rdar://43425168 Working around this breaking change becomes quite complicated, so I just exposed it instead. Customers can still work around it if needed by casting the expected numeric value to the enum type. * Add some advice. --- src/intents.cs | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/intents.cs b/src/intents.cs index e710ae2915..9513211187 100644 --- a/src/intents.cs +++ b/src/intents.cs @@ -76,10 +76,12 @@ namespace Intents { Failure, FailureRequiringAppLaunch, FailureNoMatchingWorkout, - [NoWatch, iOS (11,0)] - Success, + [Advice ("The numerical value for this constant was different in iOS 11 and earlier iOS versions (it was 7, which is now defined as 'Success').")] [NoWatch, iOS (11,0)] HandleInApp, + [Advice ("The numerical value for this constant was different in iOS 11 and earlier iOS versions (it was 6, which is now defined as 'HandleInApp').")] + [NoWatch, iOS (11,0)] + Success, } [iOS (10, 0)] @@ -158,10 +160,12 @@ namespace Intents { Failure, FailureRequiringAppLaunch, FailureNoMatchingWorkout, - [NoWatch, iOS (11,0)] - Success, + [Advice ("The numerical value for this constant was different in iOS 11 and earlier iOS versions (it was 7, which is now defined as 'Success').")] [NoWatch, iOS (11,0)] HandleInApp, + [Advice ("The numerical value for this constant was different in iOS 11 and earlier iOS versions (it was 6, which is now defined as 'HandleInApp').")] + [NoWatch, iOS (11,0)] + Success, } [iOS (10, 0)] @@ -348,10 +352,12 @@ namespace Intents { Failure, FailureRequiringAppLaunch, FailureNoMatchingWorkout, - [NoWatch, iOS (11,0)] - Success, + [Advice ("The numerical value for this constant was different in iOS 11 and earlier iOS versions (it was 7, which is now defined as 'Success').")] [NoWatch, iOS (11,0)] HandleInApp, + [Advice ("The numerical value for this constant was different in iOS 11 and earlier iOS versions (it was 6, which is now defined as 'HandleInApp').")] + [NoWatch, iOS (11,0)] + Success, } [iOS (10, 0)] @@ -527,10 +533,12 @@ namespace Intents { Failure, FailureRequiringAppLaunch, FailureNoMatchingWorkout, - [NoWatch, iOS (11,0)] - Success, + [Advice ("The numerical value for this constant was different in iOS 11 and earlier iOS versions (it was 7, which is now defined as 'Success').")] [NoWatch, iOS (11,0)] HandleInApp, + [Advice ("The numerical value for this constant was different in iOS 11 and earlier iOS versions (it was 6, which is now defined as 'HandleInApp').")] + [NoWatch, iOS (11,0)] + Success, } [iOS (10, 0)] @@ -824,10 +832,12 @@ namespace Intents { FailureRequiringAppLaunch, FailureOngoingWorkout, FailureNoMatchingWorkout, - [Watch (4,0), iOS (11,0)] - Success, + [Advice ("The numerical value for this constant was different in iOS 11 and earlier iOS versions (it was 7, which is now defined as 'Success').")] [Watch (4,0), iOS (11,0)] HandleInApp, + [Advice ("The numerical value for this constant was different in iOS 11 and earlier iOS versions (it was 6, which is now defined as 'HandleInApp').")] + [Watch (4,0), iOS (11,0)] + Success, } [iOS (10, 0)]