<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/tl-dr-a-way-to-detect-if-a-device-has-a-notch-dynamic-island-feature---react-native-2026-nmvobtjvu" -->

---
title: TL;DR: A way to detect if a device has a notch (dynamic...
description: A React Native developer shares a custom native-module approach to detect whether a device has a notch or dynamic island, since React Native lacks a reliable...
canonical: https://daily.dev/posts/tl-dr-a-way-to-detect-if-a-device-has-a-notch-dynamic-island-feature---react-native-2026-nmvobtjvu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: TL;DR: A way to detect if a device has a notch (dynamic island) feature - React Native 2026 | daily.dev
og:description: A React Native developer shares a custom native-module approach to detect whether a device has a notch or dynamic island, since React Native lacks a reliable...
og:url: https://daily.dev/posts/tl-dr-a-way-to-detect-if-a-device-has-a-notch-dynamic-island-feature---react-native-2026-nmvobtjvu
og:image: https://api.daily.dev/og/posts/NmvoBtJVU.png
og:image:alt: TL;DR: A way to detect if a device has a notch (dynamic island) feature - React Native 2026
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TL;DR: A way to detect if a device has a notch (dynamic island) feature - React Native 2026

**[chriisduran's squad](https://daily.dev/sources/chriisduran)** · [@chriisduran](https://daily.dev/chriisduran) · 3 min read · 0 upvotes · 0 comments

## Summary

A React Native developer shares a custom native-module approach to detect whether a device has a notch or dynamic island, since React Native lacks a reliable built-in way to do this. The solution involves writing a native Android module (Java/Kotlin) and a native iOS module (Objective-C) that checks safe area insets, then exposing both through NativeModules in JavaScript. The author notes there's no official manufacturer API for this, so the solution only returns a boolean and can't report the notch's exact dimensions.

## Content

Original Article, check it out [here](https://chriisduran.medium.com/rn-notch-detection-04f96025a9e8?sk=3055852a7711caabbb597972ff90cdfa)  😜

_React Native_ doesn't have a direct way to reliably know whether a device has a notch, dynamic island, or neither. So, here's how I solved it…

## Background story

A few weeks ago I was working on the company's app, specifically on the UI section. So, if you're a React Native developer working on your app's frontend, at some point you'll come across a particular feature of certain devices where, for your frontend to adapt efficiently, you'll need to detect whether the device in question has a notch or dynamic island.

## React native Gap

![GIF](https://static.klipy.com/ii/f87f46a2c5aeaeed4c68910815f73eaf/4a/03/1IvnE9EC.gif)

At least, until a few weeks ago when I tried to accurately detect the notch on some devices, it didn't work well. Let's remember that this might be easily covered on iPhone, since the models maintain consistency across different versions; however, on Android things are more chaotic, since, as you may know, each manufacturer does whatever it wants with Android according to its own ideas and needs.

## Implementation

![GIF](https://static.klipy.com/ii/d7aec6f6f171607374b2065c836f92f4/6b/ac/VbnZN6pU.gif)

Let's get to work: how could we more accurately determine whether a device has a dynamic island or notch or not? By following these steps.

## Android

To detect on Android whether the device has this particular feature, we're going to create a file at the following location:

_android > app > src > main > java > com > [name of your app] > NotchDetectorPackage.java_

```
package com.[name of your app];

package com.[name of your app];

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.*;
import com.facebook.react.uimanager.ViewManager;
import java.util.*;

public class NotchDetectorPackage implements ReactPackage {
  @Override
  public List<NativeModule> createNativeModules(ReactApplicationContext rc) {
    return Arrays.asList(new NotchDetectorModule(rc));
  }
  @Override
  public List<ViewManager> createViewManagers(ReactApplicationContext rc) {
    return Collections.emptyList();
  }
}
```

MainApplication.kt:

```
import com.[name of your app].NotchDetectorPackage

class MainApplication : Application(), ReactApplication {

  override val reactNativeHost: ReactNativeHost =
      object : DefaultReactNativeHost(this) {
        override fun getPackages(): List<ReactPackage> =
            PackageList(this).packages.apply {
              add(NotchDetectorPackage())
            }
....
```

## IOS

For iOS devices, we're going to create two files in the following location in the project: _ios > NotchDetector.h_

```
#import <React/RCTBridgeModule.h>
@interface NotchDetector : NSObject <RCTBridgeModule>
@end
```

And too: _ios> NotchDetector.m_

```
#import "NotchDetector.h"
#import <UIKit/UIKit.h>

@implementation NotchDetector
RCT_EXPORT_MODULE();

RCT_REMAP_METHOD(hasNotch, resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
  @try {
    UIWindow *window = UIApplication.sharedApplication.windows.firstObject;
    if (!window) {
      NSLog(@"[NotchDetector] No window found");
      resolve(@(NO));
      return;
    }
    CGFloat top = window.safeAreaInsets.top;
    NSLog(@"[NotchDetector] top safeAreaInset: %f", top);
    resolve(@(top > 20));
  } @catch (NSException *exception) {
    NSLog(@"[NotchDetector] Exception: %@", exception);
    reject(@"error", @"Failed to detect notch", nil);
  }
}
@end
```

Keep in mind that for iOS, even though these files were created manually, you need to make sure they're imported as modules in Xcode.

With the files above ready, we finally call the NotchDetector module as follows in our React Native app

```
import {View, StyleSheet, BackHandler, NativeModules} from 'react-native';
const {NotchDetector} = NativeModules;

const Main_Screen = ({route}) => {
...
const notch = await NotchDetector.hasNotch();
// notch contain the result if the device have notch(dynamic island) or not
```

That's it.

## Disclaimer

![GIF](https://static.klipy.com/ii/4493325008d34b7bf8cd6813cd5c1619/eb/9c/S6ykeNZYNuwtr4Owefzv.gif)

There is currently no official API or guideline that manufacturers are required to follow to provide developers with information about their device's dynamic island or notch section. So, while this solution covers returning whether or not a device has this physical feature, if you need information such as the height of this section on the screen, that isn't possible at this time.

Regards.

🪙 You can buy my projects and support me on:

- [Patreon](https://www.patreon.com/chriisduran)
- [Ko-Fi](https://ko-fi.com/chriisduran)
- [BuyMeACoffee](https://www.buymeacoffee.com/chriisduran)
- [Paypal](https://www.paypal.me/CAD1994)
- [Instagram](https://www.instagram.com/chriis.duran)
- [Linktree](https://linktr.ee/chriisduran)

## Similar posts on daily.dev

- [Android 16’s Edge-to-Edge Mandate: Why Your “Simple Fix” Will Break at Scale](https://daily.dev/posts/android-16-s-edge-to-edge-mandate-why-your-simple-fix-will-break-at-scale-urmep9kv5) · ProAndroidDev · 1 upvotes · 0 comments
- [New CSS variable for mobile safe area insets](https://daily.dev/posts/new-css-variable-for-mobile-safe-area-insets-xusyyjbli) · Shopify Developer changelog · 22 upvotes · 2 comments
- [How notch traversal works on MacBooks](https://daily.dev/posts/how-notch-traversal-works-on-macbooks-j4vlhjvua) · Tailscale · 1 upvotes · 0 comments
- [Migrating to native stack navigation, with a surprise from iOS 26](https://daily.dev/posts/migrating-to-native-stack-navigation-with-a-surprise-from-ios-26-6v2j7is5w) · thoughbot · 0 upvotes · 0 comments

---

Tags: [#mobile](https://daily.dev/tags/mobile), [#android](https://daily.dev/tags/android), [#ios](https://daily.dev/tags/ios), [#react-native](https://daily.dev/tags/react-native)

[View this post on daily.dev](https://daily.dev/posts/tl-dr-a-way-to-detect-if-a-device-has-a-notch-dynamic-island-feature---react-native-2026-nmvobtjvu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/tl-dr-a-way-to-detect-if-a-device-has-a-notch-dynamic-island-feature---react-native-2026-nmvobtjvu","headline":"TL;DR: A way to detect if a device has a notch (dynamic island) feature - React Native 2026","text":"A React Native developer shares a custom native-module approach to detect whether a device has a notch or dynamic island, since React Native lacks a reliable built-in way to do this. The solution involves writing a native Android module (Java/Kotlin) and a native iOS module (Objective-C) that checks safe area insets, then exposing both through NativeModules in JavaScript. The author notes there's no official manufacturer API for this, so the solution only returns a boolean and can't report the notch's exact dimensions.","url":"https://daily.dev/posts/tl-dr-a-way-to-detect-if-a-device-has-a-notch-dynamic-island-feature---react-native-2026-nmvobtjvu","datePublished":"2026-08-30T00:27:55.826Z","dateModified":"2026-08-30T00:34:08.270Z","author":{"@type":"Person","name":"Christopher","url":"https://daily.dev/chriisduran","image":"https://media.daily.dev/image/upload/s--weuhKLWP--/f_auto/v1780405776/avatars/avatar_OSdkMjymQCGEuLzC2F02e?_a=BAMAMiWQ0","description":"Just someone sharing their hobbies on the internet xD","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":610}},"image":"https://media.daily.dev/image/upload/s--P2FKzG7U--/f_auto/v1788049676/posts/NmvoBtJVU?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/chriisduran","name":"chriisduran's squad"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"chriisduran's squad","item":"https://daily.dev/squads/chriisduran"},{"@type":"ListItem","position":3,"name":"TL;DR: A way to detect if a device has a notch (dynamic island) feature - React Native 2026"}]}
```

