@grouplinknetwork/group-link-ionic-plugin 1.0.2 → 1.0.3

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.
@@ -106,6 +106,14 @@ public class GroupLinkPlugin extends Plugin {
106
106
  permissionIsGranted("notification", call);
107
107
  }
108
108
 
109
+ @PluginMethod
110
+ public void setAndroidNotificationName(PluginCall call){
111
+ Context context = this.getActivity().getApplicationContext();
112
+ String name = call.getString("name");
113
+ GroupLink.setNotificationName(context, name);
114
+ call.resolve();
115
+ }
116
+
109
117
  private void permissionIsGranted(String alias, PluginCall call){
110
118
  if (getPermissionState(alias) == PermissionState.GRANTED){
111
119
  }else {
package/dist/docs.json CHANGED
@@ -37,6 +37,22 @@
37
37
  "complexTypes": [],
38
38
  "slug": "setandroidnotificationresid"
39
39
  },
40
+ {
41
+ "name": "setAndroidNotificationName",
42
+ "signature": "(options: { name: string; }) => void",
43
+ "parameters": [
44
+ {
45
+ "name": "options",
46
+ "docs": "",
47
+ "type": "{ name: string; }"
48
+ }
49
+ ],
50
+ "returns": "void",
51
+ "tags": [],
52
+ "docs": "",
53
+ "complexTypes": [],
54
+ "slug": "setandroidnotificationname"
55
+ },
40
56
  {
41
57
  "name": "setAndroidFirebaseToken",
42
58
  "signature": "(options: { firebaseToken: string; }) => void",
@@ -105,6 +121,22 @@
105
121
  "complexTypes": [],
106
122
  "slug": "setnotificationtokenios"
107
123
  },
124
+ {
125
+ "name": "setIOSNotificationName",
126
+ "signature": "(options: { name: string; }) => void",
127
+ "parameters": [
128
+ {
129
+ "name": "options",
130
+ "docs": "",
131
+ "type": "{ name: string; }"
132
+ }
133
+ ],
134
+ "returns": "void",
135
+ "tags": [],
136
+ "docs": "",
137
+ "complexTypes": [],
138
+ "slug": "setiosnotificationname"
139
+ },
108
140
  {
109
141
  "name": "startLocationiOS",
110
142
  "signature": "() => void",
@@ -6,6 +6,9 @@ export interface GroupLinkPlugin {
6
6
  setAndroidNotificationResId(options: {
7
7
  notificationResId: number;
8
8
  }): void;
9
+ setAndroidNotificationName(options: {
10
+ name: string;
11
+ }): void;
9
12
  setAndroidFirebaseToken(options: {
10
13
  firebaseToken: string;
11
14
  }): void;
@@ -19,6 +22,9 @@ export interface GroupLinkPlugin {
19
22
  setNotificationTokeniOS(options: {
20
23
  token: string;
21
24
  }): void;
25
+ setIOSNotificationName(options: {
26
+ name: string;
27
+ }): void;
22
28
  startLocationiOS(): void;
23
29
  startBluetoothiOS(): void;
24
30
  checkBluetoothiOS(): void;
@@ -1 +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"]}
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 setAndroidNotificationName(options: { name: string }): 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 setIOSNotificationName(options: { name: string }): void;\n startLocationiOS(): void;\n startBluetoothiOS(): void;\n checkBluetoothiOS(): void;\n startNotificationiOS(): void;\n getUserIDiOS(): Promise<{ userId: string }>;\n}\n"]}
@@ -2,3 +2,6 @@ export declare function GLStart(token: string): void;
2
2
  export declare function GLRequestPermissions(): void;
3
3
  export declare function GLGetUserID(): Promise<string>;
4
4
  export declare function GLSetNotificationToken(token: string): void;
5
+ export declare function GLSetNotificationName(name: string): void;
6
+ export declare function GLSetNotificationNameAndroid(name: string): void;
7
+ export declare function GLSetNotificationNameIOS(name: string): void;
package/dist/esm/index.js CHANGED
@@ -63,6 +63,35 @@ export function GLSetNotificationToken(token) {
63
63
  });
64
64
  }
65
65
  }
