Closed kaciula closed 11 months ago
+1 @JoshJuncker
@kaciula There might be a way. I'm not sure. So far the ux has been good enough for the apps I have used it on. I'm happy to look at a pr if you figure something out though.
Unfortunately I come from the Android side so I am not very familiar with iOS code.
@kaciula There might be a way. I'm not sure. So far the ux has been good enough for the apps I have used it on. I'm happy to look at a pr if you figure something out though.
It seems that you can put the code belows in the isContentValid()
method, the share extension will go to our app immediately with out the default share modal
Task {
await handleInputItems()
}
finally it looks like
...
public override func isContentValid() -> Bool {
Task {
await handleInputItems()
}
return true
}
...
works perfectly for me with local debug env
FYI @JoshJuncker
reference with https://juejin.cn/post/7236021829000101947 later I will try to commit a pull request to improve this
@firstmetcs I tried what you showed above, but it seems to call handleInputItems multiple times. So when I share an image, it comes through to the flutter app as 2 images. It also hits the deep link twice, so the flutter app gets 2 events on the ShareHandlerPlatform.instance.sharedMediaStream. However, it does seem to skip the UI, so you may be on to something there.
@firstmetcs I tried what you showed above, but it seems to call handleInputItems multiple times. So when I share an image, it comes through to the flutter app as 2 images. It also hits the deep link twice, so the flutter app gets 2 events on the ShareHandlerPlatform.instance.sharedMediaStream. However, it does seem to skip the UI, so you may be on to something there.
Put the main task in isContentValid()
method seems not to be a good idea, so in my pr #68 I change the super controller to UIViewController
and put the main task in viewDidLoad
, works perfectly for me. @JoshJuncker
Is there a way to not show the default share modal while the share is going to the Flutter app?
Can we at least modify it so it's something transparent or something that does not stand out?
"Note that for a brief moment, a default share modal might show up before it redirects to the app (particularly noticeable when using a simulator)"