Skip to content

Instantly share code, notes, and snippets.

View okwasniewski's full-sized avatar
💭
💻

Oskar Kwaśniewski okwasniewski

💭
💻
View GitHub Profile
@okwasniewski
okwasniewski / composer.yml
Created September 6, 2021 09:25
Create github release with composer dependencies automatically
name: "Release"
on:
push:
tags:
- "*"
env:
COMPOSER_FLAGS: "--no-dev --no-interaction"
- require_relative '../node_modules/react-native/scripts/react_native_pods'
- require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
+ require_relative '../../../node_modules/react-native/scripts/react_native_pods'
+ require_relative '../../../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'ExampleApp' do
...
@okwasniewski
okwasniewski / init.sh
Last active January 22, 2024 10:19
Initialize new React Native visionOS App
npx @callstack/react-native-visionos@latest init MySpatialApp
@okwasniewski
okwasniewski / init.sh
Created January 22, 2024 10:21
Install pods
bundle install && bundle exec pod install
@okwasniewski
okwasniewski / init.sh
Created January 22, 2024 10:22
Build React Native visionOS
yarn visionos
@okwasniewski
okwasniewski / YourFile.m
Created January 22, 2024 10:23
Unsupported code for visionOS
#if !TARGET_OS_VISION
// unsupported code
#endif
let jsCodeLocation = URL(string: "<http://localhost:8081/index.bundle?platform=ios>")!
let rootView = RCTRootView(bundleURL: jsCodeLocation, moduleName: "ReactNativeScreen", initialProperties: [:], launchOptions: nil)
let vc = UIViewController()
vc.view = rootView
self.present(vc, animated: true, completion: nil)
import UIKit
import React
import React_RCTAppDelegate
class AppDelegate: RCTAppDelegate {
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
// Do any setup your app needs
self.automaticallyLoadReactNativeWindow = false
// Remember to call super
import UIKit
import React
import React_RCTAppDelegate
class AppDelegate: RCTAppDelegate {
// ... application didFinishLaunchingWithOptions
override func sourceURL(for bridge: RCTBridge) -> URL? {
self.bundleURL()
}
@main
struct BrownfieldSwiftUIApp: App {
@UIApplicationDelegateAdaptor var delegate: AppDelegate
var body: some Scene {
WindowGroup {
TabView {
ContentView()
.tabItem {
Label("Home", systemImage: "house")