feat(ios): create paywall api (#13602)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- New Features
- Introduced a new iOS Paywall plugin with a simple API to display a
paywall and receive a success response.
  - Added JavaScript wrapper and type definitions for easy integration.

- Refactor
  - Reorganized the iOS project structure for plugins.

- Chores
- Removed unused legacy iOS plugins to streamline the app and reduce
build complexity.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
EYHN
2025-09-18 03:47:28 +00:00
committed by GitHub
parent 34a3c83d84
commit 89646869e4
5 changed files with 48 additions and 62 deletions
@@ -0,0 +1,25 @@
import Capacitor
import Foundation
@objc(PayWallPlugin)
public class PayWallPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "PayWallPlugin"
public let jsName = "PayWall"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "showPayWall", returnType: CAPPluginReturnPromise),
]
@objc func showPayWall(_ call: CAPPluginCall) {
do {
let type = try call.getStringEnsure("type")
// TODO: Implement actual paywall logic here
// For now, just log the type and resolve
print("PayWall: Showing paywall of type: \(type)")
call.resolve(["success": true, "type": type])
} catch {
call.reject("Failed to show paywall", nil, error)
}
}
}