@capgo/capacitor-appinsights 8.0.57 → 8.0.60

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
@@ -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 | Description |
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
 
@@ -1,5 +1,3 @@
1
- import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2
-
3
1
  ext {
4
2
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
5
3
  androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
@@ -14,20 +12,18 @@ buildscript {
14
12
  mavenCentral()
15
13
  }
16
14
  dependencies {
17
- classpath 'com.android.tools.build:gradle:8.13.0'
18
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.4.21"
15
+ classpath 'com.android.tools.build:gradle:9.1.0'
19
16
  }
20
17
  }
21
18
 
22
19
  apply plugin: 'com.android.library'
23
- apply plugin: 'kotlin-android'
24
20
 
25
21
  android {
26
22
  namespace = "ee.forgr.capacitor_appinsights"
27
- compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
23
+ compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 37
28
24
  defaultConfig {
29
25
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
30
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
26
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 37
31
27
  versionCode 1
32
28
  versionName "1.0"
33
29
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -47,12 +43,6 @@ android {
47
43
  }
48
44
  }
49
45
 
50
- kotlin {
51
- compilerOptions {
52
- jvmTarget = JvmTarget.JVM_21
53
- }
54
- }
55
-
56
46
  repositories {
57
47
  google()
58
48
  mavenCentral()
@@ -67,13 +57,10 @@ dependencies {
67
57
  implementation project(':capacitor-android')
68
58
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
69
59
 
70
- // Kotlin dependencies
71
- implementation "org.jetbrains.kotlin:kotlin-stdlib:2.4.21"
72
-
73
60
  // AppInsights SDK dependencies
74
- implementation 'com.appinsights:appinsights:1.0.1'
61
+ implementation 'com.appinsights:appinsights:1.0.10'
75
62
  implementation 'androidx.work:work-runtime-ktx:2.12.0'
76
- implementation 'androidx.core:core-ktx:1.18.0'
63
+ implementation 'androidx.core:core-ktx:1.19.1'
77
64
 
78
65
  testImplementation "junit:junit:$junitVersion"
79
66
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
@@ -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.d(TAG, "Setting user ID: $userId")
66
- PanelSDK.setUserId(userId)
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.57"
10
+ private let pluginVersion: String = "8.0.60"
11
11
  public let identifier = "CapacitorAppInsightsPlugin"
12
12
  public let jsName = "CapacitorAppInsights"
13
13
  public let pluginMethods: [CAPPluginMethod] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-appinsights",
3
- "version": "8.0.57",
3
+ "version": "8.0.60",
4
4
  "description": "A wrapper around the https://github.com/apptopia/appinsights SDK",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",