Skip to content

Commit

Permalink
feat!: upgrade capacitor 6
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Apr 30, 2024
1 parent d721f61 commit 9a8fd0b
Show file tree
Hide file tree
Showing 13 changed files with 1,057 additions and 639 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

44 changes: 11 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,157 +68,135 @@ CapacitorCrisp.openMessenger()
### configure(...)

```typescript
configure(data: { websiteID: string; }) => any
configure(data: { websiteID: string; }) => Promise<void>
```

| Param | Type |
| ---------- | ----------------------------------- |
| **`data`** | <code>{ websiteID: string; }</code> |

**Returns:** <code>any</code>

--------------------


### openMessenger()

```typescript
openMessenger() => any
openMessenger() => Promise<void>
```

**Returns:** <code>any</code>

--------------------


### setTokenID(...)

```typescript
setTokenID(data: { tokenID: string; }) => any
setTokenID(data: { tokenID: string; }) => Promise<void>
```

| Param | Type |
| ---------- | --------------------------------- |
| **`data`** | <code>{ tokenID: string; }</code> |

**Returns:** <code>any</code>

--------------------


### setUser(...)

```typescript
setUser(data: { nickname?: string; phone?: string; email?: string; avatar?: string; }) => any
setUser(data: { nickname?: string; phone?: string; email?: string; avatar?: string; }) => Promise<void>
```

| Param | Type |
| ---------- | ------------------------------------------------------------------------------------ |
| **`data`** | <code>{ nickname?: string; phone?: string; email?: string; avatar?: string; }</code> |

**Returns:** <code>any</code>

--------------------


### pushEvent(...)

```typescript
pushEvent(data: { name: string; color: eventColor; }) => any
pushEvent(data: { name: string; color: eventColor; }) => Promise<void>
```

| Param | Type |
| ---------- | --------------------------------------------------------------------------- |
| **`data`** | <code>{ name: string; color: <a href="#eventcolor">eventColor</a>; }</code> |

**Returns:** <code>any</code>

--------------------


### setCompany(...)

```typescript
setCompany(data: { name: string; url?: string; description?: string; employment?: [title: string, role: string]; geolocation?: [country: string, city: string]; }) => any
setCompany(data: { name: string; url?: string; description?: string; employment?: [title: string, role: string]; geolocation?: [country: string, city: string]; }) => Promise<void>
```

| Param | Type |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`data`** | <code>{ name: string; url?: string; description?: string; employment?: [title: string, role: string]; geolocation?: [country: string, city: string]; }</code> |

**Returns:** <code>any</code>

--------------------


### setInt(...)

```typescript
setInt(data: { key: string; value: number; }) => any
setInt(data: { key: string; value: number; }) => Promise<void>
```

| Param | Type |
| ---------- | -------------------------------------------- |
| **`data`** | <code>{ key: string; value: number; }</code> |

**Returns:** <code>any</code>

--------------------


### setString(...)

```typescript
setString(data: { key: string; value: string; }) => any
setString(data: { key: string; value: string; }) => Promise<void>
```

| Param | Type |
| ---------- | -------------------------------------------- |
| **`data`** | <code>{ key: string; value: string; }</code> |

**Returns:** <code>any</code>

--------------------


### sendMessage(...)

```typescript
sendMessage(data: { value: string; }) => any
sendMessage(data: { value: string; }) => Promise<void>
```

| Param | Type |
| ---------- | ------------------------------- |
| **`data`** | <code>{ value: string; }</code> |

**Returns:** <code>any</code>

--------------------


### setSegment(...)

```typescript
setSegment(data: { segment: string; }) => any
setSegment(data: { segment: string; }) => Promise<void>
```

| Param | Type |
| ---------- | --------------------------------- |
| **`data`** | <code>{ segment: string; }</code> |

**Returns:** <code>any</code>

--------------------


### reset()

```typescript
reset() => any
reset() => Promise<void>
```

**Returns:** <code>any</code>

--------------------


Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.1'
classpath 'com.android.tools.build:gradle:8.2.1'
}
}

Expand All @@ -20,11 +20,11 @@ apply plugin: 'com.android.library'

android {
namespace "ee.forgr.plugin.crisp"
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
defaultConfig {
multiDexEnabled true
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
17 changes: 8 additions & 9 deletions android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -145,15 +144,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +201,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry
.getInstrumentation()
Context appContext = InstrumentationRegistry.getInstrumentation()
.getTargetContext();

assertEquals("com.getcapacitor.android", appContext.getPackageName());
Expand Down
5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
extends: "@ionic/eslint-config/recommended",
files: ["src/**/*.tss"],
ignore: ["build", "dist", "example"],
};
2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
9 changes: 0 additions & 9 deletions ios/PluginTests/CapacitorCrispTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ import XCTest
@testable import Plugin

class CapacitorCrispTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}

func testEcho() {
// This is an example of a functional test case for a plugin.
Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capgo/capacitor-crisp",
"version": "2.0.16",
"version": "5.0.0",
"description": "Crisp native SDK for capacitor",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -36,7 +36,7 @@
"verify:web": "npm run build",
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --autocorrect --format",
"eslint": "eslint . --ext ts",
"eslint": "eslint .",
"prettier": "prettier --config .prettierrc.js \"**/*.{css,html,ts,js,java}\"",
"swiftlint": "node-swiftlint",
"docgen": "docgen --api CapacitorCrispPlugin --output-readme README.md --output-json dist/docs.json",
Expand All @@ -46,28 +46,28 @@
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@capacitor/android": "^5.0.3",
"@capacitor/cli": "^5.0.3",
"@capacitor/core": "^5.0.3",
"@capacitor/docgen": "^0.2.1",
"@capacitor/ios": "^5.0.3",
"@capacitor/android": "^6.0.0",
"@capacitor/cli": "^6.0.0",
"@capacitor/core": "^6.0.0",
"@capacitor/docgen": "^0.2.2",
"@capacitor/ios": "^6.0.0",
"@ionic/eslint-config": "^0.3.0",
"@ionic/prettier-config": "^3.0.0",
"@ionic/prettier-config": "^4.0.0",
"@ionic/swiftlint-config": "^1.1.2",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"eslint": "^8.41.0",
"eslint-plugin-import": "^2.27.5",
"husky": "^8.0.3",
"prettier": "^2.8.8",
"prettier-plugin-java": "^2.1.0",
"rimraf": "^5.0.1",
"rollup": "^3.23.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"eslint": "^9.1.1",
"eslint-plugin-import": "^2.29.1",
"husky": "^9.0.11",
"prettier": "^3.2.5",
"prettier-plugin-java": "^2.6.0",
"rimraf": "^5.0.5",
"rollup": "^4.17.1",
"swiftlint": "^1.0.2",
"typescript": "^5.0.4"
"typescript": "^5.4.5"
},
"peerDependencies": {
"@capacitor/core": "^5.0.0"
"@capacitor/core": "^6.0.0"
},
"prettier": "@ionic/prettier-config",
"swiftlint": "@ionic/swiftlint-config",
Expand Down
Loading

0 comments on commit 9a8fd0b

Please sign in to comment.