KasemJaffer / receive_sharing_intent

A Flutter plugin that enables flutter apps to receive sharing photos, text and url from other apps.
Apache License 2.0
325 stars 372 forks source link

Fix Android App Restart not Triggering Initial Data #218

Open kulture-rob-snider opened 2 years ago

kulture-rob-snider commented 2 years ago

I have noticed that when Android kills the app while in the background, if a user shares to your app, the onNewIntent and onAttachedToActivity logic both get triggered. This causes the handleIntent to not set the initialText and initialMedia and thus when the app starts, the user's "initial" logic isn't triggered.

This instead sets an initialOverride to ensure that the onNewIntent doesn't override the initial data in this situation.