Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] The method openFile should remember the default app (if one is chosen) #7427

Open
jokro opened this issue Jun 29, 2019 · 2 comments
Open

Comments

@jokro
Copy link

@jokro jokro commented Jun 29, 2019

Case:
In android i use
import {openFile} from "tns-core-modules/utils/utils"
openFile(path)
to open a *.pdf file from downloads folder. This works like charm with one problem.

Problem: a list of all apps which can open a pdf file is opened. If i select google pdf viewer, the file opens correctly. If I close and reopen, again I first have to select the google pdf viewer before the file opens. That is, it doesn't remember my choice.

If I open the same file with the android downloads app, I get an option to to always select google pdf viewer as the app to open this file. This works as intended. Trying openFile again after this option is set still opens the app list and does not open the file at once.
I tried also with other apps which were set as default app in the android settings. Also in that case openFile does not use the setting for the default app: in all cases you must select the app to use first. Only if there is only one app, then it opens at once.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@NickIliev
Copy link
Member

@NickIliev NickIliev commented Jul 1, 2019

@jokro the method openFIle is implemented using the chooser intent by design. What you need is different functionality, which will require further enhancement of the logic in the openFile code (e.g., verification that there is an app to open the mimeType and directly opening the file if so as done here).

As this is not a bug but an enhancement to the existing logic, I am marking this issue as a feature request
аnd as a good-first-issue.

@NickIliev NickIliev changed the title openFile does not open default app [Feature] The method openFile should remember the default app (if one is chosen) Jul 1, 2019
@jokro
Copy link
Author

@jokro jokro commented Sep 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.