App development

Intro

Before you start, please check if there already is a similar app in the App Store or the GitHub organisation that you could contribute to. Also, feel free to communicate your idea and plans in the forum so other contributors might join in.

Then, please make sure you have set up a development environment:

Before starting to write an app please read the security and coding guidelines:

After this you can start with the tutorial

Once you are ready for publishing, check out the app store process:

For enhanced security it is also possible to sign your code:

App development

Take a look at the changes in this version:

Create a new app:

Inner parts of an app:

Requests

How a request is being processed:

View

The app’s presentation layer:

Storage

Create database tables, run Sql queries, store/retrieve configuration information and access the filesystem:

Authentication & users

Creating, deleting, updating, searching, login and logout:

Writing a two-factor auth provider:

Hooks

Listen on events like user creation and execute code:

Background jobs

Periodically run code in the background:

Settings

An app can register both admin settings as well as personal settings:

Notifications

An app can send notifications to display to users. It can also retrieve and act upon notifications that are received by the users. See the documentation of the official Notifications app.

Logging

Log to the data/nextcloud.log:

Migrations

Migrations can be used to do database changes which are allowing apps a more granular updating mechanism:

Repair steps

Repair steps can be used to run code at various stages in app installation, uninstallation, migration and more:

Testing

Write automated tests to ensure stability and ease maintenance:

PHPDoc class documentation

Nextcloud class and function documentation: