# Custom APPs

## Adding app to phone:

First, lets add your custom app to phone system library.\
On **main\_config.lua** file, you can see the **Config.AppLabels**, there is where you set the lable name of your name.\
\
Lets give to our custom app the name of: **jpresources**

```lua
Config.AppLabels = {
    ["jpresources"] = "JPResources",
}
```

## Now, lets add our custom app to "AppStore":

On **main\_config.lua** file, you can see the **Config.AppStoreApps**, there is where you sadd your custom app to Phone System AppStore.

```lua
Config.AppStoreApps = {
    {name = "jpresources", label = "JPResources", backColor = "rgba(95, 94, 93, 0.178)", time = 5000, rate = 3.6, age = 6, image = "./img/apps/jpresources.png", category = "Custom Apps", description = "My first custom APP.", banner = "./img/appstore/jpresources.jpg"},
}
```

## Adding our custom app to "Storage System":

On **main\_config.lua** file, you can see the **Config.AppSizes**, there is where you sadd your custom app to Phone System Storage System.

```lua
Config.AppSizes = { -- in MBs
    ["jpresources"] = 623,
}
```

## Doing design of my custom app:

Phone System do all alone, now, after adding app to phone, adding it to appstore and to storage system, your app will show in-game.

When a player click on it, Phone System will show div named: **"app-YOUR APP NAME"**, in this case it will show div named **"app-jpresources"**

To do the design, just create a div with that name on html file, **FOLLOWING THE OTHER APPS EXAMPLE**, and add all you need on that app inside that div.

## My custom app UI Interactions

You can use file that is placed on HTML - JS - customAPP.js to insert all your UI interactions like clicks on your custom buttons inside an APP.

For LUA ones, you got the file inside CONFIGS - custom\_apps\_callbacks.lua to insert all you need to your custom app functions.

{% hint style="info" %}
This is how you do an app:\
1- Add it to Phone System;\
2- Add to AppStore;\
3- Add to Storage System;\
4- Create the Design;\
5- Create the interactions;\
\
Good to go :tada:
{% endhint %}

{% hint style="success" %}
Default Phone System UI interactions functions (can use on JS Files):

JPR.iPhone.Functions.ClosePhoneSystem

JPR.iPhone.Functions.CloseAllApps

JPR.iPhone.Functions.HideReturnBar

JPR.iPhone.Functions.ShowReturnBar

JPR.iPhone.Functions.CloseControlPanel

JPR.iPhone.Functions.OpenNewApp(appname)

JPR.iPhone.Functions.OpenControlArea

sendCustomNotification(text, image, title)
{% endhint %}
