myriky / flutter_siri_suggestions

ios siri suggestions plugin for flutter
MIT License
19 stars 23 forks source link

How to know the app was started from a Siri suggestion? #8

Open Livinglist opened 4 years ago

Livinglist commented 4 years ago

I found out that “onLaunch” method only works if the app is running in the background. If a user tap on a Siri suggestion while the app is not running, onLaunch won’t be called.

mgaucher commented 3 years ago

Hello, is there any update on this ? I don't understand the utility of this package if shortcuts are not working when app is closed

Livinglist commented 3 years ago

Hello, is there any update on this ? I don't understand the utility of this package if shortcuts are not working when app is closed

sadly no, I gave up using this package in the end.

RiyaJaggi28 commented 2 years ago

@Livinglist can you suggest which package you are using for siri shortcuts? I am facing the same issue and couldn't find any solution.

ducnguyenenterprise commented 2 years ago

You can use the fork here to resolve issue: https://github.com/smaho-engineering/flutter_siri_suggestions Also the most important thing is put this callback after your app rendering is finish (postframecallback)

FlutterSiriSuggestions.instance.configure(
  onLaunch: (Map<String, dynamic> message) async {
KevinBeckers commented 2 years ago

Same issue, trying to get @ducnguyenenterprise solution to work.

KevinBeckers commented 2 years ago

I can confirm https://github.com/smaho-engineering/flutter_siri_suggestions/commit/c5866d060ae9d837fe03252d737f86e2d06bfe3d solves this issue. Can this be merged? Or is this repo not maintained anymore?

AleksandarSavic95 commented 2 years ago

@KevinBeckers thank you for pointing this out! Do I have to put the specific commit hash in pubspec when specifying @ducnguyenenterprise's fork, or just putting git: https://github.com/smaho-engineering/flutter_siri_suggestions should work?

Also, what are the steps to make sure I've reset the build cache properly and that I am using the forked code? Did you call the configure inside the addPostFrameCallback? Where did you put it?

ducnguyenenterprise commented 2 years ago

@KevinBeckers thank you for pointing this out! Do I have to put the specific commit hash in pubspec when specifying @ducnguyenenterprise's fork, or just putting git: https://github.com/smaho-engineering/flutter_siri_suggestions should work?

You can using like this

flutter_siri_suggestions:
git: https://github.com/smaho-engineering/flutter_siri_suggestions.git
version: 2.0.4

Did you call the configure inside the addPostFrameCallback? Where did you put it?

You can put the configure after app first render by putting it in addPostFrameCallback or initState for the mainscreen

Also, what are the steps to make sure I've reset the build cache properly and that I am using the forked code?

You can check that in pubspec.lock. One way to make sure it get the newest version instead of cache is remove the dependency from the pubspec > flutter get > adding it again > flutter get

AleksandarSavic95 commented 2 years ago

Thanks for answering! Anyways, I got it to work yesterday, without using any of the forks, by following the solution from #15

There is a method retryLaunchWithActivity which I called "later" in my code/flow. It retried the Shortcut which opened the app, so that solved my issue.

I suppose it won't help you know that your app was launched from a Siri suggestion/shortcut, but it does the trick for me. Thanks once again, take care 😊 🤝

myriky commented 2 years ago

check it out new version! i'm sorry for too late.

AleksandarSavic95 commented 2 years ago

@myriky the 2.1.0 release removes the retryLaunchWithActivity method which I used in my code, so it's a breaking change! I have to keep the version fixed to 2.0.0 now. Minor versions should not introduce breaking changes, so please warn people about this in the docs!