
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-native-kiosk
Advanced tools
A simple kiosk mode for Android in react native.
Does not work with Expo because of its native dependencies.
npm install react-native-kiosk
In MainActivity.java add the following code:
//...
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.reactnativekiosk.Immersive;
public class MainActivity extends ReactActivity {
//...
@Override
public void onBackPressed() {
if( !Immersive.getActive() ) super.onBackPressed();
else Immersive.fullscreen(getWindow());
}
@Override
protected void onPause() {
super.onPause();
if(Immersive.getActive()) Immersive.moveToFront(getTaskId(),(ActivityManager) getSystemService(Context.ACTIVITY_SERVICE));
}
@Override
protected void onResume() {
super.onResume();
if(Immersive.getActive()) Immersive.fullscreen(getWindow());
}
@Override
protected void onUserLeaveHint() {
super.onUserLeaveHint();
if(Immersive.getActive()) {
Immersive.moveToFront(getTaskId(), (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE));
Immersive.fullscreen(getWindow());
}
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if(Immersive.getActive()) Immersive.fullscreen(getWindow());
if (!hasFocus) {
Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(closeDialog);
}
}
}
The next step is to put this here in the AndroidManifest.xml:
<uses-permission android:name="android.permission.REORDER_TASKS" />
And below in the <intent-filter>:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
import Kiosk from "react-native-kiosk";
// ...
const App = () => {
const handleFullscreen = () => {
Kiosk.fullscreen();
};
const handleExitFullscreen = () => {
Kiosk.exitFullscreen();
};
return (
<View >
<TouchableOpacity onPress={handleFullscreen} >
<Text>Enter</Text>
</TouchableOpacity>
<TouchableOpacity onPress={handleExitFullscreen} >
<Text>Exit</Text>
</TouchableOpacity>
</View>
);
};
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
A simple kiosk mode for Android in react native
We found that react-native-kiosk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.