Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
941 views
in Technique[技术] by (71.8m points)

xamarin.forms - How to evaluate the result of Share.RequestAsync in Xamarin forms

Iam using Xamarin Share to share a URI. Is there anyway to evaluate the result if it was shared or cancelled. From the share dialog the user either share or cancel sharing.

public async Task ShareUri(string uri)
    {
        await Share.RequestAsync(new ShareTextRequest
            {
                Uri = uri,
                Title = "Share Web Link"
            });
    }
question from:https://stackoverflow.com/questions/65934049/how-to-evaluate-the-result-of-share-requestasync-in-xamarin-forms

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

No, there is no way to do this as that function just returns a void.

If you look at native development too, there's no way to get that information on either platform due to privacy reasons (unless the device is jailbroken)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...