dotnet / dotnet/macios

[Siri Intents] Auto-generated intents doesn't work properly

Open
#5,076 11 comments 0 reactions 0 assignees View on GitHub
iOS question
Dominant language
C#
Stars
2.9k
Forks
576
Avg merge
2d 12h
Merged PRs (30d)
123

Description

### Steps to Reproduce

1. Download and open a [sample](https://github.com/xamarin/ios-samples/tree/soup-chef/ios12/SoupChef)
2. Open `SoupChef.Shared -> Data -> SoupOrderDataManager.cs` and go to the line 38
3. Run it on a device
4. Add a new item in the app (tap on `+` -> tap on any item -> tap on `Place Order`)
5. Look at the output

### Expected Behavior
There is `Successfully donated interaction.` message.

### Actual Behavior
There is `Interaction donation failed` message.
Error is: `Cannot donate interaction with intent that has no valid shortcut types`

This code creates an `INInteraction` instance from the custom Intent.

------

Also there is another way to get a runtime exception:
1. Open `SoupChef.Shared -> Data -> SoupMenuManager.cs`
2. Uncomment line 119
3. Go to the line 223
4. Uninstall the application from the device
5. Run it

You will get `Could not initialize an instance of the type 'Intents.INShortcut': the native 'initWithIntent:' method returned nil.` exception.
_Stack trace: https://gist.github.com/mykyta-bondarenko-gl/07680ecf25d7011b6455aa1f69332e10_

### Additional Information

I've create a new intents file via new VSfM UI. Also I've tried to use an old intents file and the [original one](https://developer.apple.com/documentation/sirikit/soup_chef_accelerating_app_interactions_with_shortcuts) (from the Xcode project)
We've discussed this issue with @jstedfast and decided that we need an additional help to found the reason of these issues

### Environment

1. VSfM
https://gist.github.com/mykyta-bondarenko-gl/50a460f96cc0f95f8106cb31cabd79ea

### Build Logs

1. Build Output
https://gist.github.com/mykyta-bondarenko-gl/8afb8ba2591386e9ae9f7274a2b458d1

### Example Project

[Sample](https://github.com/xamarin/ios-samples/tree/soup-chef/ios12/SoupChef)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.