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

add manifest.json #422

Closed
wants to merge 2 commits into from
Closed

add manifest.json #422

wants to merge 2 commits into from

Conversation

gko
Copy link
Member

@gko gko commented Dec 28, 2019

I use notes daily and love it. ❤️

I tried many options for a front end on mobile phone, but I find that the web version is just right (a part of some small things, that I will try to fix later).

Motivation

The thing is that when you tap «Add to Home screen» in chrome it always saves the Nextcloud default app (i.e. files) which is in the way when you're trying to quickly add some note.

Solution

I've looked through the code that is responsible of adding the manifest file and found that there is a default app -- theming that looks if the apps/<app>/img/manifest.json file is available and adds it otherwise it generates its own manifest in the ThemingDefaults.php file:

if ($image === 'manifest.json') {
	try {
		$appPath = $this->appManager->getAppPath($app);
		if (file_exists($appPath . '/img/manifest.json')) {
			return false;
		}
	} catch (AppPathNotFoundException $e) {}
	$route = $this->urlGenerator->linkToRoute('theming.Theming.getManifest');
}

but then the main .htaccess file is redirecting all the files to /.

So I decided to make a pull request there where I would allow apps to have their proper manifest files.

Result

With changes to server and the manifest.json within this PR I get:
image

And I'm able to save Notes app to desktop and access it quickly.

P.S. I also created a sandbox to be able to quickly debug apps.

Signed-off-by: Konstantin Gorodinskii <mail@konstantin.io>
@korelstar
Copy link
Member

Thanks for your contribution! Your PR sounds reasonable. But since it depends on nextcloud/server#18584, I'll wait for that PR to be merged until I merge this one.

However, I'm unsure about the paths in your manifest file: since these are not relative, I doubt that this works if Nextcloud is installed in a subdirectory. Could you please verify this?

Signed-off-by: Konstantin Gorodinskii <mail@konstantin.io>
@gko
Copy link
Member Author

gko commented Dec 29, 2019

@korelstar ok I fiddled a bit with different browsers. wherever I've installed notes app (in custom_apps/ or in apps/) it's always resolved via /apps/notes.

@korelstar
Copy link
Member

@gko Any news on the pull request on server? I think they are waiting for you to optimize your code (see nextcloud/server#18584 (comment)) ...

@korelstar korelstar marked this pull request as draft April 2, 2021 10:45
@marcelklehr
Copy link
Member

FYI, I implemented this with a slight hack in bookmarks, until server supports this natively: https://github.com/nextcloud/bookmarks/blob/master/lib/AugmentedTemplateResponse.php 🤷

@korelstar
Copy link
Member

This has been finally implemented directly in server: nextcloud/server#28459
However, thanks for your efforts!

@korelstar korelstar closed this Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants