@capgo/capacitor-appinsights 8.0.57 → 8.0.59
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 +4 -4
- package/android/build.gradle +1 -1
- package/android/src/main/java/ee/forgr/capacitor_appinsights/CapacitorAppInsightsPlugin.kt +8 -3
- package/dist/docs.json +2 -2
- package/dist/esm/definitions.d.ts +6 -0
- package/dist/esm/definitions.js.map +1 -1
- package/ios/Sources/CapacitorAppInsightsPlugin/CapacitorAppInsightsPlugin.swift +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,14 +89,14 @@ npx cap sync
|
|
|
89
89
|
### init(...)
|
|
90
90
|
|
|
91
91
|
```typescript
|
|
92
|
-
init(options: { partnerId: string; partnerKey: string; }) => Promise<void>
|
|
92
|
+
init(options: { partnerId: string; partnerKey: string; consent?: boolean; }) => Promise<void>
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
Initialize the AppInsights SDK
|
|
96
96
|
|
|
97
|
-
| Param | Type
|
|
98
|
-
| ------------- |
|
|
99
|
-
| **`options`** | <code>{ partnerId: string; partnerKey: string; }</code> | Configuration options for SDK initialization |
|
|
97
|
+
| Param | Type | Description |
|
|
98
|
+
| ------------- | -------------------------------------------------------------------------- | -------------------------------------------- |
|
|
99
|
+
| **`options`** | <code>{ partnerId: string; partnerKey: string; consent?: boolean; }</code> | Configuration options for SDK initialization |
|
|
100
100
|
|
|
101
101
|
--------------------
|
|
102
102
|
|
package/android/build.gradle
CHANGED
|
@@ -71,7 +71,7 @@ dependencies {
|
|
|
71
71
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:2.4.21"
|
|
72
72
|
|
|
73
73
|
// AppInsights SDK dependencies
|
|
74
|
-
implementation 'com.appinsights:appinsights:1.0.
|
|
74
|
+
implementation 'com.appinsights:appinsights:1.0.10'
|
|
75
75
|
implementation 'androidx.work:work-runtime-ktx:2.12.0'
|
|
76
76
|
implementation 'androidx.core:core-ktx:1.18.0'
|
|
77
77
|
|
|
@@ -34,6 +34,8 @@ class CapacitorAppInsightsPlugin : Plugin() {
|
|
|
34
34
|
return
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
val consent = call.getBoolean("consent", false) ?: false
|
|
38
|
+
|
|
37
39
|
Log.d(TAG, "Initializing PanelSDK with partnerId: $partnerId")
|
|
38
40
|
|
|
39
41
|
// Initialize the PanelSDK according to the documentation
|
|
@@ -41,6 +43,7 @@ class CapacitorAppInsightsPlugin : Plugin() {
|
|
|
41
43
|
context,
|
|
42
44
|
partnerId,
|
|
43
45
|
partnerKey,
|
|
46
|
+
consent,
|
|
44
47
|
)
|
|
45
48
|
|
|
46
49
|
Log.d(TAG, "PanelSDK initialized successfully")
|
|
@@ -62,9 +65,11 @@ class CapacitorAppInsightsPlugin : Plugin() {
|
|
|
62
65
|
return
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
Log.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
Log.w(
|
|
69
|
+
TAG,
|
|
70
|
+
"setUserId is not supported by AppInsights SDK 1.0.10+; call ignored (userId=$userId)",
|
|
71
|
+
)
|
|
72
|
+
|
|
68
73
|
call.resolve()
|
|
69
74
|
} catch (e: Exception) {
|
|
70
75
|
Log.e(TAG, "Failed to set user ID: ${e.message}", e)
|
package/dist/docs.json
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"methods": [
|
|
8
8
|
{
|
|
9
9
|
"name": "init",
|
|
10
|
-
"signature": "(options: { partnerId: string; partnerKey: string; }) => Promise<void>",
|
|
10
|
+
"signature": "(options: { partnerId: string; partnerKey: string; consent?: boolean; }) => Promise<void>",
|
|
11
11
|
"parameters": [
|
|
12
12
|
{
|
|
13
13
|
"name": "options",
|
|
14
14
|
"docs": "Configuration options for SDK initialization",
|
|
15
|
-
"type": "{ partnerId: string; partnerKey: string; }"
|
|
15
|
+
"type": "{ partnerId: string; partnerKey: string; consent?: boolean | undefined; }"
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
18
|
"returns": "Promise<void>",
|
|
@@ -11,6 +11,12 @@ export interface CapacitorAppInsightsPlugin {
|
|
|
11
11
|
init(options: {
|
|
12
12
|
partnerId: string;
|
|
13
13
|
partnerKey: string;
|
|
14
|
+
/**
|
|
15
|
+
* User consent for data collection. Required by the native AppInsights SDK.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
consent?: boolean;
|
|
14
20
|
}): Promise<void>;
|
|
15
21
|
/**
|
|
16
22
|
* Set or update the user ID after initialization
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface PanelSDKState {\n initCompleted: boolean; // SDK initialization status\n jobScheduled: boolean; // Background job scheduling status\n permissionAcquired: boolean; // Required permissions status\n}\n\nexport interface CapacitorAppInsightsPlugin {\n /**\n * Initialize the AppInsights SDK\n * @param options Configuration options for SDK initialization\n */\n init(options: {\n partnerId: string; // Provided by our business unit\n partnerKey: string; // Provided by our business unit\n }): Promise<void>;\n\n /**\n * Set or update the user ID after initialization\n * @param options User ID to set\n */\n setUserId(options: { userId: string }): Promise<void>;\n\n /**\n * Get the current state of the SDK\n * @returns Promise resolving to the current SDK state\n */\n getState(): Promise<PanelSDKState>;\n\n /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface PanelSDKState {\n initCompleted: boolean; // SDK initialization status\n jobScheduled: boolean; // Background job scheduling status\n permissionAcquired: boolean; // Required permissions status\n}\n\nexport interface CapacitorAppInsightsPlugin {\n /**\n * Initialize the AppInsights SDK\n * @param options Configuration options for SDK initialization\n */\n init(options: {\n partnerId: string; // Provided by our business unit\n partnerKey: string; // Provided by our business unit\n /**\n * User consent for data collection. Required by the native AppInsights SDK.\n *\n * @default false\n */\n consent?: boolean;\n }): Promise<void>;\n\n /**\n * Set or update the user ID after initialization\n * @param options User ID to set\n */\n setUserId(options: { userId: string }): Promise<void>;\n\n /**\n * Get the current state of the SDK\n * @returns Promise resolving to the current SDK state\n */\n getState(): Promise<PanelSDKState>;\n\n /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
|
|
@@ -7,7 +7,7 @@ import Capacitor
|
|
|
7
7
|
*/
|
|
8
8
|
@objc(CapacitorAppInsightsPlugin)
|
|
9
9
|
public class CapacitorAppInsightsPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
10
|
-
private let pluginVersion: String = "8.0.
|
|
10
|
+
private let pluginVersion: String = "8.0.59"
|
|
11
11
|
public let identifier = "CapacitorAppInsightsPlugin"
|
|
12
12
|
public let jsName = "CapacitorAppInsights"
|
|
13
13
|
public let pluginMethods: [CAPPluginMethod] = [
|
package/package.json
CHANGED