66
+ export function GLSetNotificationName(name) {
67
+ registerGroupLinkPlugin();
68
+ if (Capacitor.getPlatform() === 'android') {
69
+ GroupLinkIonicPlugin.setAndroidNotificationName({
70
+ name: name
71
+ });
72
+ }
73
+ else if (Capacitor.getPlatform() === 'ios') {
74
+ GroupLinkIonicPlugin.setIOSNotificationName({
75
+ name: name,
76
+ });
77
+ }
78
+ }
79
+ export function GLSetNotificationNameAndroid(name) {
80
+ registerGroupLinkPlugin();
81
+ if (Capacitor.getPlatform() === 'android') {
82
+ GroupLinkIonicPlugin.setAndroidNotificationName({
83
+ name: name
84
+ });
85
+ }
86
+ }
87
+ export function GLSetNotificationNameIOS(name) {
88
+ registerGroupLinkPlugin();
89
+ if (Capacitor.getPlatform() === 'ios') {
90
+ GroupLinkIonicPlugin.setIOSNotificationName({
91
+ name: name
92
+ });
93
+ }
94
+ }
66
95
  function registerGroupLinkPlugin() {
67
96
  if (GroupLinkIonicPlugin == null) {
68
97
  GroupLinkIonicPlugin = registerPlugin('GroupLinkPlugin', {
@@ -1 +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,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} 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 },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,CAAC;IAC1B,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE,CAAC;QAC1C,oBAAoB,CAAC,0BAA0B,CAAC;YAC9C,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;IACJ,CAAC;SACI,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;QAC3C,oBAAoB,CAAC,sBAAsB,CAAC;YAC1C,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AACD,MAAM,UAAU,4BAA4B,CAAC,IAAY;IACvD,uBAAuB,EAAE,CAAC;IAC1B,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE,CAAC;QAC1C,oBAAoB,CAAC,0BAA0B,CAAC;YAC9C,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AACD,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,uBAAuB,EAAE,CAAC;IAC1B,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;QACtC,oBAAoB,CAAC,sBAAsB,CAAC;YAC1C,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AACD,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}\nexport function GLSetNotificationName(name: string): void {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.setAndroidNotificationName({\n name: name\n })\n } \n else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.setIOSNotificationName({\n name: name,\n });\n }\n}\nexport function GLSetNotificationNameAndroid(name: string): void {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.setAndroidNotificationName({\n name: name\n })\n } \n}\nexport function GLSetNotificationNameIOS(name: string): void {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.setIOSNotificationName({\n name: name\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}"]}
package/dist/esm/web.d.ts CHANGED
@@ -12,6 +12,9 @@ export declare class GroupLinkWeb extends WebPlugin implements GroupLinkPlugin {
12
12
  setAndroidFirebaseToken(options: {
13
13
  firebaseToken: string;
14
14
  }): void;
15
+ setAndroidNotificationName(options: {
16
+ name: string;
17
+ }): void;
15
18
  getAndroidUserId(): Promise<{
16
19
  userId: string;
17
20
  }>;
@@ -22,6 +25,9 @@ export declare class GroupLinkWeb extends WebPlugin implements GroupLinkPlugin {
22
25
  setNotificationTokeniOS(options: {
23
26
  token: string;
24
27
  }): void;
28
+ setIOSNotificationName(options: {
29
+ name: string;
30
+ }): void;
25
31
  startLocationiOS(): void;
26
32
  startBluetoothiOS(): void;
27
33
  checkBluetoothiOS(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"","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}"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"","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 setAndroidNotificationName(options: { name: string }): void;\n getAndroidUserId(): Promise<{ userId: string }>;\n requestPermissions(): void;\n startiOS(options: { token: string }): void;\n setNotificationTokeniOS(options: { token: string }): void;\n setIOSNotificationName(options: { name: string }): void;\n startLocationiOS(): void;\n startBluetoothiOS(): void;\n checkBluetoothiOS(): void;\n getUserIDiOS(): Promise<{ userId: string }>;\n}"]}
package/dist/plugin.cjs CHANGED
@@ -66,6 +66,35 @@ function GLSetNotificationToken(token) {
66
66
  });
67
67
  }
68
68
  }
