---
page_title: Life Cycle Events
product: UPI TPAP SDK
platform: React Native
page_source: https://juspay.io/in/docs/upi-tpap-sdk/react-native/interaction-with-sdk/life-cycle-events
llms_txt: https://juspay.io/in/docs/llms.txt
product_llms_txt: https://juspay.io/in/docs/upi-tpap-sdk/llms.txt
---


## Life Cycle Events



UPI In-app SDK runs in a fragment. Hence, to handle certain events based upon activity life cycle, client will need to forward those events to the SDK.

These events are crucial for seamless functioning of features like OTP reading, App Switches (UPI Intent), Hardware backpress.

Following are the Life cycle events which SDK needs


###   onBackPressed


In order to handle hardware backpress done by user, you have to call `onBackPressed()` on HyperServices Instance in the onBackPressed function of your Checkout Activity.

onBackPressed function returns a boolean. When this return value is true hardware backpressed is consumed by Juspay SDK, if its false you need to handle backpress



#### Code Snippets: -

#### Functional Code Snippet:

```functional
{"success":false,"message":"Failed to fetch snippet"}
```

#### Class Code Snippet:

```class
{"success":false,"message":"Failed to fetch snippet"}
```



###   onRequestPermissionsResult


In order to handle results of Permission Request results for cases like OTP Reading, you need to call `super.onRequestPermissionsResult()` in your onRequestPermissionsResult lifeCycle hook, if available, if not you can make same function call on HyperServices Instance.

> **Note**
> This is a conditional step, and is only supposed to be implemented if you are **overriding**  onRequestPermissionsResult





---

## Complete Code Reference

The following code files are referenced in the steps above:

### Checkout.js

```
{"success":false,"message":"Failed to fetch snippet"}
```

### Checkout.js

```
{"success":false,"message":"Failed to fetch snippet"}
```


---

## See Also

- [Handle SDK Response](https://juspay.io/in/docs/upi-tpap-sdk/react-native/interaction-with-sdk/handle-sdk-response)
- [IN-APP UPI with UI](https://juspay.io/in/docs/upi-tpap-sdk/react-native/ui-process-payloads/inapp-ui)
