@capgo/capacitor-watch 8.0.2
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.
- package/CapgoCapacitorWatch.podspec +17 -0
- package/LICENSE +373 -0
- package/Package.swift +28 -0
- package/README.md +848 -0
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/app/capgo/capacitor/watch/CapgoWatchPlugin.java +61 -0
- package/dist/docs.json +847 -0
- package/dist/esm/definitions.d.ts +371 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +12 -0
- package/dist/esm/web.js +28 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +42 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +45 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/CapgoWatchPlugin/CapgoWatchPlugin.swift +280 -0
- package/ios/Tests/CapgoWatchPluginTests/CapgoWatchPluginTests.swift +11 -0
- package/package.json +88 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
ext {
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
buildscript {
|
|
9
|
+
repositories {
|
|
10
|
+
google()
|
|
11
|
+
mavenCentral()
|
|
12
|
+
}
|
|
13
|
+
dependencies {
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.13.0'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
apply plugin: 'com.android.library'
|
|
19
|
+
|
|
20
|
+
android {
|
|
21
|
+
namespace = "app.capgo.capacitor.watch"
|
|
22
|
+
compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
23
|
+
defaultConfig {
|
|
24
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
|
|
26
|
+
versionCode 1
|
|
27
|
+
versionName "1.0"
|
|
28
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
29
|
+
}
|
|
30
|
+
buildTypes {
|
|
31
|
+
release {
|
|
32
|
+
minifyEnabled false
|
|
33
|
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
lintOptions {
|
|
37
|
+
abortOnError = false
|
|
38
|
+
}
|
|
39
|
+
compileOptions {
|
|
40
|
+
sourceCompatibility JavaVersion.VERSION_21
|
|
41
|
+
targetCompatibility JavaVersion.VERSION_21
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
repositories {
|
|
46
|
+
google()
|
|
47
|
+
mavenCentral()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
dependencies {
|
|
52
|
+
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
53
|
+
implementation project(':capacitor-android')
|
|
54
|
+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
55
|
+
testImplementation "junit:junit:$junitVersion"
|
|
56
|
+
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
57
|
+
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
58
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
package app.capgo.capacitor.watch;
|
|
2
|
+
|
|
3
|
+
import com.getcapacitor.JSObject;
|
|
4
|
+
import com.getcapacitor.Plugin;
|
|
5
|
+
import com.getcapacitor.PluginCall;
|
|
6
|
+
import com.getcapacitor.PluginMethod;
|
|
7
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Apple Watch communication plugin for Capacitor.
|
|
11
|
+
* This plugin only works on iOS - Android implementation provides stub methods
|
|
12
|
+
* that return appropriate error messages.
|
|
13
|
+
*/
|
|
14
|
+
@CapacitorPlugin(name = "CapgoWatch")
|
|
15
|
+
public class CapgoWatchPlugin extends Plugin {
|
|
16
|
+
|
|
17
|
+
private final String pluginVersion = "8.0.2";
|
|
18
|
+
private static final String NOT_SUPPORTED_MSG = "Apple Watch is only supported on iOS";
|
|
19
|
+
|
|
20
|
+
@PluginMethod
|
|
21
|
+
public void sendMessage(final PluginCall call) {
|
|
22
|
+
call.reject(NOT_SUPPORTED_MSG);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@PluginMethod
|
|
26
|
+
public void updateApplicationContext(final PluginCall call) {
|
|
27
|
+
call.reject(NOT_SUPPORTED_MSG);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@PluginMethod
|
|
31
|
+
public void transferUserInfo(final PluginCall call) {
|
|
32
|
+
call.reject(NOT_SUPPORTED_MSG);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@PluginMethod
|
|
36
|
+
public void replyToMessage(final PluginCall call) {
|
|
37
|
+
call.reject(NOT_SUPPORTED_MSG);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@PluginMethod
|
|
41
|
+
public void getInfo(final PluginCall call) {
|
|
42
|
+
final JSObject ret = new JSObject();
|
|
43
|
+
ret.put("isSupported", false);
|
|
44
|
+
ret.put("isPaired", false);
|
|
45
|
+
ret.put("isWatchAppInstalled", false);
|
|
46
|
+
ret.put("isReachable", false);
|
|
47
|
+
ret.put("activationState", 0);
|
|
48
|
+
call.resolve(ret);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@PluginMethod
|
|
52
|
+
public void getPluginVersion(final PluginCall call) {
|
|
53
|
+
try {
|
|
54
|
+
final JSObject ret = new JSObject();
|
|
55
|
+
ret.put("version", this.pluginVersion);
|
|
56
|
+
call.resolve(ret);
|
|
57
|
+
} catch (final Exception e) {
|
|
58
|
+
call.reject("Could not get plugin version", e);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|