Commit 46ab6081 authored by Wei Han's avatar Wei Han

native ios UI component working

parent 515cf011
......@@ -8,32 +8,32 @@
<key>BinaryPath</key>
<string>QmsPluginFramework.framework/QmsPluginFramework</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>QmsPluginFramework.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>QmsPluginFramework.framework/QmsPluginFramework</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>QmsPluginFramework.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
......
......@@ -4,12 +4,12 @@
NS_ASSUME_NONNULL_BEGIN
//@interface QmsPluginFunc : NSObject
//
//+ (NSNumber *)multiplyA:(double)a withB:(double)b;
//+ (NSNumber *)sumA:(double)a withB:(double)b;
//
//@end
@interface QmsPluginFunc : NSObject
+ (NSNumber *)multiplyA:(double)a withB:(double)b;
+ (NSNumber *)sumA:(double)a withB:(double)b;
@end
@interface QmsPluginUI : NSObject
......
......@@ -6,7 +6,7 @@
<dict>
<key>Headers/QmsPlugin.h</key>
<data>
INDfuKT/tXvd59OKxALrlk7Mh0Q=
k1ElB+OnAYDlAZsTB5il2X25Zbo=
</data>
<key>Headers/QmsPluginFramework.h</key>
<data>
......@@ -27,7 +27,7 @@
<dict>
<key>hash2</key>
<data>
bEZU5MWGiY3Jr0g9zM93JZAgpDf7fM2qmPh9KoANLiY=
0Mb9gSDCwOc/iII1iRSpHuviN1zg4ZnFmrGQlJAjD5o=
</data>
</dict>
<key>Headers/QmsPluginFramework.h</key>
......
......@@ -4,12 +4,12 @@
NS_ASSUME_NONNULL_BEGIN
//@interface QmsPluginFunc : NSObject
//
//+ (NSNumber *)multiplyA:(double)a withB:(double)b;
//+ (NSNumber *)sumA:(double)a withB:(double)b;
//
//@end
@interface QmsPluginFunc : NSObject
+ (NSNumber *)multiplyA:(double)a withB:(double)b;
+ (NSNumber *)sumA:(double)a withB:(double)b;
@end
@interface QmsPluginUI : NSObject
......
......@@ -6,7 +6,7 @@
<dict>
<key>Headers/QmsPlugin.h</key>
<data>
INDfuKT/tXvd59OKxALrlk7Mh0Q=
k1ElB+OnAYDlAZsTB5il2X25Zbo=
</data>
<key>Headers/QmsPluginFramework.h</key>
<data>
......@@ -27,7 +27,7 @@
<dict>
<key>hash2</key>
<data>
bEZU5MWGiY3Jr0g9zM93JZAgpDf7fM2qmPh9KoANLiY=
0Mb9gSDCwOc/iII1iRSpHuviN1zg4ZnFmrGQlJAjD5o=
</data>
</dict>
<key>Headers/QmsPluginFramework.h</key>
......
......@@ -4,12 +4,12 @@
NS_ASSUME_NONNULL_BEGIN
//@interface QmsPluginFunc : NSObject
//
//+ (NSNumber *)multiplyA:(double)a withB:(double)b;
//+ (NSNumber *)sumA:(double)a withB:(double)b;
//
//@end
@interface QmsPluginFunc : NSObject
+ (NSNumber *)multiplyA:(double)a withB:(double)b;
+ (NSNumber *)sumA:(double)a withB:(double)b;
@end
@interface QmsPluginUI : NSObject
......
//QmsPlugin.mm
#import "QmsPlugin.h"
//@implementation QmsPluginFunc
//
//+ (NSNumber *)multiplyA:(double)a withB:(double)b {
// return @(a * b);
//}
//
//+ (NSNumber *)sumA:(double)a withB:(double)b {
// return @(a + b);
//}
//
//@end
@implementation QmsPluginFunc
+ (NSNumber *)multiplyA:(double)a withB:(double)b {
return @(a * b);
}
+ (NSNumber *)sumA:(double)a withB:(double)b {
return @(a + b);
}
@end
@implementation QmsPluginUI
......
......@@ -24,19 +24,19 @@ RCT_EXPORT_MODULE()
return self;
}
// - (NSNumber *)sum:(double)a b:(double)b {
// NSLog(@"[QmsPlugin] sum called with a=%f, b=%f", a, b);
// NSNumber *result = [QmsPluginFunc sumA:a withB:b];
// NSLog(@"[QmsPlugin] sum result = %@", result);
// return result;
// }
// // Wraps the C function QmsPluginMultiply
// - (NSNumber *)multiply:(double)a b:(double)b {
// NSLog(@"[QmsPlugin] multiply called with a=%f, b=%f", a, b);
// NSNumber *result = [QmsPluginFunc multiplyA:a withB:b];
// NSLog(@"[QmsPlugin] multiply result = %@", result);
// return result;
// }
- (NSNumber *)sum:(double)a b:(double)b {
NSLog(@"[QmsPlugin] sum called with a=%f, b=%f", a, b);
NSNumber *result = [QmsPluginFunc sumA:a withB:b];
NSLog(@"[QmsPlugin] sum result = %@", result);
return result;
}
// Wraps the C function QmsPluginMultiply
- (NSNumber *)multiply:(double)a b:(double)b {
NSLog(@"[QmsPlugin] multiply called with a=%f, b=%f", a, b);
NSNumber *result = [QmsPluginFunc multiplyA:a withB:b];
NSLog(@"[QmsPlugin] multiply result = %@", result);
return result;
}
// Wraps the C function QmsPluginMakeViewController
- (void)showPluginUI {
......
......@@ -8,32 +8,32 @@
<key>BinaryPath</key>
<string>QmsPluginFramework.framework/QmsPluginFramework</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>QmsPluginFramework.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>QmsPluginFramework.framework/QmsPluginFramework</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>QmsPluginFramework.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
......
......@@ -4,12 +4,12 @@
NS_ASSUME_NONNULL_BEGIN
//@interface QmsPluginFunc : NSObject
//
//+ (NSNumber *)multiplyA:(double)a withB:(double)b;
//+ (NSNumber *)sumA:(double)a withB:(double)b;
//
//@end
@interface QmsPluginFunc : NSObject
+ (NSNumber *)multiplyA:(double)a withB:(double)b;
+ (NSNumber *)sumA:(double)a withB:(double)b;
@end
@interface QmsPluginUI : NSObject
......
......@@ -6,7 +6,7 @@
<dict>
<key>Headers/QmsPlugin.h</key>
<data>
INDfuKT/tXvd59OKxALrlk7Mh0Q=
k1ElB+OnAYDlAZsTB5il2X25Zbo=
</data>
<key>Headers/QmsPluginFramework.h</key>
<data>
......@@ -27,7 +27,7 @@
<dict>
<key>hash2</key>
<data>
bEZU5MWGiY3Jr0g9zM93JZAgpDf7fM2qmPh9KoANLiY=
0Mb9gSDCwOc/iII1iRSpHuviN1zg4ZnFmrGQlJAjD5o=
</data>
</dict>
<key>Headers/QmsPluginFramework.h</key>
......
......@@ -4,12 +4,12 @@
NS_ASSUME_NONNULL_BEGIN
//@interface QmsPluginFunc : NSObject
//
//+ (NSNumber *)multiplyA:(double)a withB:(double)b;
//+ (NSNumber *)sumA:(double)a withB:(double)b;
//
//@end
@interface QmsPluginFunc : NSObject
+ (NSNumber *)multiplyA:(double)a withB:(double)b;
+ (NSNumber *)sumA:(double)a withB:(double)b;
@end
@interface QmsPluginUI : NSObject
......
......@@ -6,7 +6,7 @@
<dict>
<key>Headers/QmsPlugin.h</key>
<data>
INDfuKT/tXvd59OKxALrlk7Mh0Q=
k1ElB+OnAYDlAZsTB5il2X25Zbo=
</data>
<key>Headers/QmsPluginFramework.h</key>
<data>
......@@ -27,7 +27,7 @@
<dict>
<key>hash2</key>
<data>
bEZU5MWGiY3Jr0g9zM93JZAgpDf7fM2qmPh9KoANLiY=
0Mb9gSDCwOc/iII1iRSpHuviN1zg4ZnFmrGQlJAjD5o=
</data>
</dict>
<key>Headers/QmsPluginFramework.h</key>
......
......@@ -2,7 +2,7 @@
"name": "QmsPlugin",
"version": "0.1.0",
"description": "defect management QMS plugin",
"main": "./lib/module/index.js",
"main": "./src/index.tsx",
"types": "./lib/typescript/src/index.d.ts",
"exports": {
".": {
......
import { TurboModuleRegistry, type TurboModule } from 'react-native';
export interface Spec extends TurboModule {
// multiply(a: number, b: number): number;
// sum(a: number, b: number): number;
multiply(a: number, b: number): number;
sum(a: number, b: number): number;
showPluginUI(): void;
}
......
import QmsPlugin from './NativeQmsPlugin';
// export function multiply(a: number, b: number): number {
// return QmsPlugin.multiply(a, b);
// }
export function multiply(a: number, b: number): number {
return QmsPlugin.multiply(a, b);
}
// export function sum(a: number, b: number): number {
// return QmsPlugin.sum(a, b);
// }
export function sum(a: number, b: number): number {
return QmsPlugin.sum(a, b);
}
export function showPluginUI(): void {
QmsPlugin.showPluginUI();
}
export default {
// multiply,
// sum,
multiply,
sum,
showPluginUI,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment