# How to find and add Screen Names for Entrypoints

Check where you are using the below methods and verify the screen names. We will add the screen names that can be configured for the app in the dashboard in the next steps&#x20;

### Find Screen Name in App Code

Check in your code where you are using the below method and verify the screen names. We will add the screen names that we can configure for app in dashboard in next steps.

{% tabs %}
{% tab title="Android" %}
The given function should be used on **every Activity's** `onResume` Method

```java
@Override
protected void onResume() {
    super.onResume();
    customerGlu.showEntryPoint(MainActivity.this,"screenName");
} 
```

{% endtab %}

{% tab title="iOS" %}
The given function should be used on each **ViewController's** `viewWillAppear()` method:

```swift
override func viewWillAppear(_ animated: Bool) {
    super.viewDidLoad()
    customerGlu.setCurrentClassName(className: String(describing: type(of: self)))
}
```

{% endtab %}

{% tab title="Flutter" %}
The given code should be added on every Activity:

```dart
@override 
Widget build(BuildContext context) { 
return CGScreenDetector(
 classname: "screenName",
  child: Scaffold( 
  body: Container( 
  width: MediaQuery.of(context).size.width, 
  decoration: BoxDecoration(color: Colors.white), 
  child: Text("My Widget");
      ),
     )
    );
   }
  
```

**For Android:**

The given function should be used in `MainActivity` , inside the `onResume` method to support adding the floating button/popup entry points on the activity via the dashboard:

```java
@Override
protected void onResume() {
    super.onResume();
        CGUtils.setActivity(this);
} 
```

{% endtab %}

{% tab title="React Native" %}
The given function should be used on every Activity's `useFocusEffect()` Method :

```javascript
import { SetCurrentClassName } from '@customerglu/react-native-customerglu';
import { useFocusEffect, useRoute } from "@react-navigation/native";
const route = useRoute();
    useFocusEffect(
        React.useCallback(() => {
            SetCurrentClassName(route.name);
        }, [navigation])
    );
   
```

{% endtab %}
{% endtabs %}

### Add Screen Names to dashboard&#x20;

* Open the CustomerGlu dashboard
* Go to **Nudges section** and create a new nudge
* In the **Trigger Criteria Section** , add the screen name in the **Allowed Screen** field.&#x20;
  * If screen name exists then select the screen name&#x20;
  * If not then you can **Add Custom Screen name** that is configured on app code  <br>

<figure><img src="https://1004846827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0ahLW2WavtwcwNbSR9%2Fuploads%2FIIdacB7ST5CgUlpK751T%2FScreenshot%202024-07-17%20at%2011.58.19%E2%80%AFAM.png?alt=media&#x26;token=705a1f7a-5968-43e2-8de2-7558f6eeb669" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1004846827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0ahLW2WavtwcwNbSR9%2Fuploads%2FqwTEdUtRam8AHzbJQFwg%2FScreenshot%202024-07-17%20at%2012.01.58%E2%80%AFPM.png?alt=media&#x26;token=acbef2c2-7ca8-457f-a0fd-97971d3753cf" alt=""><figcaption></figcaption></figure>

* Enter the Screen Name and click on  **SAVE**. Screen Name will be added in list.&#x20;
* Select the newly added screen name and launch a nudge.

{% hint style="warning" %}
Make sure Screen Name present in app needs to be same in dashboard
{% endhint %}
