Skip to content

Commit d9a8cbe

Browse files
Zach DeanZach Dean
Zach Dean
authored and
Zach Dean
committed
iOS Pure C++ Turbo Module Attempt. Crashes after calling into the native module
1 parent 0cd1cae commit d9a8cbe

21 files changed

+24593
-362
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

-68
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

-8
This file was deleted.

.github/actions/setup/action.yml

-36
This file was deleted.

.github/workflows/ci.yml

-165
This file was deleted.

PureCppTurboModuleLibrary.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
1313
s.platforms = { :ios => min_ios_version_supported }
1414
s.source = { :git => "https://attractions.io.git", :tag => "#{s.version}" }
1515

16-
s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}"
16+
s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}", "ios/generated/*.{h,cpp,mm}"
1717

1818
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
1919
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.

cpp/PureCppImpl.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include "PureCppImpl.h"
2+
3+
namespace facebook::react {
4+
5+
PureCppImpl::PureCppImpl(std::shared_ptr<CallInvoker> jsInvoker): NativePureCppTurboModuleLibraryCxxSpec(std::move(jsInvoker)) {}
6+
7+
double PureCppImpl::multiply(jsi::Runtime& rt, double a, double b) {
8+
printf("PureCppImpl | multiply");
9+
return a * b;
10+
}
11+
12+
}

cpp/PureCppImpl.h

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#pragma once
2+
3+
#include <RNPureCppTurboModuleLibrarySpecJSI.h>
4+
5+
#include <memory>
6+
#include <string>
7+
8+
namespace facebook::react {
9+
10+
class PureCppImpl : public NativePureCppTurboModuleLibraryCxxSpec<PureCppImpl> {
11+
public:
12+
PureCppImpl(std::shared_ptr<CallInvoker> jsInvoker);
13+
14+
double multiply(jsi::Runtime &rt, double a, double b);
15+
};
16+
17+
}

cpp/pure-cpp-turbo-module-library.cpp

-7
This file was deleted.

cpp/pure-cpp-turbo-module-library.h

-8
This file was deleted.

0 commit comments

Comments
 (0)