clipboard icon indicating copy to clipboard operation
clipboard copied to clipboard

Android cannot get the clipboard content

Open BleachCC opened this issue 4 years ago • 5 comments

Environment

react-native 0.63.3

Platforms

Android

Versions

  • Android:Android 10
  • iOS:
  • react-native-netinfo:
  • react-native:
  • react:

Description

cannot get the clipboard content when app Toggle front and back, only Kill the app, open again and get it

Reproducible Demo

BleachCC avatar Dec 15 '20 10:12 BleachCC

I was find this bug too。hope fix this problem quickly

GitBiao avatar Dec 16 '20 10:12 GitBiao

Limited access to clipboard data Unless your app is the default input method editor (IME) or is the app that currently has focus, your app cannot access clipboard data on Android 10 or higher. (source)

I managed to get it to work by adding a delay after app comes to foreground and before getting clipboard

Freeminderus avatar Mar 10 '22 12:03 Freeminderus

I can't get clipboard data even if it has the focus. I get an error when I use getString() method:

[TypeError: undefined is not a function]

ufukomer avatar Jul 10 '22 10:07 ufukomer

Limited access to clipboard data Unless your app is the default input method editor (IME) or is the app that currently has focus, your app cannot access clipboard data on Android 10 or higher. (source)

I managed to get it to work by adding a delay after app comes to foreground and before getting clipboard

Thanks. I gave it setTimeout function.

richguma avatar Jul 29 '22 03:07 richguma

Getting this, I just installed the package and run in on Android OS, but it fails to run in the Android simulator. import com.facebook.react.bridge.ContextBaseJavaModule; ^ symbol: class ContextBaseJavaModule location: package com.facebook.react.bridge

renishdeveloper avatar Jan 05 '24 04:01 renishdeveloper