69
+ function GLSetNotificationName(name) {
70
+ registerGroupLinkPlugin();
71
+ if (core.Capacitor.getPlatform() === 'android') {
72
+ GroupLinkIonicPlugin.setAndroidNotificationName({
73
+ name: name
74
+ });
75
+ }
76
+ else if (core.Capacitor.getPlatform() === 'ios') {
77
+ GroupLinkIonicPlugin.setIOSNotificationName({
78
+ name: name,
79
+ });
80
+ }
81
+ }
82
+ function GLSetNotificationNameAndroid(name) {
83
+ registerGroupLinkPlugin();
84
+ if (core.Capacitor.getPlatform() === 'android') {
85
+ GroupLinkIonicPlugin.setAndroidNotificationName({
86
+ name: name
87
+ });
88
+ }
89
+ }
90
+ function GLSetNotificationNameIOS(name) {
91
+ registerGroupLinkPlugin();
92
+ if (core.Capacitor.getPlatform() === 'ios') {
93
+ GroupLinkIonicPlugin.setIOSNotificationName({
94
+ name: name
95
+ });
96
+ }
97
+ }
69
98
  function registerGroupLinkPlugin() {
70
99
  if (GroupLinkIonicPlugin == null) {
71
100
  GroupLinkIonicPlugin = core.registerPlugin('GroupLinkPlugin', {
@@ -80,6 +109,9 @@ var web = /*#__PURE__*/Object.freeze({
80
109
 
81
110
  exports.GLGetUserID = GLGetUserID;
82
111
  exports.GLRequestPermissions = GLRequestPermissions;
112
+ exports.GLSetNotificationName = GLSetNotificationName;
113
+ exports.GLSetNotificationNameAndroid = GLSetNotificationNameAndroid;
114
+ exports.GLSetNotificationNameIOS = GLSetNotificationNameIOS;
83
115
  exports.GLSetNotificationToken = GLSetNotificationToken;
84
116
  exports.GLStart = GLStart;
85
117
  //# sourceMappingURL=plugin.cjs.map
@@ -1 +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,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;AAC9D,CAAC,CAAC;AACK,SAAS,OAAO,CAAC,KAAK,EAAE;AAC/B,IAAI,uBAAuB,EAAE;AAC7B,IAAI,IAAIC,cAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE;AAC/C,QAAQ,oBAAoB,CAAC,YAAY,CAAC;AAC1C,YAAY,KAAK,EAAE,KAAK;AACxB,YAAY,OAAO,EAAE,KAAK;AAC1B,SAAS,CAAC;AACV,IAAI;AACJ,SAAS,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;AAChD,QAAQ,oBAAoB,CAAC,QAAQ,CAAC;AACtC,YAAY,KAAK,EAAE,KAAK;AACxB,SAAS,CAAC;AACV,IAAI;AACJ;AACO,SAAS,oBAAoB,GAAG;AACvC,IAAI,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EAA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I,KAAK,CAAC,qCAAqC,CAAC;AAC1D;AACO,SAAS,sBAAsB,CAAC,KAAK,EAAE;AAC9C,IAAI,uBAAuB,EAAE;AAC7B,IAAI,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE;AAC/C,QAAQ,oBAAoB,CAAC,uBAAuB,CAAC;AACrD,YAAY,aAAa,EAAE;AAC3B,SAAS,CAAC;AACV,IAAI;AACJ,SAAS,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;AAChD,QAAQ,oBAAoB,CAAC,uBAAuB,CAAC;AACrD,YAAY,KAAK,EAAE,KAAK;AACxB,SAAS,CAAC;AACV,IAAI;AACJ;AACA,SAAS,uBAAuB,GAAG;AACnC,IAAI,IAAI,oBAAoB,IAAI,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;AACV,IAAI;AACJ;;;;;;;;;;;"}
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}\nexport function GLSetNotificationName(name) {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.setAndroidNotificationName({\n name: name\n });\n }\n else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.setIOSNotificationName({\n name: name,\n });\n }\n}\nexport function GLSetNotificationNameAndroid(name) {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.setAndroidNotificationName({\n name: name\n });\n }\n}\nexport function GLSetNotificationNameIOS(name) {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.setIOSNotificationName({\n name: name\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"],"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,cAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE;AAC/C,QAAQ,oBAAoB,CAAC,0BAA0B,CAAC;AACxD,YAAY,IAAI,EAAE;AAClB,SAAS,CAAC;AACV,IAAI;AACJ,SAAS,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;AAChD,QAAQ,oBAAoB,CAAC,sBAAsB,CAAC;AACpD,YAAY,IAAI,EAAE,IAAI;AACtB,SAAS,CAAC;AACV,IAAI;AACJ;AACO,SAAS,4BAA4B,CAAC,IAAI,EAAE;AACnD,IAAI,uBAAuB,EAAE;AAC7B,IAAI,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE;AAC/C,QAAQ,oBAAoB,CAAC,0BAA0B,CAAC;AACxD,YAAY,IAAI,EAAE;AAClB,SAAS,CAAC;AACV,IAAI;AACJ;AACO,SAAS,wBAAwB,CAAC,IAAI,EAAE;AAC/C,IAAI,uBAAuB,EAAE;AAC7B,IAAI,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;AAC3C,QAAQ,oBAAoB,CAAC,sBAAsB,CAAC;AACpD,YAAY,IAAI,EAAE;AAClB,SAAS,CAAC;AACV,IAAI;AACJ;AACA,SAAS,uBAAuB,GAAG;AACnC,IAAI,IAAI,oBAAoB,IAAI,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;AACV,IAAI;AACJ;;;;;;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -65,6 +65,35 @@ var capacitorGroupLinkIonicPlugin = (function (exports, core) {
65
65
  });
66
66
  }
67
67
  }
68
+ function GLSetNotificationName(name) {
69
+ registerGroupLinkPlugin();
70
+ if (core.Capacitor.getPlatform() === 'android') {
71
+ GroupLinkIonicPlugin.setAndroidNotificationName({
72
+ name: name
73
+ });
74
+ }
75
+ else if (core.Capacitor.getPlatform() === 'ios') {
76
+ GroupLinkIonicPlugin.setIOSNotificationName({
77
+ name: name,
78
+ });
79
+ }
80
+ }
81
+ function GLSetNotificationNameAndroid(name) {
82
+ registerGroupLinkPlugin();
83
+ if (core.Capacitor.getPlatform() === 'android') {
84
+ GroupLinkIonicPlugin.setAndroidNotificationName({
85
+ name: name
86
+ });
87
+ }
88
+ }
89
+ function GLSetNotificationNameIOS(name) {
90
+ registerGroupLinkPlugin();
91
+ if (core.Capacitor.getPlatform() === 'ios') {
92
+ GroupLinkIonicPlugin.setIOSNotificationName({
93
+ name: name
94
+ });
95
+ }
96
+ }
68
97
  function registerGroupLinkPlugin() {
69
98
  if (GroupLinkIonicPlugin == null) {
70
99
  GroupLinkIonicPlugin = core.registerPlugin('GroupLinkPlugin', {
@@ -79,6 +108,9 @@ var capacitorGroupLinkIonicPlugin = (function (exports, core) {
79
108
 
80
109
  exports.GLGetUserID = GLGetUserID;
81
110
  exports.GLRequestPermissions = GLRequestPermissions;
111
+ exports.GLSetNotificationName = GLSetNotificationName;
112
+ exports.GLSetNotificationNameAndroid = GLSetNotificationNameAndroid;
113
+ exports.GLSetNotificationNameIOS = GLSetNotificationNameIOS;
82
114
  exports.GLSetNotificationToken = GLSetNotificationToken;
83
115
  exports.GLStart = GLStart;
84
116
 
@@ -1 +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;IACK,SAAS,OAAO,CAAC,KAAK,EAAE;IAC/B,IAA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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}\nexport function GLSetNotificationName(name) {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.setAndroidNotificationName({\n name: name\n });\n }\n else if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.setIOSNotificationName({\n name: name,\n });\n }\n}\nexport function GLSetNotificationNameAndroid(name) {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'android') {\n GroupLinkIonicPlugin.setAndroidNotificationName({\n name: name\n });\n }\n}\nexport function GLSetNotificationNameIOS(name) {\n registerGroupLinkPlugin();\n if (Capacitor.getPlatform() === 'ios') {\n GroupLinkIonicPlugin.setIOSNotificationName({\n name: name\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;IACK,SAAS,OAAO,CAAC,KAAK,EAAE;IAC/B,IAAI,uBAAuB,EAAE;IAC7B,IAAI,IAAIC,cAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE;IAC/C,QAAQ,oBAAoB,CAAC,YAAY,CAAC;IAC1C,YAAY,KAAK,EAAE,KAAK;IACxB,YAAY,OAAO,EAAE,KAAK;IAC1B,SAAS,CAAC;IACV,IAAI;IACJ,SAAS,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE;IAChD,QAAQ,oBAAoB,CAAC,QAAQ,CAAC;IACtC,YAAY,KAAK,EAAE,KAAK;IACxB,SAAS,CAAC;IACV,IAAI;IACJ;IACO,SAAS,oBAAoB,GAAG;IACvC,IAAI,IAAIA,cAAS,CAAC,WAAW,EAAE,KAAK,SAAS,EAAE;IAC/C,QAAQ,oBAAoB,CAAC,kBAAkB,EAAE;I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;IACA,SAAS,uBAAuB,GAAG;IACnC,IAAI,IAAI,oBAAoB,IAAI,IAAI,EAAE;IACtC,QAAQ,oBAAoB,GAAGD,mBAAc,CAAC,iBAAiB,EAAE;IACjE,YAAY,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;IACtE,SAAS,CAAC;IACV,IAAI;IACJ;;;;;;;;;;;;;;;;;;;;"}
@@ -11,4 +11,5 @@ CAP_PLUGIN(GroupLinkPlugin, "GroupLinkPlugin",
11
11
  CAP_PLUGIN_METHOD(setNotificationTokeniOS, CAPPluginReturnNone);
12
12
  CAP_PLUGIN_METHOD(getUserIDiOS, CAPPluginReturnPromise);
13
13
  CAP_PLUGIN_METHOD(startNotificationiOS, CAPPluginReturnNone);
14
+ CAP_PLUGIN_METHOD(setIOSNotificationName, CAPPluginReturnNone);
14
15
  )
@@ -49,6 +49,13 @@ public class GroupLinkPlugin: CAPPlugin {
49
49
  GroupLinkNotifications.setRemoteNotificationToken(token)
50
50
  call.resolve()
51
51
  }
52
+ @objc func setIOSNotificationName(_ call: CAPPluginCall) {
53
+ guard let name: String = call.getString("name") else {
54
+ return
55
+ }
56
+ GroupLinkSDK.setNotificationName(name)
57
+ call.resolve()
58
+ }
52
59
  // MARK: Get UserID
53
60
  @objc func getUserIDiOS(_ call: CAPPluginCall) {
54
61
  guard let userID: String = GroupLinkSDK.getUserID() else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grouplinknetwork/group-link-ionic-plugin",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "plugin for implementing the company's native sdk group link",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",