ios – What’s the right syntax to proceed in app for customized intent?

0
2
ios – What’s the right syntax to proceed in app for customized intent?


I’ve a customized intent. When my app is unable to finish the decision of a parameter throughout the app extension, I would like to have the ability to proceed throughout the app. I’m unable to determine what the right goal C syntax is to allow the execution to proceed with the app. Here’s what I’ve tried:

completion([[PickWoodIntentResponse init] initWithCode:PickWoodIntentResponseCodeContinueInApp userActivity:nil]);

This ends in the next error:

Implicit conversion from enumeration kind 'enum PickWoodIntentResponseCode' to completely different enumeration kind 'INAnswerCallIntentResponseCode' (aka 'enum INAnswerCallIntentResponseCode')

I do not know why it’s referring to the enum kind of ‘INAnswerCallIntentResponseCode’ which is unrelated to my app.

I’ve additionally tried:

PickWoodIntentResponse *response = [[PickWoodIntentResponse init] initWithCode:PickWoodIntentResponseCodeContinueInApp userActivity:nil];
completion(response);

however that ends in 2 errors:

Implicit conversion from enumeration kind 'enum PickWoodIntentResponseCode' to completely different enumeration kind 'INAnswerCallIntentResponseCode' (aka 'enum INAnswerCallIntentResponseCode')

and

Incompatible pointer sorts passing 'PickWoodIntentResponse *' to parameter of kind 'INStringResolutionResult *'

The related autogenerated code offered to me with the creation of my intent is as follows:

@class PickWoodIntentResponse;
@protocol PickWoodIntentHandling 
- (void)resolveVarietyForPickWood:(PickWoodIntent *)intent withCompletion:(void (^)(INStringResolutionResult *resolutionResult))completion NS_SWIFT_NAME(resolveVariety(for:with:)) API_AVAILABLE(ios(13.0), macos(11.0), watchos(6.0));
@finish

typedef NS_ENUM(NSInteger, PickWoodIntentResponseCode) {
  PickWoodIntentResponseCodeUnspecified = 0,
  PickWoodIntentResponseCodeReady,
  PickWoodIntentResponseCodeContinueInApp,
  PickWoodIntentResponseCodeInProgress,
  PickWoodIntentResponseCodeSuccess,
  PickWoodIntentResponseCodeFailure,
  PickWoodIntentResponseCodeFailureRequiringAppLaunch
}

@interface PickWoodIntentResponse : INIntentResponse
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithCode:(PickWoodIntentResponseCode)code userActivity:(nullable NSUserActivity *)userActivity NS_DESIGNATED_INITIALIZER;
@property (readonly, NS_NONATOMIC_IOSONLY) PickWoodIntentResponseCode code;
@finish

Am I overlooking one thing? What could be the correct syntax to have throughout the completion block to fulfill the compiler?

LEAVE A REPLY

Please enter your comment!
Please enter your name here