32 lines
625 B
Swift
32 lines
625 B
Swift
|
//
|
||
|
// TestingService.swift
|
||
|
// RNPlayground
|
||
|
//
|
||
|
// Created by Artur Gurgul on 03/08/2025.
|
||
|
//
|
||
|
|
||
|
import Foundation
|
||
|
import React
|
||
|
|
||
|
@objc(TestingServiceModule)
|
||
|
class TestingServiceModule: NSObject {
|
||
|
|
||
|
@objc
|
||
|
func greet(_ name: String,
|
||
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
||
|
rejecter reject: @escaping RCTPromiseRejectBlock) {
|
||
|
let message = "Hello, \(name)! From Swift."
|
||
|
resolve(message)
|
||
|
}
|
||
|
|
||
|
@objc
|
||
|
func constantsToExport() -> [AnyHashable: Any]! {
|
||
|
return ["greeting": "Hello from Swift"]
|
||
|
}
|
||
|
|
||
|
@objc
|
||
|
static func requiresMainQueueSetup() -> Bool {
|
||
|
return false
|
||
|
}
|
||
|
}
|