Foundation apps

KodeStar edited this page Feb 13, 2018 · 3 revisions

Creating a new Foundation app consists of a minimum of 3 things:

  • A new interface in /App/SupportedApps/

  • An application icon in /storage/app/public/supportedapps/ which is 250 x 250px.

  • Adding your application to the /app/Item.php supportedList() function

Additionally, if the app has an API and you want to show live stat details on a tile you also need to create

  • A blade file in /resources/views/supportedapps/

The interface file

For this example we’ll use the NZBGet app, if it was going to be an enhanced app you would also need to implement the Contracts\Livestats interface, but for the purpose of this tutorial it’s not needed

<?php namespace App\SupportedApps;

class Nzbget implements Contracts\Applications {
    
    public function defaultColour()
    {
        return '#124019';
    }
    public function icon()
    {
        return 'supportedapps/nzbget.png';
    }
   
}
A supported application has a single roles, that is to provide some basic defaults to make adding an app quicker an enhanced app on the other hand outputs data from an apps API, we’ll cover Enhanced apps in another entry.

The defaultColour() returns a hex value that is automatically applied to the colour field. Background colours tend to look better darker and more desaturated, a user can change it to any colour they like, but for default colours please use a colour picker to pick a part of the main logo then choose a darker more desaturated version of it.

The icon() function returns the path to the applications icon and will load the image into the choose icon section.

The application icon

This should be a 250 x 250px PNG file, the file name isn’t important as you explicitly point to the file in the interface file, but for conventions sake make it the name of the app, lowercase, no special characters, and replace whitespace with underscores.

In this example it would be stored as /storage/app/public/supportedapps/nzbget.png

Adding the application to the supported list

Edit /app/Item.php and add your app to the the

  public static function supportedList()
  {
      return [
          'Plex' => \App\SupportedApps\Plex::class,
      ];
  }
Change to
  public static function supportedList()
  {
      return [
          'Plex' => \App\SupportedApps\Plex::class,
          'NZBGet' => \App\SupportedApps\Nzbget::class,
      ];
  }

The array key, is how the App will show in the list.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.