capacitor-native-agent 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. package/CapacitorNativeAgent.podspec +28 -0
  2. package/Package.swift +35 -0
  3. package/android/src/main/java/com/t6x/plugins/nativeagent/NativeAgentPlugin.kt +1 -1
  4. package/android/src/main/jniLibs/arm64-v8a/libnative_agent_ffi.so +0 -0
  5. package/ios/Frameworks/NativeAgentFFI.xcframework/Info.plist +47 -0
  6. package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64/Headers/native_agent_ffi/module.modulemap +4 -0
  7. package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64/Headers/native_agent_ffi/native_agent_ffi.swift +2064 -0
  8. package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64/Headers/native_agent_ffi/native_agent_ffiFFI.h +994 -0
  9. package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64/libnative_agent_ffi.a +0 -0
  10. package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64-simulator/Headers/native_agent_ffi/module.modulemap +4 -0
  11. package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64-simulator/Headers/native_agent_ffi/native_agent_ffi.swift +2064 -0
  12. package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64-simulator/Headers/native_agent_ffi/native_agent_ffiFFI.h +994 -0
  13. package/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64-simulator/libnative_agent_ffi.a +0 -0
  14. package/ios/Sources/NativeAgentPlugin/Generated/native_agent_ffi.swift +2064 -0
  15. package/ios/Sources/NativeAgentPlugin/Generated/native_agent_ffiFFI.h +994 -0
  16. package/ios/Sources/NativeAgentPlugin/Generated/native_agent_ffiFFI.modulemap +4 -0
  17. package/ios/Sources/NativeAgentPlugin/NativeAgentPlugin.swift +648 -0
  18. package/package.json +8 -1
@@ -0,0 +1,28 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(File.dirname(__FILE__), 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = 'CapacitorNativeAgent'
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.license = package['license']
10
+ s.homepage = package['homepage'] || 'https://github.com/ArcadeLabsInc/capacitor-native-agent'
11
+ s.author = package['author'] || 'Techxagon'
12
+ s.source = { :git => 'https://github.com/ArcadeLabsInc/capacitor-native-agent.git', :tag => s.version.to_s }
13
+
14
+ s.source_files = 'ios/Sources/**/*.swift'
15
+ s.ios.deployment_target = '14.0'
16
+
17
+ s.dependency 'Capacitor'
18
+ s.swift_version = '5.9'
19
+
20
+ # Prebuilt Rust xcframework (static library)
21
+ s.vendored_frameworks = 'ios/Frameworks/NativeAgentFFI.xcframework'
22
+
23
+ # Expose the xcframework's C headers so the Swift compiler can `canImport(native_agent_ffiFFI)`
24
+ s.pod_target_xcconfig = {
25
+ 'OTHER_SWIFT_FLAGS[sdk=iphoneos*]' => '$(inherited) -Xcc -fmodule-map-file=${PODS_TARGET_SRCROOT}/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64/Headers/native_agent_ffiFFI.modulemap',
26
+ 'OTHER_SWIFT_FLAGS[sdk=iphonesimulator*]' => '$(inherited) -Xcc -fmodule-map-file=${PODS_TARGET_SRCROOT}/ios/Frameworks/NativeAgentFFI.xcframework/ios-arm64-simulator/Headers/native_agent_ffiFFI.modulemap',
27
+ }
28
+ end
package/Package.swift ADDED
@@ -0,0 +1,35 @@
1
+ // swift-tools-version: 5.9
2
+ import PackageDescription
3
+
4
+ let package = Package(
5
+ name: "CapacitorNativeAgent",
6
+ platforms: [.iOS(.v14)],
7
+ products: [
8
+ .library(
9
+ name: "CapacitorNativeAgent",
10
+ targets: ["NativeAgentPlugin"]
11
+ )
12
+ ],
13
+ dependencies: [
14
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
15
+ ],
16
+ targets: [
17
+ .binaryTarget(
18
+ name: "NativeAgentFFI",
19
+ path: "ios/Frameworks/NativeAgentFFI.xcframework"
20
+ ),
21
+ .target(
22
+ name: "NativeAgentPlugin",
23
+ dependencies: [
24
+ .product(name: "Capacitor", package: "capacitor-swift-pm"),
25
+ .product(name: "Cordova", package: "capacitor-swift-pm"),
26
+ "NativeAgentFFI"
27
+ ],
28
+ path: "ios/Sources/NativeAgentPlugin",
29
+ exclude: [
30
+ "Generated/native_agent_ffiFFI.modulemap",
31
+ "Generated/native_agent_ffiFFI.h"
32
+ ]
33
+ )
34
+ ]
35
+ )
@@ -23,7 +23,7 @@ class NativeAgentPlugin : Plugin() {
23
23
 
24
24
  // ── Helper: wrap common pattern ────────────────────────────────────
25
25
 
26
- private inline fun withHandle(call: PluginCall, block: (NativeAgentHandle) -> Unit) {
26
+ private fun withHandle(call: PluginCall, block: (NativeAgentHandle) -> Unit) {
27
27
  val h = handle ?: return call.reject("NativeAgent not initialized — call initialize() first")
28
28
  scope.launch {
29
29
  try {
@@ -0,0 +1,47 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>AvailableLibraries</key>
6
+ <array>
7
+ <dict>
8
+ <key>BinaryPath</key>
9
+ <string>libnative_agent_ffi.a</string>
10
+ <key>HeadersPath</key>
11
+ <string>Headers</string>
12
+ <key>LibraryIdentifier</key>
13
+ <string>ios-arm64-simulator</string>
14
+ <key>LibraryPath</key>
15
+ <string>libnative_agent_ffi.a</string>
16
+ <key>SupportedArchitectures</key>
17
+ <array>
18
+ <string>arm64</string>
19
+ </array>
20
+ <key>SupportedPlatform</key>
21
+ <string>ios</string>
22
+ <key>SupportedPlatformVariant</key>
23
+ <string>simulator</string>
24
+ </dict>
25
+ <dict>
26
+ <key>BinaryPath</key>
27
+ <string>libnative_agent_ffi.a</string>
28
+ <key>HeadersPath</key>
29
+ <string>Headers</string>
30
+ <key>LibraryIdentifier</key>
31
+ <string>ios-arm64</string>
32
+ <key>LibraryPath</key>
33
+ <string>libnative_agent_ffi.a</string>
34
+ <key>SupportedArchitectures</key>
35
+ <array>
36
+ <string>arm64</string>
37
+ </array>
38
+ <key>SupportedPlatform</key>
39
+ <string>ios</string>
40
+ </dict>
41
+ </array>
42
+ <key>CFBundlePackageType</key>
43
+ <string>XFWK</string>
44
+ <key>XCFrameworkFormatVersion</key>
45
+ <string>1.0</string>
46
+ </dict>
47
+ </plist>
@@ -0,0 +1,4 @@
1
+ module native_agent_ffiFFI {
2
+ header "native_agent_ffiFFI.h"
3
+ export *
4
+ }