capacitor-event-bird 0.0.22 → 0.0.24

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 CHANGED
@@ -13,13 +13,10 @@ npx cap sync
13
13
 
14
14
  <docgen-index>
15
15
 
16
- * [`echo(...)`](#echo)
17
- * [`logout()`](#logout)
18
16
  * [`signupWithGoogle()`](#signupwithgoogle)
19
17
  * [`waitlistAfterInit()`](#waitlistafterinit)
20
18
  * [`openHelpModal()`](#openhelpmodal)
21
19
  * [`getDeviceId()`](#getdeviceid)
22
- * [`getGoogleData()`](#getgoogledata)
23
20
  * [`getFCMToken(...)`](#getfcmtoken)
24
21
 
25
22
  </docgen-index>
@@ -27,36 +24,14 @@ npx cap sync
27
24
  <docgen-api>
28
25
  <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
29
26
 
30
- ### echo(...)
31
-
32
- ```typescript
33
- echo(options: { value: string; }) => Promise<{ value: string; }>
34
- ```
35
-
36
- | Param | Type |
37
- | ------------- | ------------------------------- |
38
- | **`options`** | <code>{ value: string; }</code> |
39
-
40
- **Returns:** <code>Promise&lt;{ value: string; }&gt;</code>
41
-
42
- --------------------
43
-
44
-
45
- ### logout()
46
-
47
- ```typescript
48
- logout() => Promise<void>
49
- ```
50
-
51
- --------------------
52
-
53
-
54
27
  ### signupWithGoogle()
55
28
 
56
29
  ```typescript
57
- signupWithGoogle() => Promise<void>
30
+ signupWithGoogle() => Promise<{ displayName: string; email: string; firebaseToken: string; }>
58
31
  ```
59
32
 
33
+ **Returns:** <code>Promise&lt;{ displayName: string; email: string; firebaseToken: string; }&gt;</code>
34
+
60
35
  --------------------
61
36
 
62
37
 
@@ -89,17 +64,6 @@ getDeviceId() => Promise<{ value: string; }>
89
64
  --------------------
90
65
 
91
66
 
92
- ### getGoogleData()
93
-
94
- ```typescript
95
- getGoogleData() => Promise<{ displayName: string; email: string; firebaseToken: string; }>
96
- ```
97
-
98
- **Returns:** <code>Promise&lt;{ displayName: string; email: string; firebaseToken: string; }&gt;</code>
99
-
100
- --------------------
101
-
102
-
103
67
  ### getFCMToken(...)
104
68
 
105
69
  ```typescript
package/dist/docs.json CHANGED
@@ -5,37 +5,11 @@
5
5
  "docs": "",
6
6
  "tags": [],
7
7
  "methods": [
8
- {
9
- "name": "echo",
10
- "signature": "(options: { value: string; }) => Promise<{ value: string; }>",
11
- "parameters": [
12
- {
13
- "name": "options",
14
- "docs": "",
15
- "type": "{ value: string; }"
16
- }
17
- ],
18
- "returns": "Promise<{ value: string; }>",
19
- "tags": [],
20
- "docs": "",
21
- "complexTypes": [],
22
- "slug": "echo"
23
- },
24
- {
25
- "name": "logout",
26
- "signature": "() => Promise<void>",
27
- "parameters": [],
28
- "returns": "Promise<void>",
29
- "tags": [],
30
- "docs": "",
31
- "complexTypes": [],
32
- "slug": "logout"
33
- },
34
8
  {
35
9
  "name": "signupWithGoogle",
36
- "signature": "() => Promise<void>",
10
+ "signature": "() => Promise<{ displayName: string; email: string; firebaseToken: string; }>",
37
11
  "parameters": [],
38
- "returns": "Promise<void>",
12
+ "returns": "Promise<{ displayName: string; email: string; firebaseToken: string; }>",
39
13
  "tags": [],
40
14
  "docs": "",
41
15
  "complexTypes": [],
@@ -71,16 +45,6 @@
71
45
  "complexTypes": [],
72
46
  "slug": "getdeviceid"
73
47
  },
74
- {
75
- "name": "getGoogleData",
76
- "signature": "() => Promise<{ displayName: string; email: string; firebaseToken: string; }>",
77
- "parameters": [],
78
- "returns": "Promise<{ displayName: string; email: string; firebaseToken: string; }>",
79
- "tags": [],
80
- "docs": "",
81
- "complexTypes": [],
82
- "slug": "getgoogledata"
83
- },
84
48
  {
85
49
  "name": "getFCMToken",
86
50
  "signature": "(options: { value: string; }) => Promise<{ value: string; }>",
@@ -1,21 +1,14 @@
1
1
  export interface CapacitorEventBirdPlugin {
2
- echo(options: {
3
- value: string;
4
- }): Promise<{
5
- value: string;
2
+ signupWithGoogle(): Promise<{
3
+ displayName: string;
4
+ email: string;
5
+ firebaseToken: string;
6
6
  }>;
7
- logout(): Promise<void>;
8
- signupWithGoogle(): Promise<void>;
9
7
  waitlistAfterInit(): Promise<void>;
10
8
  openHelpModal(): Promise<void>;
11
9
  getDeviceId(): Promise<{
12
10
  value: string;
13
11
  }>;
14
- getGoogleData(): Promise<{
15
- displayName: string;
16
- email: string;
17
- firebaseToken: string;
18
- }>;
19
12
  getFCMToken(options: {
20
13
  value: string;
21
14
  }): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CapacitorEventBirdPlugin {\n echo(options: { value: string }): Promise<{ value: string }>;\n logout(): Promise<void>;\n signupWithGoogle(): Promise<void>;\n waitlistAfterInit(): Promise<void>;\n openHelpModal(): Promise<void>;\n getDeviceId(): Promise<{ value: string }>;\n getGoogleData(): Promise<{ displayName: string; email: string, firebaseToken: string }>;\n getFCMToken(options: { value: string }): Promise<{ value: string }>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CapacitorEventBirdPlugin {\n signupWithGoogle(): Promise<{ displayName: string; email: string, firebaseToken: string }>;\n waitlistAfterInit(): Promise<void>;\n openHelpModal(): Promise<void>;\n getDeviceId(): Promise<{ value: string }>;\n getFCMToken(options: { value: string }): Promise<{ value: string }>;\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,26 +1,19 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
2
  import type { CapacitorEventBirdPlugin } from './definitions';
3
3
  export declare class CapacitorEventBirdWeb extends WebPlugin implements CapacitorEventBirdPlugin {
4
- echo(options: {
5
- value: string;
6
- }): Promise<{
7
- value: string;
8
- }>;
9
4
  getFCMToken(options: {
10
5
  value: string;
11
6
  }): Promise<{
12
7
  value: string;
13
8
  }>;
14
- logout(): Promise<void>;
15
- signupWithGoogle(): Promise<void>;
9
+ signupWithGoogle(): Promise<{
10
+ displayName: string;
11
+ email: string;
12
+ firebaseToken: string;
13
+ }>;
16
14
  openHelpModal(): Promise<void>;
17
15
  waitlistAfterInit(): Promise<void>;
18
16
  getDeviceId(): Promise<{
19
17
  value: string;
20
18
  }>;
21
- getGoogleData(): Promise<{
22
- displayName: string;
23
- email: string;
24
- firebaseToken: string;
25
- }>;
26
19
  }
package/dist/esm/web.js CHANGED
@@ -1,18 +1,16 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
2
  export class CapacitorEventBirdWeb extends WebPlugin {
3
- async echo(options) {
4
- console.log('ECHO', options);
5
- return options;
6
- }
7
3
  async getFCMToken(options) {
8
4
  console.log('getFCMToken', options);
9
5
  return options;
10
6
  }
11
- async logout() {
12
- console.log('logout in web isnt really needed it already works');
13
- }
14
7
  async signupWithGoogle() {
15
8
  console.log('signupWithGoogle in web isnt really needed it already works');
9
+ return {
10
+ displayName: '',
11
+ email: '',
12
+ firebaseToken: '',
13
+ };
16
14
  }
17
15
  async openHelpModal() {
18
16
  console.log('openHelpModal in web isnt really needed it already works');
@@ -23,12 +21,5 @@ export class CapacitorEventBirdWeb extends WebPlugin {
23
21
  async getDeviceId() {
24
22
  return { value: 'ios device id is not needed for web' };
25
23
  }
26
- async getGoogleData() {
27
- return {
28
- displayName: '',
29
- email: '',
30
- firebaseToken: '',
31
- };
32
- }
33
24
  }
34
25
  //# sourceMappingURL=web.js.map
@@ -1 +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,qBAAsB,SAAQ,SAAS;IAClD,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAA0B;QAC1C,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACpC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,WAAW;QACf,OAAO,EAAE,KAAK,EAAE,qCAAqC,EAAE,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO;YACL,WAAW,EAAE,EAAE;YACf,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,EAAE;SAClB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorEventBirdPlugin } from './definitions';\n\nexport class CapacitorEventBirdWeb extends WebPlugin implements CapacitorEventBirdPlugin {\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\n }\n\n async getFCMToken(options: { value: string }): Promise<{ value: string }> {\n console.log('getFCMToken', options);\n return options;\n }\n\n async logout(): Promise<void> {\n console.log('logout in web isnt really needed it already works');\n }\n\n async signupWithGoogle(): Promise<void> {\n console.log('signupWithGoogle in web isnt really needed it already works');\n }\n\n async openHelpModal(): Promise<void> {\n console.log('openHelpModal in web isnt really needed it already works');\n }\n\n async waitlistAfterInit(): Promise<void> {\n console.log('waitlistAfterInit in web isnt really needed it already works');\n }\n\n async getDeviceId(): Promise<{ value: string }> {\n return { value: 'ios device id is not needed for web' };\n }\n\n async getGoogleData(): Promise<{ displayName: string; email: string; firebaseToken: string }> {\n return {\n displayName: '',\n email: '',\n firebaseToken: '',\n };\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,qBAAsB,SAAQ,SAAS;IAClD,KAAK,CAAC,WAAW,CAAC,OAA0B;QAC1C,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACpC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,GAAG,CAAC,6DAA6D,CAAC,CAAC;QAC3E,OAAO;YACL,WAAW,EAAE,EAAE;YACf,KAAK,EAAE,EAAE;YACT,aAAa,EAAE,EAAE;SAClB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,WAAW;QACf,OAAO,EAAE,KAAK,EAAE,qCAAqC,EAAE,CAAC;IAC1D,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { CapacitorEventBirdPlugin } from './definitions';\n\nexport class CapacitorEventBirdWeb extends WebPlugin implements CapacitorEventBirdPlugin {\n async getFCMToken(options: { value: string }): Promise<{ value: string }> {\n console.log('getFCMToken', options);\n return options;\n }\n\n async signupWithGoogle(): Promise<{ displayName: string; email: string, firebaseToken: string }> {\n console.log('signupWithGoogle in web isnt really needed it already works');\n return {\n displayName: '',\n email: '',\n firebaseToken: '',\n };\n }\n\n async openHelpModal(): Promise<void> {\n console.log('openHelpModal in web isnt really needed it already works');\n }\n\n async waitlistAfterInit(): Promise<void> {\n console.log('waitlistAfterInit in web isnt really needed it already works');\n }\n\n async getDeviceId(): Promise<{ value: string }> {\n return { value: 'ios device id is not needed for web' };\n }\n}\n"]}
@@ -7,35 +7,18 @@ public class CapacitorEventBirdPlugin: CAPPlugin, CAPBridgedPlugin {
7
7
  public let jsName = "CapacitorEventBird"
8
8
 
9
9
  public let pluginMethods: [CAPPluginMethod] = [
10
- CAPPluginMethod(name: "echo", returnType: CAPPluginReturnPromise),
11
10
  CAPPluginMethod(name: "getFCMToken", returnType: CAPPluginReturnPromise),
12
- CAPPluginMethod(name: "logout", returnType: CAPPluginReturnPromise),
13
- CAPPluginMethod(name: "signupWithGoogle", returnType: CAPPluginReturnPromise),
14
11
  CAPPluginMethod(name: "waitlistAfterInit", returnType: CAPPluginReturnPromise),
15
12
  CAPPluginMethod(name: "openHelpModal", returnType: CAPPluginReturnPromise),
16
13
  CAPPluginMethod(name: "getDeviceId", returnType: CAPPluginReturnPromise),
17
- CAPPluginMethod(name: "getGoogleData", returnType: CAPPluginReturnPromise),
14
+ CAPPluginMethod(name: "signupWithGoogle", returnType: CAPPluginReturnPromise),
18
15
  ]
19
16
 
20
- private var pendingEchoCalls: [CAPPluginCall] = []
21
17
  private var pendingFCMCalls: [CAPPluginCall] = []
22
18
  private var pendingGoogleCalls: [CAPPluginCall] = []
23
19
 
24
- private var savedToken: String?
25
20
  private var savedFCMToken: String?
26
21
 
27
- private let implementation = CapacitorEventBird()
28
-
29
- @objc func echo(_ call: CAPPluginCall) {
30
- if let token = savedToken {
31
- print("[Native] JS called echo, passing the token.")
32
- call.resolve(["value": token])
33
- } else {
34
- print("[Native] JS called echo, but token not ready. Queuing callback.")
35
- pendingEchoCalls.append(call)
36
- }
37
- }
38
-
39
22
  @objc func getFCMToken(_ call: CAPPluginCall) {
40
23
  if let token = savedFCMToken {
41
24
  print("[Native] JS called getFCMToken, passing the token.")
@@ -51,8 +34,9 @@ public class CapacitorEventBirdPlugin: CAPPlugin, CAPBridgedPlugin {
51
34
  return
52
35
  }
53
36
 
54
- @objc func getGoogleData(_ call: CAPPluginCall) {
55
- print("[Native] JS called getGoogleData, but data not ready. Queuing callback.")
37
+ @objc func signupWithGoogle(_ call: CAPPluginCall) {
38
+ NotificationCenter.default.post(name: Notification.Name("CapacitorSignupWithGoogle"), object: nil)
39
+ print("[Native] JS called getGoogleData, sending CapacitorSignupWithGoogle event")
56
40
  pendingGoogleCalls.append(call)
57
41
  }
58
42
 
@@ -74,28 +58,6 @@ public class CapacitorEventBirdPlugin: CAPPlugin, CAPBridgedPlugin {
74
58
  pendingFCMCalls.removeAll()
75
59
  }
76
60
 
77
- @objc public func setAuthToken(_ token: String) {
78
- print("[Native] Setting auth token in plugin")
79
- self.savedToken = token
80
-
81
- for call in pendingEchoCalls {
82
- call.resolve(["value": token])
83
- }
84
- pendingEchoCalls.removeAll()
85
- }
86
-
87
- @objc func logout(_ call: CAPPluginCall) {
88
- NotificationCenter.default.post(name: Notification.Name("NativeLogoutEvent"), object: nil)
89
- savedToken = nil
90
- pendingEchoCalls.removeAll()
91
- call.resolve()
92
- }
93
-
94
- @objc func signupWithGoogle(_ call: CAPPluginCall) {
95
- NotificationCenter.default.post(name: Notification.Name("CapacitorSignupWithGoogle"), object: nil)
96
- call.resolve()
97
- }
98
-
99
61
  @objc func openHelpModal(_ call: CAPPluginCall) {
100
62
  NotificationCenter.default.post(name: Notification.Name("HelpBeaconOpenEvent"), object: nil)
101
63
  call.resolve()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-event-bird",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "description": "returns events back to native env",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,8 +0,0 @@
1
- import Foundation
2
-
3
- @objc public class CapacitorEventBird: NSObject {
4
- @objc public func echo(_ value: String) -> String {
5
- print(value)
6
- return value
7
- }
8
- }