@capgo/capacitor-realtimekit 7.0.0

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.
@@ -0,0 +1,20 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = 'CapgoCapacitorRealtimekit'
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.license = package['license']
10
+ s.homepage = package['repository']['url']
11
+ s.author = package['author']
12
+ s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
+ s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
+ s.ios.deployment_target = '14.0'
15
+ s.dependency 'Capacitor'
16
+ s.swift_version = '5.1'
17
+
18
+ # Cloudflare RealtimeKit SDK - Note: This requires adding the podspec repo
19
+ # pod 'RealtimeKitCore', :git => 'https://github.com/dyte-in/RealtimeKitCoreiOS.git'
20
+ end
package/Package.swift ADDED
@@ -0,0 +1,30 @@
1
+ // swift-tools-version: 5.9
2
+ import PackageDescription
3
+
4
+ let package = Package(
5
+ name: "CapgoCapacitorRealtimekit",
6
+ platforms: [.iOS(.v14)],
7
+ products: [
8
+ .library(
9
+ name: "CapgoCapacitorRealtimekit",
10
+ targets: ["CapacitorRealtimekitPlugin"])
11
+ ],
12
+ dependencies: [
13
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0"),
14
+ .package(url: "https://github.com/dyte-in/RealtimeKitCoreiOS.git", from: "1.0.0")
15
+ ],
16
+ targets: [
17
+ .target(
18
+ name: "CapacitorRealtimekitPlugin",
19
+ dependencies: [
20
+ .product(name: "Capacitor", package: "capacitor-swift-pm"),
21
+ .product(name: "Cordova", package: "capacitor-swift-pm"),
22
+ .product(name: "RealtimeKit", package: "RealtimeKitCoreiOS")
23
+ ],
24
+ path: "ios/Sources/CapacitorRealtimekitPlugin"),
25
+ .testTarget(
26
+ name: "CapacitorRealtimekitPluginTests",
27
+ dependencies: ["CapacitorRealtimekitPlugin"],
28
+ path: "ios/Tests/CapacitorRealtimekitPluginTests")
29
+ ]
30
+ )
package/README.md ADDED
@@ -0,0 +1,159 @@
1
+ # capacitor-realtimekit
2
+ <a href="https://capgo.app/"><img src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/></a>
3
+
4
+ <div align="center">
5
+ <h2><a href="https://capgo.app/?ref=plugin"> ➡️ Get Instant updates for your App with Capgo</a></h2>
6
+ <h2><a href="https://capgo.app/consulting/?ref=plugin"> Missing a feature? We'll build the plugin for you 💪</a></h2>
7
+ </div>
8
+
9
+ Cloudflare Calls integration for Capacitor apps with built-in UI for meetings.
10
+
11
+ ## Documentation
12
+
13
+ The most complete doc is available here: https://capgo.app/docs/plugins/realtimekit/
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ npm install @capgo/capacitor-realtimekit
19
+ npx cap sync
20
+ ```
21
+
22
+ ## Dependencies
23
+
24
+ This plugin uses the Cloudflare RealtimeKit SDK:
25
+
26
+ - **iOS**: [RealtimeKitCoreiOS](https://github.com/dyte-in/RealtimeKitCoreiOS) (automatically installed via Swift Package Manager)
27
+ - **Android**: `com.cloudflare.realtimekit:ui-android` version `0.2.2` (can be customized via gradle variable `realtimekitUiVersion`)
28
+
29
+ ### Customizing Android RealtimeKit Version
30
+
31
+ In your app's `build.gradle`:
32
+
33
+ ```gradle
34
+ buildscript {
35
+ ext {
36
+ realtimekitUiVersion = '0.2.2' // or your desired version
37
+ }
38
+ }
39
+ ```
40
+
41
+ ## Platform Support
42
+
43
+ - **iOS**: ✅ Supported (iOS 14.0+)
44
+ - **Android**: ✅ Supported (API 24+)
45
+ - **Web**: ❌ Not supported (native only)
46
+
47
+ ## iOS Configuration
48
+
49
+ Add the following to your app's `Info.plist` file:
50
+
51
+ ```xml
52
+ <key>NSCameraUsageDescription</key>
53
+ <string>We need camera access for video calls</string>
54
+ <key>NSMicrophoneUsageDescription</key>
55
+ <string>We need microphone access for audio calls</string>
56
+ <key>NSPhotoLibraryUsageDescription</key>
57
+ <string>We need photo library access to share images</string>
58
+ <key>NSBluetoothPeripheralUsageDescription</key>
59
+ <string>We need Bluetooth access for audio routing</string>
60
+
61
+ <key>UIBackgroundModes</key>
62
+ <array>
63
+ <string>audio</string>
64
+ <string>voip</string>
65
+ <string>fetch</string>
66
+ <string>remote-notification</string>
67
+ </array>
68
+ ```
69
+
70
+ ## Android Configuration
71
+
72
+ Add the following permissions to your app's `AndroidManifest.xml` file:
73
+
74
+ ```xml
75
+ <uses-permission android:name="android.permission.CAMERA" />
76
+ <uses-permission android:name="android.permission.RECORD_AUDIO" />
77
+ <uses-permission android:name="android.permission.INTERNET" />
78
+ <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
79
+
80
+ <uses-feature android:name="android.hardware.camera" android:required="false" />
81
+ <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
82
+ ```
83
+
84
+ ## API
85
+
86
+ <docgen-index>
87
+
88
+ * [`initialize()`](#initialize)
89
+ * [`startMeeting(...)`](#startmeeting)
90
+ * [`getPluginVersion()`](#getpluginversion)
91
+ * [Interfaces](#interfaces)
92
+
93
+ </docgen-index>
94
+
95
+ <docgen-api>
96
+ <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
97
+
98
+ Capacitor RealtimeKit Plugin for Cloudflare Calls integration.
99
+
100
+ ### initialize()
101
+
102
+ ```typescript
103
+ initialize() => Promise<void>
104
+ ```
105
+
106
+ Initializes the RealtimeKit plugin before using other methods.
107
+
108
+ **Since:** 7.0.0
109
+
110
+ --------------------
111
+
112
+
113
+ ### startMeeting(...)
114
+
115
+ ```typescript
116
+ startMeeting(options: StartMeetingOptions) => Promise<void>
117
+ ```
118
+
119
+ Start a meeting using the built-in UI.
120
+ Only available on Android and iOS.
121
+
122
+ | Param | Type | Description |
123
+ | ------------- | ------------------------------------------------------------------- | --------------------------------------- |
124
+ | **`options`** | <code><a href="#startmeetingoptions">StartMeetingOptions</a></code> | - Configuration options for the meeting |
125
+
126
+ **Since:** 7.0.0
127
+
128
+ --------------------
129
+
130
+
131
+ ### getPluginVersion()
132
+
133
+ ```typescript
134
+ getPluginVersion() => Promise<{ version: string; }>
135
+ ```
136
+
137
+ Get the native Capacitor plugin version.
138
+
139
+ **Returns:** <code>Promise&lt;{ version: string; }&gt;</code>
140
+
141
+ **Since:** 7.0.0
142
+
143
+ --------------------
144
+
145
+
146
+ ### Interfaces
147
+
148
+
149
+ #### StartMeetingOptions
150
+
151
+ Configuration options for starting a meeting.
152
+
153
+ | Prop | Type | Description | Default | Since |
154
+ | ----------------- | -------------------- | ------------------------------------------------------------------------------------------------------ | ----------------- | ----- |
155
+ | **`authToken`** | <code>string</code> | Authentication token for the participant. This token is required to join the Cloudflare Calls meeting. | | 7.0.0 |
156
+ | **`enableAudio`** | <code>boolean</code> | Whether to join with audio enabled. Default is true. | <code>true</code> | 7.0.0 |
157
+ | **`enableVideo`** | <code>boolean</code> | Whether to join with video enabled. Default is true. | <code>true</code> | 7.0.0 |
158
+
159
+ </docgen-api>
@@ -0,0 +1,64 @@
1
+ ext {
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
4
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
5
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
6
+ realtimekitUiVersion = project.hasProperty('realtimekitUiVersion') ? rootProject.ext.realtimekitUiVersion : '0.2.2'
7
+ }
8
+
9
+ buildscript {
10
+ repositories {
11
+ mavenCentral()
12
+ google()
13
+ }
14
+ dependencies {
15
+ classpath 'com.android.tools.build:gradle:8.7.2'
16
+ }
17
+ }
18
+
19
+ apply plugin: 'com.android.library'
20
+
21
+ android {
22
+ namespace "ee.forgr.plugin.capacitor_realtimekit"
23
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
24
+ defaultConfig {
25
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
26
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
27
+ versionCode 1
28
+ versionName "1.0"
29
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
30
+ }
31
+ buildTypes {
32
+ release {
33
+ minifyEnabled false
34
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
35
+ }
36
+ }
37
+ lintOptions {
38
+ abortOnError false
39
+ }
40
+ compileOptions {
41
+ sourceCompatibility JavaVersion.VERSION_21
42
+ targetCompatibility JavaVersion.VERSION_21
43
+ }
44
+ }
45
+
46
+ repositories {
47
+ google()
48
+ jcenter()
49
+ mavenCentral()
50
+ }
51
+
52
+
53
+ dependencies {
54
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
55
+ implementation project(':capacitor-android')
56
+ implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
57
+
58
+ // Cloudflare RealtimeKit SDK
59
+ implementation "com.cloudflare.realtimekit:ui-android:$realtimekitUiVersion"
60
+
61
+ testImplementation "junit:junit:$junitVersion"
62
+ androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
63
+ androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
64
+ }
@@ -0,0 +1,3 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ >
3
+ </manifest>
@@ -0,0 +1,82 @@
1
+ package ee.forgr.plugin.capacitor_realtimekit;
2
+
3
+ import android.Manifest;
4
+ import android.util.Log;
5
+ import com.getcapacitor.JSObject;
6
+ import com.getcapacitor.Plugin;
7
+ import com.getcapacitor.PluginCall;
8
+ import com.getcapacitor.PluginMethod;
9
+ import com.getcapacitor.annotation.CapacitorPlugin;
10
+ import com.getcapacitor.annotation.Permission;
11
+
12
+ @CapacitorPlugin(
13
+ name = "CapacitorRealtimekit",
14
+ permissions = {
15
+ @Permission(alias = "camera", strings = { Manifest.permission.CAMERA }),
16
+ @Permission(alias = "microphone", strings = { Manifest.permission.RECORD_AUDIO })
17
+ }
18
+ )
19
+ public class CapacitorRealtimekitPlugin extends Plugin {
20
+
21
+ private static final String TAG = "RealtimekitPlugin";
22
+ private final String PLUGIN_VERSION = "7.0.0";
23
+ private boolean isInitialized = false;
24
+
25
+ @Override
26
+ public void load() {
27
+ super.load();
28
+ Log.d(TAG, "RealtimeKit plugin loaded");
29
+ }
30
+
31
+ @PluginMethod
32
+ public void initialize(PluginCall call) {
33
+ // Initialize the RealtimeKit SDK
34
+ // TODO: Add Cloudflare RealtimeKit SDK initialization here
35
+ isInitialized = true;
36
+ Log.d(TAG, "RealtimeKit initialized");
37
+ call.resolve();
38
+ }
39
+
40
+ @PluginMethod
41
+ public void startMeeting(PluginCall call) {
42
+ if (!isInitialized) {
43
+ call.reject("RealtimeKit not initialized. Call initialize() first.");
44
+ return;
45
+ }
46
+
47
+ String authToken = call.getString("authToken");
48
+ if (authToken == null || authToken.isEmpty()) {
49
+ call.reject("authToken is required");
50
+ return;
51
+ }
52
+
53
+ Boolean enableAudio = call.getBoolean("enableAudio", true);
54
+ Boolean enableVideo = call.getBoolean("enableVideo", true);
55
+
56
+ // Start meeting with the built-in UI
57
+ // TODO: Integrate with Cloudflare RealtimeKit SDK to launch meeting UI
58
+ // In a real implementation, this would:
59
+ // 1. Create and configure the RealtimeKit meeting activity/fragment
60
+ // 2. Set the auth token, audio, and video settings
61
+ // 3. Launch the meeting UI
62
+
63
+ Log.d(TAG, "Starting meeting with authToken: " + authToken);
64
+ Log.d(TAG, "Audio enabled: " + enableAudio);
65
+ Log.d(TAG, "Video enabled: " + enableVideo);
66
+
67
+ // For now, just resolve successfully
68
+ // Real implementation would launch the meeting UI here
69
+ call.resolve();
70
+ }
71
+
72
+ @PluginMethod
73
+ public void getPluginVersion(final PluginCall call) {
74
+ try {
75
+ final JSObject ret = new JSObject();
76
+ ret.put("version", this.PLUGIN_VERSION);
77
+ call.resolve(ret);
78
+ } catch (final Exception e) {
79
+ call.reject("Could not get plugin version", e);
80
+ }
81
+ }
82
+ }
File without changes
package/dist/docs.json ADDED
@@ -0,0 +1,172 @@
1
+ {
2
+ "api": {
3
+ "name": "CapacitorRealtimekitPlugin",
4
+ "slug": "capacitorrealtimekitplugin",
5
+ "docs": "Capacitor RealtimeKit Plugin for Cloudflare Calls integration.",
6
+ "tags": [
7
+ {
8
+ "text": "7.0.0",
9
+ "name": "since"
10
+ }
11
+ ],
12
+ "methods": [
13
+ {
14
+ "name": "initialize",
15
+ "signature": "() => Promise<void>",
16
+ "parameters": [],
17
+ "returns": "Promise<void>",
18
+ "tags": [
19
+ {
20
+ "name": "returns",
21
+ "text": "Promise that resolves when initialization is complete"
22
+ },
23
+ {
24
+ "name": "throws",
25
+ "text": "Error if initialization fails"
26
+ },
27
+ {
28
+ "name": "since",
29
+ "text": "7.0.0"
30
+ },
31
+ {
32
+ "name": "example",
33
+ "text": "```typescript\nawait CapacitorRealtimekit.initialize();\n```"
34
+ }
35
+ ],
36
+ "docs": "Initializes the RealtimeKit plugin before using other methods.",
37
+ "complexTypes": [],
38
+ "slug": "initialize"
39
+ },
40
+ {
41
+ "name": "startMeeting",
42
+ "signature": "(options: StartMeetingOptions) => Promise<void>",
43
+ "parameters": [
44
+ {
45
+ "name": "options",
46
+ "docs": "- Configuration options for the meeting",
47
+ "type": "StartMeetingOptions"
48
+ }
49
+ ],
50
+ "returns": "Promise<void>",
51
+ "tags": [
52
+ {
53
+ "name": "param",
54
+ "text": "options - Configuration options for the meeting"
55
+ },
56
+ {
57
+ "name": "returns",
58
+ "text": "Promise that resolves when the meeting UI is launched"
59
+ },
60
+ {
61
+ "name": "throws",
62
+ "text": "Error if the platform is not supported or if starting the meeting fails"
63
+ },
64
+ {
65
+ "name": "since",
66
+ "text": "7.0.0"
67
+ },
68
+ {
69
+ "name": "example",
70
+ "text": "```typescript\nawait CapacitorRealtimekit.startMeeting({\n authToken: 'your-auth-token',\n enableAudio: true,\n enableVideo: true,\n});\n```"
71
+ }
72
+ ],
73
+ "docs": "Start a meeting using the built-in UI.\nOnly available on Android and iOS.",
74
+ "complexTypes": [
75
+ "StartMeetingOptions"
76
+ ],
77
+ "slug": "startmeeting"
78
+ },
79
+ {
80
+ "name": "getPluginVersion",
81
+ "signature": "() => Promise<{ version: string; }>",
82
+ "parameters": [],
83
+ "returns": "Promise<{ version: string; }>",
84
+ "tags": [
85
+ {
86
+ "name": "returns",
87
+ "text": "Promise that resolves with the plugin version"
88
+ },
89
+ {
90
+ "name": "throws",
91
+ "text": "Error if getting the version fails"
92
+ },
93
+ {
94
+ "name": "since",
95
+ "text": "7.0.0"
96
+ },
97
+ {
98
+ "name": "example",
99
+ "text": "```typescript\nconst { version } = await CapacitorRealtimekit.getPluginVersion();\nconsole.log('Plugin version:', version);\n```"
100
+ }
101
+ ],
102
+ "docs": "Get the native Capacitor plugin version.",
103
+ "complexTypes": [],
104
+ "slug": "getpluginversion"
105
+ }
106
+ ],
107
+ "properties": []
108
+ },
109
+ "interfaces": [
110
+ {
111
+ "name": "StartMeetingOptions",
112
+ "slug": "startmeetingoptions",
113
+ "docs": "Configuration options for starting a meeting.",
114
+ "tags": [
115
+ {
116
+ "text": "0.0.1",
117
+ "name": "since"
118
+ }
119
+ ],
120
+ "methods": [],
121
+ "properties": [
122
+ {
123
+ "name": "authToken",
124
+ "tags": [
125
+ {
126
+ "text": "7.0.0",
127
+ "name": "since"
128
+ }
129
+ ],
130
+ "docs": "Authentication token for the participant.\nThis token is required to join the Cloudflare Calls meeting.",
131
+ "complexTypes": [],
132
+ "type": "string"
133
+ },
134
+ {
135
+ "name": "enableAudio",
136
+ "tags": [
137
+ {
138
+ "text": "true",
139
+ "name": "default"
140
+ },
141
+ {
142
+ "text": "7.0.0",
143
+ "name": "since"
144
+ }
145
+ ],
146
+ "docs": "Whether to join with audio enabled.\nDefault is true.",
147
+ "complexTypes": [],
148
+ "type": "boolean | undefined"
149
+ },
150
+ {
151
+ "name": "enableVideo",
152
+ "tags": [
153
+ {
154
+ "text": "true",
155
+ "name": "default"
156
+ },
157
+ {
158
+ "text": "7.0.0",
159
+ "name": "since"
160
+ }
161
+ ],
162
+ "docs": "Whether to join with video enabled.\nDefault is true.",
163
+ "complexTypes": [],
164
+ "type": "boolean | undefined"
165
+ }
166
+ ]
167
+ }
168
+ ],
169
+ "enums": [],
170
+ "typeAliases": [],
171
+ "pluginConfigs": []
172
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Capacitor RealtimeKit Plugin for Cloudflare Calls integration.
3
+ *
4
+ * @since 7.0.0
5
+ */
6
+ export interface CapacitorRealtimekitPlugin {
7
+ /**
8
+ * Initializes the RealtimeKit plugin before using other methods.
9
+ *
10
+ * @returns Promise that resolves when initialization is complete
11
+ * @throws Error if initialization fails
12
+ * @since 7.0.0
13
+ * @example
14
+ * ```typescript
15
+ * await CapacitorRealtimekit.initialize();
16
+ * ```
17
+ */
18
+ initialize(): Promise<void>;
19
+ /**
20
+ * Start a meeting using the built-in UI.
21
+ * Only available on Android and iOS.
22
+ *
23
+ * @param options - Configuration options for the meeting
24
+ * @returns Promise that resolves when the meeting UI is launched
25
+ * @throws Error if the platform is not supported or if starting the meeting fails
26
+ * @since 7.0.0
27
+ * @example
28
+ * ```typescript
29
+ * await CapacitorRealtimekit.startMeeting({
30
+ * authToken: 'your-auth-token',
31
+ * enableAudio: true,
32
+ * enableVideo: true,
33
+ * });
34
+ * ```
35
+ */
36
+ startMeeting(options: StartMeetingOptions): Promise<void>;
37
+ /**
38
+ * Get the native Capacitor plugin version.
39
+ *
40
+ * @returns Promise that resolves with the plugin version
41
+ * @throws Error if getting the version fails
42
+ * @since 7.0.0
43
+ * @example
44
+ * ```typescript
45
+ * const { version } = await CapacitorRealtimekit.getPluginVersion();
46
+ * console.log('Plugin version:', version);
47
+ * ```
48
+ */
49
+ getPluginVersion(): Promise<{
50
+ version: string;
51
+ }>;
52
+ }
53
+ /**
54
+ * Configuration options for starting a meeting.
55
+ *
56
+ * @since 0.0.1
57
+ */
58
+ export interface StartMeetingOptions {
59
+ /**
60
+ * Authentication token for the participant.
61
+ * This token is required to join the Cloudflare Calls meeting.
62
+ *
63
+ * @since 7.0.0
64
+ */
65
+ authToken: string;
66
+ /**
67
+ * Whether to join with audio enabled.
68
+ * Default is true.
69
+ *
70
+ * @default true
71
+ * @since 7.0.0
72
+ */
73
+ enableAudio?: boolean;
74
+ /**
75
+ * Whether to join with video enabled.
76
+ * Default is true.
77
+ *
78
+ * @default true
79
+ * @since 7.0.0
80
+ */
81
+ enableVideo?: boolean;
82
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { CapacitorRealtimekitPlugin } from './definitions';
2
+ declare const CapacitorRealtimekit: CapacitorRealtimekitPlugin;
3
+ export * from './definitions';
4
+ export { CapacitorRealtimekit };
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const CapacitorRealtimekit = registerPlugin('CapacitorRealtimekit', {
3
+ web: () => import('./web').then((m) => new m.CapacitorRealtimekitWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { CapacitorRealtimekit };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,oBAAoB,GAAG,cAAc,CAA6B,sBAAsB,EAAE;IAC9F,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;CACxE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { CapacitorRealtimekitPlugin, StartMeetingOptions } from './definitions';
3
+ export declare class CapacitorRealtimekitWeb extends WebPlugin implements CapacitorRealtimekitPlugin {
4
+ initialize(): Promise<void>;
5
+ startMeeting(_options: StartMeetingOptions): Promise<void>;
6
+ getPluginVersion(): Promise<{
7
+ version: string;
8
+ }>;
9
+ }
@@ -0,0 +1,14 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ export class CapacitorRealtimekitWeb extends WebPlugin {
3
+ async initialize() {
4
+ throw new Error('RealtimeKit is not supported on web platform.');
5
+ }
6
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
7
+ async startMeeting(_options) {
8
+ throw new Error('RealtimeKit is not supported on web platform. Use native iOS or Android.');
9
+ }
10
+ async getPluginVersion() {
11
+ return { version: 'web' };
12
+ }
13
+ }
14
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,uBAAwB,SAAQ,SAAS;IACpD,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,YAAY,CAAC,QAA6B;QAC9C,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;IAC9F,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var core = require('@capacitor/core');
4
+
5
+ const CapacitorRealtimekit = core.registerPlugin('CapacitorRealtimekit', {
6
+ web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorRealtimekitWeb()),
7
+ });
8
+
9
+ class CapacitorRealtimekitWeb extends core.WebPlugin {
10
+ async initialize() {
11
+ throw new Error('RealtimeKit is not supported on web platform.');
12
+ }
13
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
14
+ async startMeeting(_options) {
15
+ throw new Error('RealtimeKit is not supported on web platform. Use native iOS or Android.');
16
+ }
17
+ async getPluginVersion() {
18
+ return { version: 'web' };
19
+ }
20
+ }
21
+
22
+ var web = /*#__PURE__*/Object.freeze({
23
+ __proto__: null,
24
+ CapacitorRealtimekitWeb: CapacitorRealtimekitWeb
25
+ });
26
+
27
+ exports.CapacitorRealtimekit = CapacitorRealtimekit;
28
+ //# sourceMappingURL=plugin.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorRealtimekit = registerPlugin('CapacitorRealtimekit', {\n web: () => import('./web').then((m) => new m.CapacitorRealtimekitWeb()),\n});\nexport * from './definitions';\nexport { CapacitorRealtimekit };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorRealtimekitWeb extends WebPlugin {\n async initialize() {\n throw new Error('RealtimeKit is not supported on web platform.');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async startMeeting(_options) {\n throw new Error('RealtimeKit is not supported on web platform. Use native iOS or Android.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,oBAAoB,GAAGA,mBAAc,CAAC,sBAAsB,EAAE;AACpE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;AAC3E,CAAC;;ACFM,MAAM,uBAAuB,SAASC,cAAS,CAAC;AACvD,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC;AACxE,IAAI;AACJ;AACA,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;AACjC,QAAQ,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC;AACnG,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js ADDED
@@ -0,0 +1,31 @@
1
+ var capacitorCapacitorFlash = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ const CapacitorRealtimekit = core.registerPlugin('CapacitorRealtimekit', {
5
+ web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.CapacitorRealtimekitWeb()),
6
+ });
7
+
8
+ class CapacitorRealtimekitWeb extends core.WebPlugin {
9
+ async initialize() {
10
+ throw new Error('RealtimeKit is not supported on web platform.');
11
+ }
12
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+ async startMeeting(_options) {
14
+ throw new Error('RealtimeKit is not supported on web platform. Use native iOS or Android.');
15
+ }
16
+ async getPluginVersion() {
17
+ return { version: 'web' };
18
+ }
19
+ }
20
+
21
+ var web = /*#__PURE__*/Object.freeze({
22
+ __proto__: null,
23
+ CapacitorRealtimekitWeb: CapacitorRealtimekitWeb
24
+ });
25
+
26
+ exports.CapacitorRealtimekit = CapacitorRealtimekit;
27
+
28
+ return exports;
29
+
30
+ })({}, capacitorExports);
31
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CapacitorRealtimekit = registerPlugin('CapacitorRealtimekit', {\n web: () => import('./web').then((m) => new m.CapacitorRealtimekitWeb()),\n});\nexport * from './definitions';\nexport { CapacitorRealtimekit };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CapacitorRealtimekitWeb extends WebPlugin {\n async initialize() {\n throw new Error('RealtimeKit is not supported on web platform.');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async startMeeting(_options) {\n throw new Error('RealtimeKit is not supported on web platform. Use native iOS or Android.');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,oBAAoB,GAAGA,mBAAc,CAAC,sBAAsB,EAAE;IACpE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,uBAAuB,EAAE,CAAC;IAC3E,CAAC;;ICFM,MAAM,uBAAuB,SAASC,cAAS,CAAC;IACvD,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC;IACxE,IAAI;IACJ;IACA,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE;IACjC,QAAQ,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC;IACnG,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
@@ -0,0 +1,48 @@
1
+ import Foundation
2
+ import UIKit
3
+
4
+ public class CapacitorRealtimekit: NSObject {
5
+ private var isInitialized = false
6
+
7
+ public func initialize() {
8
+ // Initialize the RealtimeKit SDK
9
+ // TODO: Add Cloudflare RealtimeKit SDK initialization here
10
+ isInitialized = true
11
+ print("RealtimeKit initialized")
12
+ }
13
+
14
+ public func startMeeting(
15
+ authToken: String,
16
+ enableAudio: Bool,
17
+ enableVideo: Bool,
18
+ completion: @escaping (Error?) -> Void
19
+ ) {
20
+ guard isInitialized else {
21
+ let error = NSError(
22
+ domain: "CapacitorRealtimekit",
23
+ code: -1,
24
+ userInfo: [NSLocalizedDescriptionKey: "RealtimeKit not initialized. Call initialize() first."]
25
+ )
26
+ completion(error)
27
+ return
28
+ }
29
+
30
+ // Start meeting with the built-in UI
31
+ // TODO: Integrate with Cloudflare RealtimeKit SDK to launch meeting UI
32
+ DispatchQueue.main.async {
33
+ // Placeholder implementation
34
+ // In a real implementation, this would:
35
+ // 1. Create and configure the RealtimeKit meeting view controller
36
+ // 2. Set the auth token, audio, and video settings
37
+ // 3. Present the meeting UI modally
38
+
39
+ print("Starting meeting with authToken: \(authToken)")
40
+ print("Audio enabled: \(enableAudio)")
41
+ print("Video enabled: \(enableVideo)")
42
+
43
+ // For now, just complete successfully
44
+ // Real implementation would present the meeting UI here
45
+ completion(nil)
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,52 @@
1
+ import Foundation
2
+ import Capacitor
3
+
4
+ /**
5
+ * Please read the Capacitor iOS Plugin Development Guide
6
+ * here: https://capacitorjs.com/docs/plugins/ios
7
+ */
8
+ @objc(CapacitorRealtimekitPlugin)
9
+ public class CapacitorRealtimekitPlugin: CAPPlugin, CAPBridgedPlugin {
10
+ private let PLUGIN_VERSION: String = "7.0.0"
11
+ public let identifier = "CapacitorRealtimekitPlugin"
12
+ public let jsName = "CapacitorRealtimekit"
13
+ public let pluginMethods: [CAPPluginMethod] = [
14
+ CAPPluginMethod(name: "initialize", returnType: CAPPluginReturnPromise),
15
+ CAPPluginMethod(name: "startMeeting", returnType: CAPPluginReturnPromise),
16
+ CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise)
17
+ ]
18
+
19
+ private let implementation = CapacitorRealtimekit()
20
+
21
+ @objc func initialize(_ call: CAPPluginCall) {
22
+ implementation.initialize()
23
+ call.resolve()
24
+ }
25
+
26
+ @objc func startMeeting(_ call: CAPPluginCall) {
27
+ guard let authToken = call.getString("authToken") else {
28
+ call.reject("authToken is required")
29
+ return
30
+ }
31
+
32
+ let enableAudio = call.getBool("enableAudio") ?? true
33
+ let enableVideo = call.getBool("enableVideo") ?? true
34
+
35
+ implementation.startMeeting(
36
+ authToken: authToken,
37
+ enableAudio: enableAudio,
38
+ enableVideo: enableVideo
39
+ ) { error in
40
+ if let error = error {
41
+ call.reject("Failed to start meeting", error.localizedDescription)
42
+ } else {
43
+ call.resolve()
44
+ }
45
+ }
46
+ }
47
+
48
+ @objc func getPluginVersion(_ call: CAPPluginCall) {
49
+ call.resolve(["version": self.PLUGIN_VERSION])
50
+ }
51
+
52
+ }
@@ -0,0 +1,13 @@
1
+ import XCTest
2
+ @testable import CapacitorFlashPlugin
3
+
4
+ class CapacitorFlashTests: XCTestCase {
5
+ func testEcho() {
6
+ // Ensure the basic API wiring still works.
7
+ let implementation = CapacitorFlash()
8
+ let value = "Hello, World!"
9
+ let result = implementation.echo(value)
10
+
11
+ XCTAssertEqual(value, result)
12
+ }
13
+ }
package/package.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "@capgo/capacitor-realtimekit",
3
+ "version": "7.0.0",
4
+ "description": "Cloudflare Calls integration for Capacitor apps with built-in UI for meetings.",
5
+ "main": "dist/plugin.cjs.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/esm/index.d.ts",
8
+ "unpkg": "dist/plugin.js",
9
+ "files": [
10
+ "android/src/main/",
11
+ "android/build.gradle",
12
+ "dist/",
13
+ "ios/Sources",
14
+ "ios/Tests",
15
+ "Package.swift",
16
+ "CapgoCapacitorRealtimekit.podspec"
17
+ ],
18
+ "author": "Martin Donadieu <martin@capgo.app>",
19
+ "license": "MIT",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/Cap-go/capacitor-realtimekit.git"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/Cap-go/capacitor-realtimekit/issues"
26
+ },
27
+ "keywords": [
28
+ "capacitor",
29
+ "realtimekit",
30
+ "cloudflare",
31
+ "calls",
32
+ "video",
33
+ "meeting",
34
+ "webrtc",
35
+ "plugin",
36
+ "native"
37
+ ],
38
+ "scripts": {
39
+ "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
40
+ "verify:ios": "xcodebuild -scheme CapgoCapacitorRealtimekit -destination generic/platform=iOS",
41
+ "verify:android": "cd android && ./gradlew clean build test && cd ..",
42
+ "verify:web": "npm run build",
43
+ "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
44
+ "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
45
+ "eslint": "eslint .",
46
+ "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
47
+ "swiftlint": "node-swiftlint",
48
+ "docgen": "docgen --api CapacitorRealtimekitPlugin --output-readme README.md --output-json dist/docs.json",
49
+ "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
50
+ "clean": "rimraf ./dist",
51
+ "watch": "tsc --watch",
52
+ "prepublishOnly": "npm run build"
53
+ },
54
+ "devDependencies": {
55
+ "@capacitor/android": "^7.0.0",
56
+ "@capacitor/cli": "^7.0.0",
57
+ "@capacitor/core": "^7.0.0",
58
+ "@capacitor/docgen": "^0.3.0",
59
+ "@capacitor/ios": "^7.0.0",
60
+ "@ionic/eslint-config": "^0.4.0",
61
+ "@ionic/prettier-config": "^4.0.0",
62
+ "@ionic/swiftlint-config": "^2.0.0",
63
+ "@types/node": "^22.13.1",
64
+ "eslint": "^8.57.0",
65
+ "eslint-plugin-import": "^2.31.0",
66
+ "husky": "^9.1.7",
67
+ "prettier": "^3.4.2",
68
+ "prettier-plugin-java": "^2.6.7",
69
+ "rimraf": "^6.0.1",
70
+ "rollup": "^4.34.6",
71
+ "swiftlint": "^2.0.0",
72
+ "typescript": "^5.7.3"
73
+ },
74
+ "peerDependencies": {
75
+ "@capacitor/core": ">=7.0.0"
76
+ },
77
+ "eslintConfig": {
78
+ "extends": "@ionic/eslint-config/recommended"
79
+ },
80
+ "prettier": "@ionic/prettier-config",
81
+ "swiftlint": "@ionic/swiftlint-config",
82
+ "capacitor": {
83
+ "ios": {
84
+ "src": "ios"
85
+ },
86
+ "android": {
87
+ "src": "android"
88
+ }
89
+ }
90
+ }