Code Monkey home page Code Monkey logo

Comments (2)

d-silveira avatar d-silveira commented on May 29, 2024 11

this is a real issue, please someone check this.
We need to clear the initialLink after reading it!

from uni_links.

avioli avatar avioli commented on May 29, 2024

As it says in the README under Usage about the Initial Link:

Returns the link that the app was started with, if any.

I should add that getInitialLink (or getInitialUri) may only return a non-null value if the app was cold started and not resumed from the background.

So... your app was cold started...

Your user may start your app via the icon on their home screen. In this case the app will not have been started via an external link, so calling getInitialLink will return null.

On the other hand - your users may start your app via a link from another app, like a browser. In that case calling getInitialLink will return that specific link - something like com.my-domain.my-app-scheme://whatever?key1=param1&key2=param2 or https://my-fancy-app-domain.com.au/path/to/whatever/?auth_key=uuid&user_id=uuid.

This link is not meant and will not change throughout your app's life, until it is terminated - either by the system or by the user, force quitting it. It should not be cleared or reset. You should listen to changes via getLinksStream or getUriLinksStream, which notifies its listeners when a new link arrives. The listeners are notified when the app is resumed from the background, meaning the app is no longer terminated, but "minimised", while other apps are in the foreground and switch to your already running app.

I've written in the README a bit more about app start from a link.

This is how the two platforms are made. I'm open for discussion if I'm wrong and either of the two platforms - Android or iOS - support multiple entry points to a cold started app. The plugin is trying to give Flutter developers access to these details in the most convenient way. In some cases your best approach is to implement your own native solution (using Swift, Objective-C, Kotlin or Java), that is tailored specifically to your app's needs.

I hope this makes sense?

Feel free to re-open if needed.

Edit: added more clarifications.

from uni_links.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.