leap-capacitor 1.0.0 → 1.0.1
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/README.md +14 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/is/leap/capacitor/LeapPlugin.java +8 -0
- package/dist/docs.json +16 -0
- package/dist/esm/definitions.d.ts +3 -0
- package/dist/esm/definitions.js.map +1 -1
- package/ios/Plugin/LeapPlugin.m +1 -0
- package/ios/Plugin/LeapPlugin.swift +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ npx cap sync
|
|
|
21
21
|
* [`embedProject(...)`](#embedproject)
|
|
22
22
|
* [`offlineSync(...)`](#offlinesync)
|
|
23
23
|
* [`disable()`](#disable)
|
|
24
|
+
* [`setAppLocale(...)`](#setapplocale)
|
|
24
25
|
* [`addListener('leapCallbacks', ...)`](#addlistenerleapcallbacks)
|
|
25
26
|
* [`addListener('leapElementActionCallbacks', ...)`](#addlistenerleapelementactioncallbacks)
|
|
26
27
|
* [Interfaces](#interfaces)
|
|
@@ -130,6 +131,19 @@ disable() => Promise<void>
|
|
|
130
131
|
--------------------
|
|
131
132
|
|
|
132
133
|
|
|
134
|
+
### setAppLocale(...)
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
setAppLocale(options: { localeCode: string; }) => Promise<void>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
| Param | Type |
|
|
141
|
+
| ------------- | ------------------------------------ |
|
|
142
|
+
| **`options`** | <code>{ localeCode: string; }</code> |
|
|
143
|
+
|
|
144
|
+
--------------------
|
|
145
|
+
|
|
146
|
+
|
|
133
147
|
### addListener('leapCallbacks', ...)
|
|
134
148
|
|
|
135
149
|
```typescript
|
package/android/build.gradle
CHANGED
|
@@ -51,7 +51,7 @@ repositories {
|
|
|
51
51
|
dependencies {
|
|
52
52
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
53
53
|
implementation project(':capacitor-android')
|
|
54
|
-
implementation 'is.leap.android:sdk:1.5.
|
|
54
|
+
implementation 'is.leap.android:sdk:1.5.3'
|
|
55
55
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
56
56
|
testImplementation "junit:junit:$junitVersion"
|
|
57
57
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
@@ -57,6 +57,7 @@ public class LeapPlugin extends Plugin {
|
|
|
57
57
|
|
|
58
58
|
private static final String FORMAT_SDF = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
|
|
59
59
|
private static final String TIMEZONE_GMT = "GMT";
|
|
60
|
+
public static final String LOCALE_CODE = "localeCode";
|
|
60
61
|
|
|
61
62
|
public LeapPlugin() {
|
|
62
63
|
setLeapEventEmitter();
|
|
@@ -193,6 +194,13 @@ public class LeapPlugin extends Plugin {
|
|
|
193
194
|
Leap.disable();
|
|
194
195
|
}
|
|
195
196
|
|
|
197
|
+
@PluginMethod
|
|
198
|
+
public void setAppLocale(PluginCall call) {
|
|
199
|
+
String localeCode = call.getString(LOCALE_CODE);
|
|
200
|
+
Leap.setAppLocale(localeCode);
|
|
201
|
+
call.resolve();
|
|
202
|
+
}
|
|
203
|
+
|
|
196
204
|
public static Date getDate(String dateValue) {
|
|
197
205
|
SimpleDateFormat sdf = new SimpleDateFormat(FORMAT_SDF, Locale.ENGLISH);
|
|
198
206
|
sdf.setTimeZone(TimeZone.getTimeZone(TIMEZONE_GMT));
|
package/dist/docs.json
CHANGED
|
@@ -133,6 +133,22 @@
|
|
|
133
133
|
"complexTypes": [],
|
|
134
134
|
"slug": "disable"
|
|
135
135
|
},
|
|
136
|
+
{
|
|
137
|
+
"name": "setAppLocale",
|
|
138
|
+
"signature": "(options: { localeCode: string; }) => Promise<void>",
|
|
139
|
+
"parameters": [
|
|
140
|
+
{
|
|
141
|
+
"name": "options",
|
|
142
|
+
"docs": "",
|
|
143
|
+
"type": "{ localeCode: string; }"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"returns": "Promise<void>",
|
|
147
|
+
"tags": [],
|
|
148
|
+
"docs": "",
|
|
149
|
+
"complexTypes": [],
|
|
150
|
+
"slug": "setapplocale"
|
|
151
|
+
},
|
|
136
152
|
{
|
|
137
153
|
"name": "addListener",
|
|
138
154
|
"signature": "(eventName: 'leapCallbacks', listenerFunc: (event: LeapCallbacks) => void) => Promise<PluginListenerHandle> & PluginListenerHandle",
|
|
@@ -33,6 +33,9 @@ export interface LeapPluginInterface {
|
|
|
33
33
|
projectIds: Array<string>;
|
|
34
34
|
}): Promise<void>;
|
|
35
35
|
disable(): Promise<void>;
|
|
36
|
+
setAppLocale(options: {
|
|
37
|
+
localeCode: string;
|
|
38
|
+
}): Promise<void>;
|
|
36
39
|
addListener(eventName: 'leapCallbacks', listenerFunc: (event: LeapCallbacks) => void): Promise<PluginListenerHandle> & PluginListenerHandle;
|
|
37
40
|
addListener(eventName: 'leapElementActionCallbacks', listenerFunc: (event: LeapElementActionCallbacks) => void): Promise<PluginListenerHandle> & PluginListenerHandle;
|
|
38
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["\nimport type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface UserProperty {\n [key: string]: string | number\n}\n\nexport interface LeapCallbacks {\n [key: string]: string\n}\n\nexport interface LeapElementActionCallbacks {\n [key: string]: any\n}\n\nexport interface LeapPluginInterface {\n start(options: { apiKey: string }): Promise<void>;\n startWithProperties(options: { apiKey: string, properties: UserProperty }): Promise<void>;\n flushProperties(options: { properties: UserProperty }): Promise<void>;\n setUniqueUserId(options: { uniqueUserId: string }): Promise<void>;\n startProject(options: { projectId: string, resetProject?: boolean }): Promise<void>;\n embedProject(options: { projectId: string }): Promise<void>;\n offlineSync(options: { projectIds: Array<string> }): Promise<void>;\n disable(): Promise<void>;\n\n addListener(\n eventName: 'leapCallbacks',\n listenerFunc: (event: LeapCallbacks) => void,\n ): Promise<PluginListenerHandle> & PluginListenerHandle\n\n addListener(\n eventName: 'leapElementActionCallbacks',\n listenerFunc: (event: LeapElementActionCallbacks) => void,\n ): Promise<PluginListenerHandle> & PluginListenerHandle\n\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["\nimport type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface UserProperty {\n [key: string]: string | number\n}\n\nexport interface LeapCallbacks {\n [key: string]: string\n}\n\nexport interface LeapElementActionCallbacks {\n [key: string]: any\n}\n\nexport interface LeapPluginInterface {\n start(options: { apiKey: string }): Promise<void>;\n startWithProperties(options: { apiKey: string, properties: UserProperty }): Promise<void>;\n flushProperties(options: { properties: UserProperty }): Promise<void>;\n setUniqueUserId(options: { uniqueUserId: string }): Promise<void>;\n startProject(options: { projectId: string, resetProject?: boolean }): Promise<void>;\n embedProject(options: { projectId: string }): Promise<void>;\n offlineSync(options: { projectIds: Array<string> }): Promise<void>;\n disable(): Promise<void>;\n setAppLocale(options: {localeCode: string}): Promise<void>;\n\n addListener(\n eventName: 'leapCallbacks',\n listenerFunc: (event: LeapCallbacks) => void,\n ): Promise<PluginListenerHandle> & PluginListenerHandle\n\n addListener(\n eventName: 'leapElementActionCallbacks',\n listenerFunc: (event: LeapElementActionCallbacks) => void,\n ): Promise<PluginListenerHandle> & PluginListenerHandle\n\n\n}\n"]}
|
package/ios/Plugin/LeapPlugin.m
CHANGED
|
@@ -10,6 +10,7 @@ CAP_PLUGIN(LeapPlugin, "LeapPlugin",
|
|
|
10
10
|
CAP_PLUGIN_METHOD(startProject, CAPPluginReturnPromise);
|
|
11
11
|
CAP_PLUGIN_METHOD(embedProject, CAPPluginReturnPromise);
|
|
12
12
|
CAP_PLUGIN_METHOD(setUniqueUserId, CAPPluginReturnPromise);
|
|
13
|
+
CAP_PLUGIN_METHOD(setAppLocale, CAPPluginReturnPromise);
|
|
13
14
|
CAP_PLUGIN_METHOD(offlineSync, CAPPluginReturnPromise);
|
|
14
15
|
CAP_PLUGIN_METHOD(disable, CAPPluginReturnPromise);
|
|
15
16
|
)
|
|
@@ -73,6 +73,14 @@ public class LeapPlugin: CAPPlugin {
|
|
|
73
73
|
}
|
|
74
74
|
call.resolve()
|
|
75
75
|
}
|
|
76
|
+
|
|
77
|
+
@objc public func setAppLocale(_ call: CAPPluginCall) {
|
|
78
|
+
let localeCode = call.getString("localeCode") ?? ""
|
|
79
|
+
DispatchQueue.main.async {
|
|
80
|
+
Leap.shared.setAppLocale(localeCode)
|
|
81
|
+
}
|
|
82
|
+
call.resolve()
|
|
83
|
+
}
|
|
76
84
|
|
|
77
85
|
@objc public func startProject(_ call: CAPPluginCall) {
|
|
78
86
|
let projectId = call.getString("projectId") ?? ""
|