Closed shubhamdeol closed 3 years ago
One way can be to send pressAction id as
pressAction: {
id: 'download',
},
and inside app listeners.
In press event handle it like
if (detail.notification?.android?.pressAction?.id === 'download') {
FileSystem.getContentUriAsync(uri).then((cUri) => {
IntentLauncher.startActivityAsync('android.intent.action.VIEW', {
data: cUri,
flags: 1,
});
});
}
This required me to save fileUri in AsyncStorage and clear async on press action action. More better way could be if I could pass the intent from the place I am creating the notificaiton.
Hey, this is an interesting use case! At the moment we only support launching a react activity. I'm not sure if it's possible but it could be something we look into.
Closing as it's not something on the roadmap as there's no clear solution right now.
I want to show local notification on successful file download.
Here is how I am trying
What is correct way to pass an intent which opens file in mobile.