Skip to content

Commit

Permalink
feat: Support Capacitor 6
Browse files Browse the repository at this point in the history
  • Loading branch information
NePheus committed Jul 7, 2024
1 parent 8b6a4e1 commit 52a838b
Show file tree
Hide file tree
Showing 10 changed files with 526 additions and 584 deletions.
70 changes: 15 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![npm version](https://badge.fury.io/js/capacitor-android-shortcuts.svg)](https://badge.fury.io/js/capacitor-android-shortcuts)
[![capacitor support](https://img.shields.io/badge/capacitor%20support-v5-brightgreen?logo=capacitor)](https://capacitorjs.com/)
[![capacitor support](https://img.shields.io/badge/capacitor%20support-v6-brightgreen?logo=capacitor)](https://capacitorjs.com/)

# capacitor-android-shortcuts

Expand Down Expand Up @@ -104,50 +104,48 @@ See [Wiki: Icon examples](https://github.com/NePheus/capacitor-android-shortcuts
### isDynamicSupported()

```typescript
isDynamicSupported() => any
isDynamicSupported() => Promise<{ result: boolean; }>
```

Checks if dynamic shortcuts are supported on the device

**Returns:** <code>any</code>
**Returns:** <code>Promise&lt;{ result: boolean; }&gt;</code>

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


### isPinnedSupported()

```typescript
isPinnedSupported() => any
isPinnedSupported() => Promise<{ result: boolean; }>
```

Checks if pinned shortcuts are supported on the device

**Returns:** <code>any</code>
**Returns:** <code>Promise&lt;{ result: boolean; }&gt;</code>

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


### setDynamic(...)

```typescript
setDynamic(options: { items: ShortcutItem[]; }) => any
setDynamic(options: { items: ShortcutItem[]; }) => Promise<void>
```

Set dynamic shortcuts

| Param | Type | Description |
| ------------- | --------------------------- | ------------------------------------------------ |
| **`options`** | <code>{ items: {}; }</code> | An items array with the options of each shortcut |

**Returns:** <code>any</code>
| Param | Type | Description |
| ------------- | --------------------------------------- | ------------------------------------------------ |
| **`options`** | <code>{ items: ShortcutItem[]; }</code> | An items array with the options of each shortcut |

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


### pin(...)

```typescript
pin(options: ShortcutItem) => any
pin(options: ShortcutItem) => Promise<void>
```

Add a pinned shortcut
Expand All @@ -156,8 +154,6 @@ Add a pinned shortcut
| ------------- | ----------------------------------------------------- | ---------------------------------------- |
| **`options`** | <code><a href="#shortcutitem">ShortcutItem</a></code> | An option object for the pinned shortcut |

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

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


Expand All @@ -174,55 +170,19 @@ Add a listener to a shortcut tap event
| **`eventName`** | <code>'shortcut'</code> |
| **`listenerFunc`** | <code>(response: { data: string; }) =&gt; void</code> |

**Returns:** <code>any</code>
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>

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


### removeAllListeners()

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

Removes all listeners.

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

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


### addDynamic(...)

```typescript
addDynamic(options: { items: ShortcutItem[]; }) => any
```

**DEPRECATED - Use `setDynamic`**

| Param | Type | Description |
| ------------- | --------------------------- | ------------------------------------------------ |
| **`options`** | <code>{ items: {}; }</code> | An items array with the options of each shortcut |

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

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


### addPinned(...)

```typescript
addPinned(options: ShortcutItem) => any
```

**DEPRECATED - Use `pin`**

| Param | Type | Description |
| ------------- | ----------------------------------------------------- | ---------------------------------------- |
| **`options`** | <code><a href="#shortcutitem">ShortcutItem</a></code> | An option object for the pinned shortcut |

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

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


Expand All @@ -242,9 +202,9 @@ addPinned(options: ShortcutItem) => any

#### PluginListenerHandle

| Prop | Type |
| ------------ | ------------------------- |
| **`remove`** | <code>() =&gt; any</code> |
| Prop | Type |
| ------------ | ----------------------------------------- |
| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |


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

apply plugin: 'com.android.library'

android {
namespace "nepheus.capacitor.androidshortcuts"
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
defaultConfig {
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.
4 changes: 3 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 52a838b

Please sign in to comment.