
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@callstack/react-native-visionos
Advanced tools
Learn once, write anywhere:
Build spatial apps with React.
React Native visionOS allows you to write visionOS with full support for platform SDK. This is a full fork of the main repository with changes needed to support visionOS.
[!CAUTION] This project is still at an early stage of development and is not ready for production use.
npx @callstack/react-native-visionos@latest init YourApp
YourApp/visionos
folder and run following commands to install Pods:bundle install
bundle exec pod install
yarn visionos
xed YourApp/visionos/YourApp.xcworkspace
).We suggest you read Human Interface Guidelines for visionOS when creating visionOS apps.
It's important not to cover the translucent background with a solid color, as it helps to ground apps and make them feel like part of the environment.
React Native visionOS uses SwiftUI lifecycle. The app entry point is now App.swift
file (by default it is main.m
). This change allows us to use full capabilities of the visionOS SDK.
Here is an example from the template:
// App.swift
@main
struct HelloWorldApp: App {
@UIApplicationDelegateAdaptor var delegate: AppDelegate
var body: some Scene {
RCTMainWindow(moduleName: "HelloWorld")
}
}
We are using @UIApplicationDelegateAdaptor
, a property wrapper that allows us to use familiar AppDelegate
in SwiftUI life cycle.
AppDelegate
extends RCTAppDelegate
which does most of React Native initialization.
This is a prop on <View />
component allowing to add hover effect. It's applied to all Touchable and Pressable components by default.
If you want to customize it you can use the visionos_hoverEffect
prop, like so:
<TouchableOpacity visionos_hoverEffect="lift">
<Text>Click me</Text>
</TouchableOpacity>
The available options are: lift
or highlight
.
XR
APIManage Immersive Experiences.
requestSession
requestSession: (sessionId?: string) => Promise<void>
Opens a new ImmersiveSpace
given it's unique Id
.
endSession
endSession: () => Promise<void>
Closes currently open ImmersiveSpace
.
supportsMultipleScenes
supportsMultipleScenes: boolean
A Boolean value that indicates whether the app may display multiple scenes simultaneously. Returns the value of UIApplicationSupportsMultipleScenes
key from Info.plist
.
UIApplicationSupportsMultipleScenes
to true
in Info.plist
:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationPreferredDefaultSceneSessionRole</key>
<string>UIWindowSceneSessionRoleApplication</string>
<key>UIApplicationSupportsMultipleScenes</key>
- <false/>
+ <true/>
<key>UISceneConfigurations</key>
<dict/>
</dict>
</dict>
</plist>
App.swift
add new ImmersiveSpace
:@main
struct HelloWorldApp: App {
@UIApplicationDelegateAdaptor var delegate: AppDelegate
+ @State private var immersionLevel: ImmersionStyle = .mixed
var body: some Scene {
RCTMainWindow(moduleName: "HelloWorldApp")
+ ImmersiveSpace(id: "TestImmersiveSpace") {
+ // RealityKit content goes here
+ }
+ .immersionStyle(selection: $immersionLevel, in: .mixed, .progressive, .full)
}
}
For more information about ImmersiveSpace
API refer to Apple documentation.
In the above example we set ImmersiveSpace
id to TestImmersiveSpace
.
Now in our JS code, we can call:
import {XR} from "@callstack/react-native-visionos"
//...
const openXRSession = async () => {
try {
if (!XR.supportsMultipleScenes) {
Alert.alert('Error', 'Multiple scenes are not supported');
return;
}
await XR.requestSession('TestImmersiveSpace'); // Pass the same identifier from `App.swift`
} catch (e) {
Alert.alert('Error', e.message);
}
};
const closeXRSession = async () => {
await XR.endSession();
};
[!CAUTION] Opening an
ImmersiveSpace
can fail in this secarios:
ImmersiveSpace
is not declared.UIApplicationSupportsMultipleScenes
is set tofalse
.- User cancels the request.
For a full example usage, refer to XRExample.js
.
New project creation
section.rn-tester
README.md to build React Native from source.We use a script called oot-release.js
which automatically releases visionos
packages and aligns versions of dependencies with React Native core.
Usage:
node ./scripts/oot-release.js --new-version "<visionos-version>" --react-native-version "<react-native-version>" --one-time-password "<otp>"
To test releases and template we use Verdaccio.
v0.73.5
FAQs
React Native for visionOS
The npm package @callstack/react-native-visionos receives a total of 1,541 weekly downloads. As such, @callstack/react-native-visionos popularity was classified as popular.
We found that @callstack/react-native-visionos demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.