> For the complete documentation index, see [llms.txt](https://stachemsc.gitbook.io/stache-phone/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stachemsc.gitbook.io/stache-phone/custom-app.md).

# Custom App

Detailed section for Adding Custom Application.

### If you want to use the Template to create a custom application, you can access it from this [link](https://github.com/stachenoisy/Stache-Phone-CustomApp).

{% hint style="success" %}
After installing the template, go to [this](/stache-phone/making-adjustments/config-js.md#adding-a-custom-application) section and save it through the config.
{% endhint %}

## So what are the available functions.

{% hint style="warning" %}
These are the functions used for the UI Part!
{% endhint %}

<details>

<summary>STPhone.PreviewPhoto</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @src, @type, @name, @time, @size

* @src (string) - <mark style="color:yellow;">Photo Image / Video Source</mark>
* @type (string) - <mark style="color:yellow;">Photo Type (Photo / Video)</mark>
* @name (string) - <mark style="color:yellow;">Photo Name / Video Name</mark>
* @time (string) - <mark style="color:yellow;">Photo Time / Video Time</mark>
* @size (string) - <mark style="color:yellow;">Photo Size / Video Size</mark>

This Function allows you to display photos on the Gallery.

</details>

<details>

<summary>STPhone.CopyText</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @text

* @text(string) - <mark style="color:yellow;">Text To Copy</mark>

This Function allows you to copy a specific text.

</details>

<details>

<summary>STPhone.LockPhone</summary>

Type: <mark style="color:purple;">(Function)</mark>

This Function allows you to lock the Phone.

</details>

<details>

<summary>STPhone.ShowContact</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @name, @number

* @name(string) - <mark style="color:yellow;">Contact Name (Optional)</mark>
* @number(string) - <mark style="color:yellow;">Contact Number</mark>

This Function allows you to view a Contact in the contacts or add it to the contacts if it is not attached in the contacts.

</details>

<details>

<summary>STPhone.ShowConversition</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @number, @msgid

* @number(int) - <mark style="color:yellow;">Contact Number</mark>&#x20;
* @msgid(int) - <mark style="color:yellow;">Message ID (Optional)</mark>

This Function Opens your messages with a Person or creates a new message.

</details>

<details>

<summary>STPhone.TwitterShowPost</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @postid

* @postid(string) - <mark style="color:yellow;">Post ID</mark>

This Function allows you to view the Twitter Post.

</details>

<details>

<summary>STPhone.FormatBytes</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @bytes, @pretty

* @byte(int) - <mark style="color:yellow;">Bytes</mark>
* @pretty(boolean) - <mark style="color:yellow;">Pretty Format (ex. 10 MB / 3 GB) (optional)</mark>

This Function allows you to format the Byte type

</details>

<details>

<summary>STPhone.WalletPay</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @amount, @forcereturnhomescreen

* @amount(int) - <mark style="color:yellow;">Amount</mark>
* @forcereturnhomescreen(boolean) - <mark style="color:yellow;">Force Return Home Screen (optional)</mark>

This Function allows you to pay with WalletPay.

Note: This function uses promise api.

</details>

<details>

<summary>STPhone.ViewImage</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @src, @show

* @src(string) - <mark style="color:yellow;">Image Source</mark>
* @show(boolean) - <mark style="color:yellow;">Show / Hide</mark>

This function allows you to view Photos in a large format.

</details>

<details>

<summary>STPhone.OpenApp</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @appname

* @appname(string) - <mark style="color:yellow;">App Name</mark>

This function allows you to open a Different Application.

</details>

<details>

<summary>STPhone.OpenModal</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @title, @descp, @placeholder, @callback, @enableInput, @canceltext, @savetext, @showsavebtn

* @title(string) - <mark style="color:yellow;">Modal Title</mark>
* @descp(string) - <mark style="color:yellow;">Modal Description</mark>
* @placeholder(string) - <mark style="color:yellow;">Modal Placeholder</mark>
* @callback(function) - <mark style="color:yellow;">Modal Callback (Parameter: Input Value)</mark>
* @enableInput(boolean) - <mark style="color:yellow;">Enable Input</mark>
* @canceltext(string) - <mark style="color:yellow;">Cancel Button Text</mark>
* @savetext(string) - <mark style="color:yellow;">Save Button Text</mark>
* @showsavebtn(boolean) - <mark style="color:yellow;">Show Save Button</mark>

This function allows you to Create Modals.

</details>

<details>

<summary>STPhone.ChangePhoneBorderColor</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @color

* @color(string) - <mark style="color:yellow;">Color (Hex)</mark>

This function allows you to change the case color of the phone.

</details>

<details>

<summary>STPhone.ChangePhoneSize</summary>

Type: <mark style="color:purple;">(Function)</mark>

Parameters: @ishorizontal

* @ishorizontal(boolean) - <mark style="color:yellow;">Is Horizontal Phone</mark>

This function allows you to rotate the Phone.

</details>

<details>

<summary>STPhone.GetConfig</summary>

Type: <mark style="color:purple;">(Function)</mark>

Return: <mark style="color:red;">Config File</mark>

</details>

<details>

<summary>STPhone.GetLanguages</summary>

Type: <mark style="color:purple;">(Function)</mark>

Return: <mark style="color:red;">Languages</mark>

</details>

{% hint style="warning" %}
These are the functions used for the Lua Part!
{% endhint %}

<details>

<summary>STPhone:Client:Notify</summary>

Type: <mark style="color:purple;">(Event)</mark>

Side: <mark style="color:orange;">(Client)</mark>

Parameters: App, Title, Content, Timeout, Image

* App (string) - <mark style="color:yellow;">App Name</mark>
* Title (string) - <mark style="color:yellow;">Notify Title</mark>
* Content (string) - <mark style="color:yellow;">Notify Content</mark>
* Timeout (int) - <mark style="color:yellow;">Notify Display Time</mark>
* Image (string) - <mark style="color:yellow;">Notify Image</mark>

An event that you can use to send notifications to the phone

</details>

<details>

<summary>StachePhone:RequestSMS</summary>

Type: <mark style="color:purple;">(Event)</mark>

Side: <mark style="color:orange;">(Client)</mark>

Parameters: Data

* Data (table) - <mark style="color:yellow;">SMS Data</mark>

```
Data = {
    Sender = "Bank",
    MessageID = 997468748641385,
    Message = "Thank you for joining our bank."
}
```

It is used to send SMS to the phone.

</details>

<details>

<summary>/phonefix</summary>

Type: <mark style="color:purple;">(Command)</mark>

Side: <mark style="color:orange;">(Client)</mark>

If you are unable to restart via settings when you experience a problem with the phone, use this command.

</details>

<details>

<summary>STPhone:Server:AddMoneyToCard</summary>

Type: <mark style="color:purple;">(Event)</mark>

Side: <mark style="color:orange;">(Server)</mark>

Parameters: CardID, Amount, CitizenID, Author

* CardID (string) - <mark style="color:yellow;">CardID or 'main' for cash account</mark>
* Amount (int) - <mark style="color:yellow;">Amount</mark>
* CitizenID (string) - <mark style="color:yellow;">CitizenID</mark>
* Author (string) - <mark style="color:yellow;">Author For Transactions</mark>

An event that you can use to add money to a player's wallet card

</details>

<details>

<summary>STPhone:Server:RemoveMoneyFromCard</summary>

Type: <mark style="color:purple;">(Event)</mark>

Side: <mark style="color:orange;">(Server)</mark>

Parameters: CardID, Amount, CitizenID, Author

* CardID (string) - <mark style="color:yellow;">CardID or 'main' for cash account</mark>
* Amount (int) - <mark style="color:yellow;">Amount</mark>
* CitizenID (string) - <mark style="color:yellow;">CitizenID</mark>
* Author (string) - <mark style="color:yellow;">Author For Transactions</mark>

An event that you can use to remove money to a player's wallet card

</details>
