@grouplinknetwork/group-link-ionic-plugin 1.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,18 @@
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 = 'GroupLinkIonicPlugin'
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/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
+ s.ios.deployment_target = '13.0'
15
+ s.dependency 'Capacitor'
16
+ s.dependency 'GroupLinkSDK'
17
+ s.swift_version = '5.1'
18
+ end
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # group-link
2
+
3
+ plugin for implementing the company's native sdk group link
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install group-link
9
+ npx cap sync
10
+ ```
11
+
12
+ ## API
13
+
14
+ Access:
15
+ https://docs.grouplinknetwork.com/ for more information
@@ -0,0 +1,63 @@
1
+ ext {
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
6
+ }
7
+
8
+ buildscript {
9
+ repositories {
10
+ google()
11
+ mavenCentral()
12
+ }
13
+ dependencies {
14
+ classpath 'com.android.tools.build:gradle:7.4.2'
15
+ }
16
+ }
17
+
18
+ apply plugin: 'com.android.library'
19
+
20
+ android {
21
+ namespace "com.grouplink.plugin.sdk"
22
+ compileSdkVersion 34
23
+ defaultConfig {
24
+ minSdkVersion 22
25
+ targetSdkVersion 34
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_17
41
+ targetCompatibility JavaVersion.VERSION_17
42
+ }
43
+ }
44
+
45
+ allprojects{
46
+ repositories {
47
+ google()
48
+ mavenCentral()
49
+ maven { url 'https://jitpack.io' }
50
+ }
51
+ }
52
+
53
+
54
+ dependencies {
55
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
56
+ implementation project(':capacitor-android')
57
+ implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
58
+ testImplementation "junit:junit:$junitVersion"
59
+ androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
60
+ androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
61
+
62
+ implementation "com.grouplinknetwork:lib-grouplinknetwork:4.+"
63
+ }
@@ -0,0 +1,16 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ <uses-permission android:name="android.permission.INTERNET" />
3
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
4
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
5
+ <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
6
+ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
7
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
8
+ <uses-permission
9
+ android:name="android.permission.BLUETOOTH_SCAN"
10
+ android:minSdkVersion="31"
11
+ android:usesPermissionFlags="neverForLocation" />
12
+ <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
13
+ <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
14
+
15
+ <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
16
+ </manifest>
@@ -0,0 +1,14 @@
1
+ package com.grouplink;
2
+
3
+ import android.os.Bundle;
4
+
5
+ import com.getcapacitor.BridgeActivity;
6
+ import com.grouplink.plugin.GroupLinkPlugin;
7
+
8
+ public class MainActivity extends BridgeActivity {
9
+ @Override
10
+ protected void onCreate(Bundle savedInstanceState) {
11
+ registerPlugin(GroupLinkPlugin.class);
12
+ super.onCreate(savedInstanceState);
13
+ }
14
+ }
@@ -0,0 +1,115 @@
1
+ package com.grouplink.plugin;
2
+
3
+ import android.Manifest;
4
+ import android.content.Context;
5
+
6
+ import com.getcapacitor.JSObject;
7
+ import com.getcapacitor.PermissionState;
8
+ import com.getcapacitor.Plugin;
9
+ import com.getcapacitor.PluginCall;
10
+ import com.getcapacitor.PluginMethod;
11
+ import com.getcapacitor.annotation.CapacitorPlugin;
12
+ import com.getcapacitor.annotation.Permission;
13
+ import com.getcapacitor.annotation.PermissionCallback;
14
+ import com.grouplinknetwork.GroupLink;
15
+
16
+ @CapacitorPlugin(
17
+ name = "GroupLinkPlugin",
18
+ permissions = {
19
+ @Permission(
20
+ alias = "bluetooth",
21
+ strings = {
22
+ Manifest.permission.BLUETOOTH_CONNECT,
23
+ Manifest.permission.BLUETOOTH_ADVERTISE,
24
+ Manifest.permission.BLUETOOTH_SCAN,
25
+ Manifest.permission.BLUETOOTH_ADMIN
26
+ }
27
+ ),
28
+ @Permission(
29
+ alias = "foreground_service",
30
+ strings = {
31
+ Manifest.permission.FOREGROUND_SERVICE
32
+ }
33
+ ),
34
+ @Permission(
35
+ alias = "location",
36
+ strings = {
37
+ Manifest.permission.ACCESS_COARSE_LOCATION,
38
+ Manifest.permission.ACCESS_FINE_LOCATION,
39
+ }
40
+ ),
41
+ @Permission(
42
+ alias = "wifi_state",
43
+ strings = {
44
+ Manifest.permission.ACCESS_WIFI_STATE
45
+ }
46
+ ),
47
+ @Permission(
48
+ alias = "notification",
49
+ strings = {
50
+ "android.permission.POST_NOTIFICATIONS"
51
+ }
52
+ )
53
+ }
54
+ )
55
+ public class GroupLinkPlugin extends Plugin {
56
+
57
+ @PluginMethod()
58
+ public void setAndroidNotificationResId(PluginCall call){
59
+ Context context = this.getActivity().getApplicationContext();
60
+ int notificationResId = call.getInt("notificationResId");
61
+
62
+ GroupLink.setNotificationResId(context, notificationResId);
63
+ call.resolve();
64
+ }
65
+
66
+ @PluginMethod()
67
+ public void setAndroidFirebaseToken(PluginCall call){
68
+ Context context = this.getActivity().getApplicationContext();
69
+ String token = call.getString("firebaseToken");
70
+
71
+ GroupLink.setFirebaseToken(context, token);
72
+ call.resolve();
73
+ }
74
+
75
+ @PluginMethod()
76
+ public void getAndroidUserId(PluginCall call){
77
+ Context context = this.getActivity().getApplicationContext();
78
+ String userId = GroupLink.getUserId(context);
79
+
80
+ JSObject jsonObject = new JSObject();
81
+ jsonObject.put("userId", userId);
82
+ call.resolve(jsonObject);
83
+ }
84
+
85
+ @PluginMethod()
86
+ public void startAndroid(PluginCall call){
87
+ Context context = this.getActivity().getApplicationContext();
88
+ String token = call.getString("token");
89
+ boolean isDebug = Boolean.TRUE.equals(call.getBoolean("isDebug"));
90
+
91
+ GroupLink.register(context, token, isDebug);
92
+ call.resolve();
93
+ }
94
+
95
+ @PluginMethod
96
+ public void requestPermissions(PluginCall call){
97
+ requestAllPermissions(call, "permissionCallback");
98
+ }
99
+
100
+ @PermissionCallback
101
+ private void permissionCallback(PluginCall call){
102
+ permissionIsGranted("bluetooth", call);
103
+ permissionIsGranted("foreground_service", call);
104
+ permissionIsGranted("location", call);
105
+ permissionIsGranted("wifi_state", call);
106
+ permissionIsGranted("notification", call);
107
+ }
108
+
109
+ private void permissionIsGranted(String alias, PluginCall call){
110
+ if (getPermissionState(alias) == PermissionState.GRANTED){
111
+ }else {
112
+ call.reject("Permission denied");
113
+ }
114
+ }
115
+ }
File without changes
package/dist/docs.json ADDED
@@ -0,0 +1,165 @@
1
+ {
2
+ "api": {
3
+ "name": "GroupLinkPlugin",
4
+ "slug": "grouplinkplugin",
5
+ "docs": "",
6
+ "tags": [],
7
+ "methods": [
8
+ {
9
+ "name": "startAndroid",
10
+ "signature": "(options: { token: string; isDebug: boolean; }) => void",
11
+ "parameters": [
12
+ {
13
+ "name": "options",
14
+ "docs": "",
15
+ "type": "{ token: string; isDebug: boolean; }"
16
+ }
17
+ ],
18
+ "returns": "void",
19
+ "tags": [],
20
+ "docs": "",
21
+ "complexTypes": [],
22
+ "slug": "startandroid"
23
+ },
24
+ {
25
+ "name": "setAndroidNotificationResId",
26
+ "signature": "(options: { notificationResId: number; }) => void",
27
+ "parameters": [
28
+ {
29
+ "name": "options",
30
+ "docs": "",
31
+ "type": "{ notificationResId: number; }"
32
+ }
33
+ ],
34
+ "returns": "void",
35
+ "tags": [],
36
+ "docs": "",
37
+ "complexTypes": [],
38
+ "slug": "setandroidnotificationresid"
39
+ },
40
+ {
41
+ "name": "setAndroidFirebaseToken",
42
+ "signature": "(options: { firebaseToken: string; }) => void",
43
+ "parameters": [
44
+ {
45
+ "name": "options",
46
+ "docs": "",
47
+ "type": "{ firebaseToken: string; }"
48
+ }
49
+ ],
50
+ "returns": "void",
51
+ "tags": [],
52
+ "docs": "",
53
+ "complexTypes": [],
54
+ "slug": "setandroidfirebasetoken"
55
+ },
56
+ {
57
+ "name": "getAndroidUserId",
58
+ "signature": "() => Promise<{ userId: string; }>",
59
+ "parameters": [],
60
+ "returns": "Promise<{ userId: string; }>",
61
+ "tags": [],
62
+ "docs": "",
63
+ "complexTypes": [],
64
+ "slug": "getandroiduserid"
65
+ },
66
+ {
67
+ "name": "requestPermissions",
68
+ "signature": "() => void",
69
+ "parameters": [],
70
+ "returns": "void",
71
+ "tags": [],
72
+ "docs": "",
73
+ "complexTypes": [],
74
+ "slug": "requestpermissions"
75
+ },
76
+ {
77
+ "name": "startiOS",
78
+ "signature": "(options: { token: string; }) => void",
79
+ "parameters": [
80
+ {
81
+ "name": "options",
82
+ "docs": "",
83
+ "type": "{ token: string; }"
84
+ }
85
+ ],
86
+ "returns": "void",
87
+ "tags": [],
88
+ "docs": "",
89
+ "complexTypes": [],
90
+ "slug": "startios"
91
+ },
92
+ {
93
+ "name": "setNotificationTokeniOS",
94
+ "signature": "(options: { token: string; }) => void",
95
+ "parameters": [
96
+ {
97
+ "name": "options",
98
+ "docs": "",
99
+ "type": "{ token: string; }"
100
+ }
101
+ ],
102
+ "returns": "void",
103
+ "tags": [],
104
+ "docs": "",
105
+ "complexTypes": [],
106
+ "slug": "setnotificationtokenios"
107
+ },
108
+ {
109
+ "name": "startLocationiOS",
110
+ "signature": "() => void",
111
+ "parameters": [],
112
+ "returns": "void",
113
+ "tags": [],
114
+ "docs": "",
115
+ "complexTypes": [],
116
+ "slug": "startlocationios"
117
+ },
118
+ {
119
+ "name": "startBluetoothiOS",
120
+ "signature": "() => void",
121
+ "parameters": [],
122
+ "returns": "void",
123
+ "tags": [],
124
+ "docs": "",
125
+ "complexTypes": [],
126
+ "slug": "startbluetoothios"
127
+ },
128
+ {
129
+ "name": "checkBluetoothiOS",
130
+ "signature": "() => void",
131
+ "parameters": [],
132
+ "returns": "void",
133
+ "tags": [],
134
+ "docs": "",
135
+ "complexTypes": [],
136
+ "slug": "checkbluetoothios"
137
+ },
138
+ {
139
+ "name": "startNotificationiOS",
140
+ "signature": "() => void",
141
+ "parameters": [],
142
+ "returns": "void",
143
+ "tags": [],
144
+ "docs": "",
145
+ "complexTypes": [],
146
+ "slug": "startnotificationios"
147
+ },
148
+ {
149
+ "name": "getUserIDiOS",
150
+ "signature": "() => Promise<{ userId: string; }>",
151
+ "parameters": [],
152
+ "returns": "Promise<{ userId: string; }>",
153
+ "tags": [],
154
+ "docs": "",
155
+ "complexTypes": [],
156
+ "slug": "getuseridios"
157
+ }
158
+ ],
159
+ "properties": []
160
+ },
161
+ "interfaces": [],
162
+ "enums": [],
163
+ "typeAliases": [],
164
+ "pluginConfigs": []
165
+ }
@@ -0,0 +1,29 @@
1
+ export interface GroupLinkPlugin {
2
+ startAndroid(options: {
3
+ token: string;
4
+ isDebug: boolean;
5
+ }): void;
6
+ setAndroidNotificationResId(options: {
7
+ notificationResId: number;
8
+ }): void;
9
+ setAndroidFirebaseToken(options: {
10
+ firebaseToken: string;
11
+ }): void;
12
+ getAndroidUserId(): Promise<{
13
+ userId: string;
14
+ }>;
15
+ requestPermissions(): void;
16
+ startiOS(options: {
17
+ token: string;
18
+ }): void;
19
+ setNotificationTokeniOS(options: {
20
+ token: string;
21
+ }): void;
22
+ startLocationiOS(): void;
23
+ startBluetoothiOS(): void;
24
+ checkBluetoothiOS(): void;
25
+ startNotificationiOS(): void;
26
+ getUserIDiOS(): Promise<{
27
+ userId: string;
28
+ }>;
29
+ }
@@ -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":"","sourcesContent":["export interface GroupLinkPlugin {\n startAndroid(options: { token: string; isDebug: boolean }): void;\n setAndroidNotificationResId(options: { notificationResId: number }): void;\n setAndroidFirebaseToken(options: { firebaseToken: string }): void;\n getAndroidUserId(): Promise<{ userId: string }>;\n requestPermissions(): void;\n // iOS Functions\n startiOS(options: { token: string }): void;\n setNotificationTokeniOS(options: { token: string }): void;\n startLocationiOS(): void;\n startBluetoothiOS(): void;\n checkBluetoothiOS(): void;\n startNotificationiOS(): void;\n getUserIDiOS(): Promise<{ userId: string }>;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export declare function GLStart(token: string): void;
2
+ export declare function GLRequestPermissions(): void;
3
+ export declare function GLGetUserID(): Promise<string>;
4
+ export declare function GLSetNotificationToken(token: string): void;
@@ -0,0 +1,73 @@
1
+ import { Capacitor, registerPlugin } from '@capacitor/core';
2
+ var GroupLinkIonicPlugin = registerPlugin('GroupLinkPlugin', {
3
+ web: () => import('./web').then(m => new m.GroupLinkWeb()),
4
+ });
5
+ export function GLStart(token) {
6
+ registerGroupLinkPlugin();
7
+ if (Capacitor.getPlatform() === 'android') {
8
+ GroupLinkIonicPlugin.startAndroid({
9
+ token: token,
10
+ isDebug: false,
11
+ });
12
+ }
13
+ else if (Capacitor.getPlatform() === 'ios') {
14
+ GroupLinkIonicPlugin.startiOS({
15
+ token: token,
16
+ });
17
+ }
18
+ }
19
+ export function GLRequestPermissions() {
20
+ if (Capacitor.getPlatform() === 'android') {
21
+ GroupLinkIonicPlugin.requestPermissions();
22
+ }
23
+ else if (Capacitor.getPlatform() === 'ios') {
24
+ GroupLinkIonicPlugin.startBluetoothiOS();
25
+ GroupLinkIonicPlugin.startLocationiOS();
26
+ GroupLinkIonicPlugin.startNotificationiOS();
27
+ }
28
+ }
29
+ export async function GLGetUserID() {
30
+ registerGroupLinkPlugin();
31
+ if (Capacitor.getPlatform() === 'android') {
32
+ return await GroupLinkIonicPlugin.getAndroidUserId().then((ret) => {
33
+ if (typeof (ret === null || ret === void 0 ? void 0 : ret.userId) == 'string') {
34
+ return ret.userId;
35
+ }
36
+ else {
37
+ throw new Error("This device does not have an UserID");
38
+ }
39
+ });
40
+ }
41
+ else if (Capacitor.getPlatform() === 'ios') {
42
+ return await GroupLinkIonicPlugin.getUserIDiOS().then((ret) => {
43
+ if (typeof (ret === null || ret === void 0 ? void 0 : ret.userId) == 'string') {
44
+ return ret.userId;
45
+ }
46
+ else {
47
+ throw new Error("This device does not have an UserID");
48
+ }
49
+ });
50
+ }
51
+ throw new Error("This device does not have an UserID");
52
+ }
53
+ export function GLSetNotificationToken(token) {
54
+ registerGroupLinkPlugin();
55
+ if (Capacitor.getPlatform() === 'android') {
56
+ GroupLinkIonicPlugin.setAndroidFirebaseToken({
57
+ firebaseToken: token
58
+ });
59
+ }
60
+ else if (Capacitor.getPlatform() === 'ios') {
61
+ GroupLinkIonicPlugin.setNotificationTokeniOS({
62
+ token: token,
63
+ });
64
+ }
65
+ }
66
+ function registerGroupLinkPlugin() {
67
+ if (GroupLinkIonicPlugin == null) {
68
+ GroupLinkIonicPlugin = registerPlugin('GroupLinkPlugin', {
69
+ web: () => import('./web').then(m => new m.GroupLinkWeb()),
70
+ });
71
+ }
72
+ }
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE5D,IAAI,oBAAoB,GAAG,cAAc,CACvC,iBAAiB,EAAE;IACjB,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;CAC3D,CACF,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,uBAAuB,EAAE,CAAC;IAC1B,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE,CAAC;QAC1C,oBAAoB,CAAC,YAAY,CAAC;YAChC,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,KAAK;SACf,CAAC,CAAC;IACL,CAAC;SAAM,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;QAC7C,oBAAoB,CAAC,QAAQ,CAAC;YAC5B,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE,CAAC;QAC1C,oBAAoB,CAAC,kBAAkB,EAAE,CAAC;IAC5C,CAAC;SAAM,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;QAC7C,oBAAoB,CAAC,iBAAiB,EAAE,CAAC;QACzC,oBAAoB,CAAC,gBAAgB,E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SAAM,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;QAC7C,oBAAoB,CAAC,uBAAuB,CAAC;YAC3C,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,SAAS,uBAAuB;IAC9B,IAAG,oBAAoB,IAAI,IAAI,EAAC,CAAC;QAC/B,oBAAoB,GAAG,cAAc,CACnC,iBAAiB,EAAE;YACjB,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;SAC3D,CACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type { GroupLinkPlugin } from './definitions';\nimport { Capacitor, registerPlugin } from '@capacitor/core';\n\nvar GroupLinkIonicPlugin = registerPlugin<GroupLinkPlugin>(\n 'GroupLinkPlugin', {\n web: () => import('./web').then(m => new m.GroupLinkWeb()),\n },\n);\n\nexport function GLStart(token: string): void {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.startAndroid({\n token: token,\n isDebug: false,\n });\n } else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.startiOS({\n token: token,\n });\n }\n}\n\nexport function GLRequestPermissions(){\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.requestPermissions();\n } else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.startBluetoothiOS();\n GroupLinkIonicPlugin.startLocationiOS();\n GroupLinkIonicPlugin.startNotificationiOS();\n }\n}\n\nexport async function GLGetUserID(): Promise<string> {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n return await GroupLinkIonicPlugin.getAndroidUserId().then((ret) => {\n if (typeof ret?.userId == 'string') {\n return ret!.userId;\n } else {\n throw new Error(\"This device does not have an UserID\");\n }\n });\n } else if (Capacitor.getPlatform() === 'ios') {\n return await GroupLinkIonicPlugin.getUserIDiOS().then((ret) => {\n if (typeof ret?.userId == 'string') {\n return ret!.userId;\n } else {\n throw new Error(\"This device does not have an UserID\");\n }\n });\n }\n throw new Error(\"This device does not have an UserID\");\n}\n\nexport function GLSetNotificationToken(token: string): void {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.setAndroidFirebaseToken({\n firebaseToken: token\n })\n } else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.setNotificationTokeniOS({\n token: token,\n });\n }\n}\n\nfunction registerGroupLinkPlugin(){\n if(GroupLinkIonicPlugin == null){\n GroupLinkIonicPlugin = registerPlugin<GroupLinkPlugin>(\n 'GroupLinkPlugin', {\n web: () => import('./web').then(m => new m.GroupLinkWeb()),\n },\n );\n }\n}"]}
@@ -0,0 +1,31 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { GroupLinkPlugin } from './definitions';
3
+ export declare class GroupLinkWeb extends WebPlugin implements GroupLinkPlugin {
4
+ startNotificationiOS(): void;
5
+ startAndroid(options: {
6
+ token: string;
7
+ isDebug: boolean;
8
+ }): void;
9
+ setAndroidNotificationResId(options: {
10
+ notificationResId: number;
11
+ }): void;
12
+ setAndroidFirebaseToken(options: {
13
+ firebaseToken: string;
14
+ }): void;
15
+ getAndroidUserId(): Promise<{
16
+ userId: string;
17
+ }>;
18
+ requestPermissions(): void;
19
+ startiOS(options: {
20
+ token: string;
21
+ }): void;
22
+ setNotificationTokeniOS(options: {
23
+ token: string;
24
+ }): void;
25
+ startLocationiOS(): void;
26
+ startBluetoothiOS(): void;
27
+ checkBluetoothiOS(): void;
28
+ getUserIDiOS(): Promise<{
29
+ userId: string;
30
+ }>;
31
+ }
@@ -0,0 +1,2 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ //# 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","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { GroupLinkPlugin } from './definitions';\n\nexport declare class GroupLinkWeb extends WebPlugin implements GroupLinkPlugin {\n startNotificationiOS(): void;\n startAndroid(options: { token: string; isDebug: boolean }): void;\n setAndroidNotificationResId(options: { notificationResId: number }): void;\n setAndroidFirebaseToken(options: { firebaseToken: string }): void;\n getAndroidUserId(): Promise<{ userId: string }>;\n requestPermissions(): void;\n startiOS(options: { token: string }): void;\n setNotificationTokeniOS(options: { token: string }): void;\n startLocationiOS(): void;\n startBluetoothiOS(): void;\n checkBluetoothiOS(): void;\n getUserIDiOS(): Promise<{ userId: string }>;\n}"]}
@@ -0,0 +1,85 @@
1
+ 'use strict';
2
+
3
+ var core = require('@capacitor/core');
4
+
5
+ var GroupLinkIonicPlugin = core.registerPlugin('GroupLinkPlugin', {
6
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.GroupLinkWeb()),
7
+ });
8
+ function GLStart(token) {
9
+ registerGroupLinkPlugin();
10
+ if (core.Capacitor.getPlatform() === 'android') {
11
+ GroupLinkIonicPlugin.startAndroid({
12
+ token: token,
13
+ isDebug: false,
14
+ });
15
+ }
16
+ else if (core.Capacitor.getPlatform() === 'ios') {
17
+ GroupLinkIonicPlugin.startiOS({
18
+ token: token,
19
+ });
20
+ }
21
+ }
22
+ function GLRequestPermissions() {
23
+ if (core.Capacitor.getPlatform() === 'android') {
24
+ GroupLinkIonicPlugin.requestPermissions();
25
+ }
26
+ else if (core.Capacitor.getPlatform() === 'ios') {
27
+ GroupLinkIonicPlugin.startBluetoothiOS();
28
+ GroupLinkIonicPlugin.startLocationiOS();
29
+ GroupLinkIonicPlugin.startNotificationiOS();
30
+ }
31
+ }
32
+ async function GLGetUserID() {
33
+ registerGroupLinkPlugin();
34
+ if (core.Capacitor.getPlatform() === 'android') {
35
+ return await GroupLinkIonicPlugin.getAndroidUserId().then((ret) => {
36
+ if (typeof (ret === null || ret === void 0 ? void 0 : ret.userId) == 'string') {
37
+ return ret.userId;
38
+ }
39
+ else {
40
+ throw new Error("This device does not have an UserID");
41
+ }
42
+ });
43
+ }
44
+ else if (core.Capacitor.getPlatform() === 'ios') {
45
+ return await GroupLinkIonicPlugin.getUserIDiOS().then((ret) => {
46
+ if (typeof (ret === null || ret === void 0 ? void 0 : ret.userId) == 'string') {
47
+ return ret.userId;
48
+ }
49
+ else {
50
+ throw new Error("This device does not have an UserID");
51
+ }
52
+ });
53
+ }
54
+ throw new Error("This device does not have an UserID");
55
+ }
56
+ function GLSetNotificationToken(token) {
57
+ registerGroupLinkPlugin();
58
+ if (core.Capacitor.getPlatform() === 'android') {
59
+ GroupLinkIonicPlugin.setAndroidFirebaseToken({
60
+ firebaseToken: token
61
+ });
62
+ }
63
+ else if (core.Capacitor.getPlatform() === 'ios') {
64
+ GroupLinkIonicPlugin.setNotificationTokeniOS({
65
+ token: token,
66
+ });
67
+ }
68
+ }
69
+ function registerGroupLinkPlugin() {
70
+ if (GroupLinkIonicPlugin == null) {
71
+ GroupLinkIonicPlugin = core.registerPlugin('GroupLinkPlugin', {
72
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.GroupLinkWeb()),
73
+ });
74
+ }
75
+ }
76
+
77
+ var web = /*#__PURE__*/Object.freeze({
78
+ __proto__: null
79
+ });
80
+
81
+ exports.GLGetUserID = GLGetUserID;
82
+ exports.GLRequestPermissions = GLRequestPermissions;
83
+ exports.GLSetNotificationToken = GLSetNotificationToken;
84
+ exports.GLStart = GLStart;
85
+ //# sourceMappingURL=plugin.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs","sources":["esm/index.js"],"sourcesContent":["import { Capacitor, registerPlugin } from '@capacitor/core';\nvar GroupLinkIonicPlugin = registerPlugin('GroupLinkPlugin', {\n web: () => import('./web').then(m => new m.GroupLinkWeb()),\n});\nexport function GLStart(token) {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.startAndroid({\n token: token,\n isDebug: false,\n });\n }\n else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.startiOS({\n token: token,\n });\n }\n}\nexport function GLRequestPermissions() {\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.requestPermissions();\n }\n else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.startBluetoothiOS();\n GroupLinkIonicPlugin.startLocationiOS();\n GroupLinkIonicPlugin.startNotificationiOS();\n }\n}\nexport async function GLGetUserID() {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n return await GroupLinkIonicPlugin.getAndroidUserId().then((ret) => {\n if (typeof (ret === null || ret === void 0 ? void 0 : ret.userId) == 'string') {\n return ret.userId;\n }\n else {\n throw new Error(\"This device does not have an UserID\");\n }\n });\n }\n else if (Capacitor.getPlatform() === 'ios') {\n return await GroupLinkIonicPlugin.getUserIDiOS().then((ret) => {\n if (typeof (ret === null || ret === void 0 ? void 0 : ret.userId) == 'string') {\n return ret.userId;\n }\n else {\n throw new Error(\"This device does not have an UserID\");\n }\n });\n }\n throw new Error(\"This device does not have an UserID\");\n}\nexport function GLSetNotificationToken(token) {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.setAndroidFirebaseToken({\n firebaseToken: token\n });\n }\n else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.setNotificationTokeniOS({\n token: token,\n });\n }\n}\nfunction registerGroupLinkPlugin() {\n if (GroupLinkIonicPlugin == null) {\n GroupLinkIonicPlugin = registerPlugin('GroupLinkPlugin', {\n web: () => import('./web').then(m => new m.GroupLinkWeb()),\n });\n }\n}\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin","Capacitor"],"mappings":";;;;AACA,IAAI,oBAAoB,GAAGA,mBAAc,CAAC,iBAAiB,EAAE;AAC7D,IAAI,GAAG,EA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AI,IAAI,EAAE;AACtC,QAAQ,oBAAoB,GAAGD,mBAAc,CAAC,iBAAiB,EAAE;AACjE,YAAY,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;AACtE,SAAS,CAAC,CAAC;AACX,KAAK;AACL;;;;;;;;;;;"}
package/dist/plugin.js ADDED
@@ -0,0 +1,88 @@
1
+ var capacitorGroupLinkIonicPlugin = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ var GroupLinkIonicPlugin = core.registerPlugin('GroupLinkPlugin', {
5
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.GroupLinkWeb()),
6
+ });
7
+ function GLStart(token) {
8
+ registerGroupLinkPlugin();
9
+ if (core.Capacitor.getPlatform() === 'android') {
10
+ GroupLinkIonicPlugin.startAndroid({
11
+ token: token,
12
+ isDebug: false,
13
+ });
14
+ }
15
+ else if (core.Capacitor.getPlatform() === 'ios') {
16
+ GroupLinkIonicPlugin.startiOS({
17
+ token: token,
18
+ });
19
+ }
20
+ }
21
+ function GLRequestPermissions() {
22
+ if (core.Capacitor.getPlatform() === 'android') {
23
+ GroupLinkIonicPlugin.requestPermissions();
24
+ }
25
+ else if (core.Capacitor.getPlatform() === 'ios') {
26
+ GroupLinkIonicPlugin.startBluetoothiOS();
27
+ GroupLinkIonicPlugin.startLocationiOS();
28
+ GroupLinkIonicPlugin.startNotificationiOS();
29
+ }
30
+ }
31
+ async function GLGetUserID() {
32
+ registerGroupLinkPlugin();
33
+ if (core.Capacitor.getPlatform() === 'android') {
34
+ return await GroupLinkIonicPlugin.getAndroidUserId().then((ret) => {
35
+ if (typeof (ret === null || ret === void 0 ? void 0 : ret.userId) == 'string') {
36
+ return ret.userId;
37
+ }
38
+ else {
39
+ throw new Error("This device does not have an UserID");
40
+ }
41
+ });
42
+ }
43
+ else if (core.Capacitor.getPlatform() === 'ios') {
44
+ return await GroupLinkIonicPlugin.getUserIDiOS().then((ret) => {
45
+ if (typeof (ret === null || ret === void 0 ? void 0 : ret.userId) == 'string') {
46
+ return ret.userId;
47
+ }
48
+ else {
49
+ throw new Error("This device does not have an UserID");
50
+ }
51
+ });
52
+ }
53
+ throw new Error("This device does not have an UserID");
54
+ }
55
+ function GLSetNotificationToken(token) {
56
+ registerGroupLinkPlugin();
57
+ if (core.Capacitor.getPlatform() === 'android') {
58
+ GroupLinkIonicPlugin.setAndroidFirebaseToken({
59
+ firebaseToken: token
60
+ });
61
+ }
62
+ else if (core.Capacitor.getPlatform() === 'ios') {
63
+ GroupLinkIonicPlugin.setNotificationTokeniOS({
64
+ token: token,
65
+ });
66
+ }
67
+ }
68
+ function registerGroupLinkPlugin() {
69
+ if (GroupLinkIonicPlugin == null) {
70
+ GroupLinkIonicPlugin = core.registerPlugin('GroupLinkPlugin', {
71
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.GroupLinkWeb()),
72
+ });
73
+ }
74
+ }
75
+
76
+ var web = /*#__PURE__*/Object.freeze({
77
+ __proto__: null
78
+ });
79
+
80
+ exports.GLGetUserID = GLGetUserID;
81
+ exports.GLRequestPermissions = GLRequestPermissions;
82
+ exports.GLSetNotificationToken = GLSetNotificationToken;
83
+ exports.GLStart = GLStart;
84
+
85
+ return exports;
86
+
87
+ })({}, capacitorExports);
88
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js"],"sourcesContent":["import { Capacitor, registerPlugin } from '@capacitor/core';\nvar GroupLinkIonicPlugin = registerPlugin('GroupLinkPlugin', {\n web: () => import('./web').then(m => new m.GroupLinkWeb()),\n});\nexport function GLStart(token) {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.startAndroid({\n token: token,\n isDebug: false,\n });\n }\n else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.startiOS({\n token: token,\n });\n }\n}\nexport function GLRequestPermissions() {\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.requestPermissions();\n }\n else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.startBluetoothiOS();\n GroupLinkIonicPlugin.startLocationiOS();\n GroupLinkIonicPlugin.startNotificationiOS();\n }\n}\nexport async function GLGetUserID() {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n return await GroupLinkIonicPlugin.getAndroidUserId().then((ret) => {\n if (typeof (ret === null || ret === void 0 ? void 0 : ret.userId) == 'string') {\n return ret.userId;\n }\n else {\n throw new Error(\"This device does not have an UserID\");\n }\n });\n }\n else if (Capacitor.getPlatform() === 'ios') {\n return await GroupLinkIonicPlugin.getUserIDiOS().then((ret) => {\n if (typeof (ret === null || ret === void 0 ? void 0 : ret.userId) == 'string') {\n return ret.userId;\n }\n else {\n throw new Error(\"This device does not have an UserID\");\n }\n });\n }\n throw new Error(\"This device does not have an UserID\");\n}\nexport function GLSetNotificationToken(token) {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.setAndroidFirebaseToken({\n firebaseToken: token\n });\n }\n else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.setNotificationTokeniOS({\n token: token,\n });\n }\n}\nfunction registerGroupLinkPlugin() {\n if (GroupLinkIonicPlugin == null) {\n GroupLinkIonicPlugin = registerPlugin('GroupLinkPlugin', {\n web: () => import('./web').then(m => new m.GroupLinkWeb()),\n });\n }\n}\n//# sourceMappingURL=index.js.map"],"names":["registerPlugin","Capacitor"],"mappings":";;;IACA,IAAI,oBAAoB,GAAGA,mBAAc,CAAC,iBAAiB,EAAE;IAC7D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;IAC9D,CAAC,CAAC,CAAC;IACI,SAAS,OAAO,CAAC,KAAK,EAAE;IAC/B,IAAI,uBAAuB,EAAE,CAAC;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ACtE,SAAS,CAAC,CAAC;IACX,KAAK;IACL;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,10 @@
1
+ #import <UIKit/UIKit.h>
2
+
3
+ //! Project version number for Plugin.
4
+ FOUNDATION_EXPORT double PluginVersionNumber;
5
+
6
+ //! Project version string for Plugin.
7
+ FOUNDATION_EXPORT const unsigned char PluginVersionString[];
8
+
9
+ // In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
10
+
@@ -0,0 +1,14 @@
1
+ #import <Foundation/Foundation.h>
2
+ #import <Capacitor/Capacitor.h>
3
+
4
+ // Define the plugin using the CAP_PLUGIN Macro, and
5
+ // each method the plugin supports using the CAP_PLUGIN_METHOD macro.
6
+ CAP_PLUGIN(GroupLinkPlugin, "GroupLinkPlugin",
7
+ CAP_PLUGIN_METHOD(startiOS, CAPPluginReturnNone);
8
+ CAP_PLUGIN_METHOD(startBluetoothiOS, CAPPluginReturnNone);
9
+ CAP_PLUGIN_METHOD(checkBluetoothiOS, CAPPluginReturnNone);
10
+ CAP_PLUGIN_METHOD(startLocationiOS, CAPPluginReturnNone);
11
+ CAP_PLUGIN_METHOD(setNotificationTokeniOS, CAPPluginReturnNone);
12
+ CAP_PLUGIN_METHOD(getUserIDiOS, CAPPluginReturnPromise);
13
+ CAP_PLUGIN_METHOD(startNotificationiOS, CAPPluginReturnNone);
14
+ )
@@ -0,0 +1,60 @@
1
+ import Capacitor
2
+ import GroupLink
3
+
4
+ @objc(GroupLinkPlugin)
5
+ public class GroupLinkPlugin: CAPPlugin {
6
+ // MARK: Start SDK
7
+ @objc func startiOS(_ call: CAPPluginCall) {
8
+ guard let token: String = call.getString("token") else {
9
+ return
10
+ }
11
+ GroupLinkSDK.start(withToken: token)
12
+ call.resolve()
13
+ }
14
+ // MARK: Start Bluetooth
15
+ @objc func startBluetoothiOS(_ call: CAPPluginCall) {
16
+ GroupLinkSDK.startBluetooth()
17
+ call.resolve()
18
+ }
19
+ // MARK: Check Bluetooth
20
+ @objc func checkBluetoothiOS(_ call: CAPPluginCall) {
21
+ GroupLinkSDK.checkBluetooth()
22
+ call.resolve()
23
+ }
24
+ // MARK: Start Location
25
+ @objc func startLocationiOS(_ call: CAPPluginCall) {
26
+ GroupLinkSDK.startLocation()
27
+ call.resolve()
28
+ }
29
+ // MARK: Start Notification
30
+ @objc func startNotificationiOS(_ call: CAPPluginCall) {
31
+ let notification = UNUserNotificationCenter.current()
32
+ notification.getNotificationSettings(completionHandler: { (settings) in
33
+ notification.requestAuthorization(options: [.alert, .sound, .badge]){ (granted, error) in
34
+ guard error == nil && granted else {
35
+ print("User denied permissions, or error occurred")
36
+ return
37
+ }
38
+ call.resolve()
39
+ print("permissions granted")
40
+ }
41
+ }
42
+ )
43
+ }
44
+ // MARK: Set Remote Notification Tokentestable
45
+ @objc func setNotificationTokeniOS(_ call: CAPPluginCall) {
46
+ guard let token: String = call.getString("token") else {
47
+ return
48
+ }
49
+ GroupLinkNotifications.setRemoteNotificationToken(token)
50
+ call.resolve()
51
+ }
52
+ // MARK: Get UserID
53
+ @objc func getUserIDiOS(_ call: CAPPluginCall) {
54
+ guard let userID: String = GroupLinkSDK.getUserID() else {
55
+ call.reject("Failed to get user ID")
56
+ return
57
+ }
58
+ call.resolve(["userId": userID])
59
+ }
60
+ }
@@ -0,0 +1,24 @@
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>CFBundleDevelopmentRegion</key>
6
+ <string>$(DEVELOPMENT_LANGUAGE)</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>$(EXECUTABLE_NAME)</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundleName</key>
14
+ <string>$(PRODUCT_NAME)</string>
15
+ <key>CFBundlePackageType</key>
16
+ <string>FMWK</string>
17
+ <key>CFBundleShortVersionString</key>
18
+ <string>1.0</string>
19
+ <key>CFBundleVersion</key>
20
+ <string>$(CURRENT_PROJECT_VERSION)</string>
21
+ <key>NSPrincipalClass</key>
22
+ <string></string>
23
+ </dict>
24
+ </plist>
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "@grouplinknetwork/group-link-ionic-plugin",
3
+ "version": "1.0.0",
4
+ "description": "plugin for implementing the company's native sdk group link",
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/Plugin/",
14
+ "GroupLinkIonicPlugin.podspec"
15
+ ],
16
+ "author": "Group Link",
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://bitbucket.org/grouplinkmobile/grouplinkplugin/src.git"
21
+ },
22
+ "bugs": {
23
+ "url": "https://bitbucket.org/grouplinkmobile/grouplinkplugin/src/issues"
24
+ },
25
+ "keywords": [
26
+ "capacitor",
27
+ "plugin",
28
+ "native"
29
+ ],
30
+ "scripts": {
31
+ "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
32
+ "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
33
+ "verify:android": "cd android && ./gradlew clean build test && cd ..",
34
+ "verify:web": "npm run build",
35
+ "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
36
+ "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
37
+ "eslint": "eslint . --ext ts",
38
+ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
39
+ "swiftlint": "node-swiftlint",
40
+ "docgen": "docgen --api GroupLinkPlugin --output-readme README.md --output-json dist/docs.json",
41
+ "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
42
+ "clean": "rimraf ./dist",
43
+ "watch": "tsc --watch",
44
+ "prepublishOnly": "npm run build"
45
+ },
46
+ "devDependencies": {
47
+ "@capacitor/android": "^5.7.4",
48
+ "@capacitor/app": "^5.0.7",
49
+ "@capacitor/cli": "^5.7.5",
50
+ "@capacitor/core": "^5.7.5",
51
+ "@capacitor/docgen": "^0.2.2",
52
+ "@capacitor/ios": "^5.7.4",
53
+ "@ionic/eslint-config": "^0.3.0",
54
+ "@ionic/prettier-config": "^4.0.0",
55
+ "@ionic/swiftlint-config": "^1.1.2",
56
+ "eslint": "^9.0.0",
57
+ "prettier": "~3.2.5",
58
+ "prettier-plugin-java": "~2.6.0",
59
+ "rimraf": "^5.0.5",
60
+ "rollup": "^4.14.1",
61
+ "swiftlint": "^1.0.2",
62
+ "typescript": "~5.4.5"
63
+ },
64
+ "peerDependencies": {
65
+ "@capacitor/core": "^5.0.0"
66
+ },
67
+ "prettier": "@ionic/prettier-config",
68
+ "swiftlint": "@ionic/swiftlint-config",
69
+ "eslintConfig": {
70
+ "extends": "@ionic/eslint-config/recommended"
71
+ },
72
+ "capacitor": {
73
+ "ios": {
74
+ "src": "ios"
75
+ },
76
+ "android": {
77
+ "src": "android"
78
+ }
79
+ },
80
+ "publishConfig": {
81
+ "registry": "https://registry.npmjs.org/",
82
+ "access": "public"
83
+ }
84
+ }