---
name: "navigateBackMiniProgram"
mode: "kit"
versionRequirements:
  - { name: "MiniKit", version: "1.0.0" }
platform:
  - "iOS"
  - "Android"
async: true
---

## navigateBackMiniProgram

> [VERSION] MiniKit >= 1.0.0

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Return to the previous mini program. Only succeeds if the current mini program was opened by another mini program.

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `extraData` | `Record<string, any>` | No | - | `1.0.0` | Data to return to the previous mini program; the previous mini program can obtain it in App.onShow. |
| `complete` | `() => void` | No | - | - | Completion callback (invoked on both success and failure) |
| `success` | `() => void` | No | - | - | Success callback |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Extended error |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Extended error code |
| `errorMsg` | `string` | Extended error information |


### Examples

```tsx
ty.navigateBackMiniProgram({
  extraData: { from: "ttt-demo" },
  success: data => { console.log(data); },
  fail: error => { console.error(error); },
});
```
