ShoutSocial / share_handler

A plugin to facilitate receiving and handling share intents
43 stars 45 forks source link

How to route to custom page? #83

Closed chris-yeung closed 3 weeks ago

chris-yeung commented 9 months ago

In the example, it works when share content to the app. But how to share content with directing to open app and route to certain page?

I try place the ShareHandler in the second page, but after i click share, the app open, but it still is the first page, however, when i go second page, i see the file, but what i want is direct to second page.

Thank you, is anyone has idea of this?

Future initPlatformState() async { final handler = ShareHandler.instance; media = await handler.getInitialSharedMedia();

print("media---");
handler.sharedMediaStream.listen((SharedMedia media) {
  print(media);
  if (!mounted) return;
  setState(() {
    this.media = media;
  });
});
if (!mounted) return;

setState(() {
  // _platformVersion = platformVersion;
});

}

Mounix99 commented 8 months ago

Check the example in this video

JoshJuncker commented 3 weeks ago

Closing this assuming you figured it out with that video. Please open it again if you have more questions or think there is an issue.