@capacitor-community/app-icon
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -1,10 +0,1 @@ | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
import { WebPlugin } from '@capacitor/core'; | ||
@@ -19,20 +10,12 @@ export class AppIconWeb extends WebPlugin { | ||
isSupported() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new Error("isSupported not available"); | ||
}); | ||
throw new Error('isSupported not available on web'); | ||
} | ||
getName() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new Error("getName not available"); | ||
}); | ||
throw new Error('getName not available on web'); | ||
} | ||
change() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new Error("change not available"); | ||
}); | ||
throw new Error('change not available on web'); | ||
} | ||
reset() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new Error("reset not available"); | ||
}); | ||
throw new Error('reset not available on web'); | ||
} | ||
@@ -39,0 +22,0 @@ } |
var capacitorPlugin = (function (exports, core) { | ||
'use strict'; | ||
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
class AppIconWeb extends core.WebPlugin { | ||
@@ -21,20 +12,12 @@ constructor() { | ||
isSupported() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new Error("isSupported not available"); | ||
}); | ||
throw new Error('isSupported not available on web'); | ||
} | ||
getName() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new Error("getName not available"); | ||
}); | ||
throw new Error('getName not available on web'); | ||
} | ||
change() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new Error("change not available"); | ||
}); | ||
throw new Error('change not available on web'); | ||
} | ||
reset() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new Error("reset not available"); | ||
}); | ||
throw new Error('reset not available on web'); | ||
} | ||
@@ -41,0 +24,0 @@ } |
{ | ||
"name": "@capacitor-community/app-icon", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Capacitor community plugin for changing an iOS app icon.", | ||
@@ -8,2 +8,7 @@ "main": "dist/plugin.js", | ||
"types": "dist/esm/index.d.ts", | ||
"files": [ | ||
"dist/", | ||
"ios/", | ||
"CapacitorCommunityAppIcon.podspec" | ||
], | ||
"scripts": { | ||
@@ -14,6 +19,6 @@ "lint": "npm run prettier -- --check && npm run swiftlint -- lint", | ||
"build": "npm run clean && tsc && rollup -c rollup.config.js", | ||
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination \"generic/platform=iOS\" && cd ..", | ||
"clean": "rimraf ./dist", | ||
"watch": "tsc --watch", | ||
"prepublishOnly": "npm run build", | ||
"npm-publish": "np" | ||
"prepublishOnly": "npm run build" | ||
}, | ||
@@ -23,4 +28,5 @@ "author": "johnborges", | ||
"devDependencies": { | ||
"@capacitor/core": "^2.4.5", | ||
"@capacitor/ios": "^2.4.5", | ||
"@capacitor/android": "^2.5.0", | ||
"@capacitor/core": "^2.5.0", | ||
"@capacitor/ios": "^2.5.0", | ||
"@ionic/prettier-config": "^1.0.0", | ||
@@ -36,15 +42,5 @@ "@ionic/swiftlint-config": "^1.0.0", | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "pretty-quick --staged" | ||
} | ||
}, | ||
"peerDependencies": { | ||
"@capacitor/core": "^2.4.5" | ||
"@capacitor/core": "^2.5.0" | ||
}, | ||
"files": [ | ||
"dist/", | ||
"ios/", | ||
"AppIcon.podspec" | ||
], | ||
"keywords": [ | ||
@@ -56,2 +52,5 @@ "capacitor", | ||
], | ||
"eslintConfig": { | ||
"extends": "@ionic/eslint-config/recommended" | ||
}, | ||
"capacitor": { | ||
@@ -58,0 +57,0 @@ "ios": { |
@@ -9,8 +9,7 @@ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p> | ||
<p align="center"> | ||
<img src="https://img.shields.io/maintenance/yes/2020?style=flat-square" /> | ||
<a href="https://github.com/capacitor-community/example/actions?query=workflow%3A%22CI%22"><img src="https://img.shields.io/github/workflow/status/capacitor-community/example/CI?style=flat-square" /></a> | ||
<a href="https://www.npmjs.com/package/@capacitor-community/example"><img src="https://img.shields.io/npm/l/@capacitor-community/example?style=flat-square" /></a> | ||
<img src="https://img.shields.io/maintenance/yes/2021?style=flat-square" /> | ||
<a href="https://www.npmjs.com/package/@capacitor-community/app-icon"><img src="https://img.shields.io/npm/l/@capacitor-community/app-icon?style=flat-square" /></a> | ||
<br> | ||
<a href="https://www.npmjs.com/package/@capacitor-community/example"><img src="https://img.shields.io/npm/dw/@capacitor-community/example?style=flat-square" /></a> | ||
<a href="https://www.npmjs.com/package/@capacitor-community/example"><img src="https://img.shields.io/npm/v/@capacitor-community/example?style=flat-square" /></a> | ||
<a href="https://www.npmjs.com/package/@capacitor-community/app-icon"><img src="https://img.shields.io/npm/dw/@capacitor-community/app-icon?style=flat-square" /></a> | ||
<a href="https://www.npmjs.com/package/@capacitor-community/app-icon"><img src="https://img.shields.io/npm/v/@capacitor-community/app-icon?style=flat-square" /></a> | ||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> | ||
@@ -21,4 +20,6 @@ <a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-0-orange?style=flat-square" /></a> | ||
<p align="center"><img src="https://github.com/johnborges/app-icon/blob/main/media/appicon_demo.gif" width="373px" height="688px" /></p> | ||
<p align="center"><img src="https://github.com/capacitor-community/app-icon/blob/main/media/appicon_demo.gif" width="373px" height="688px" /></p> | ||
# This branch is for Capacitor 2.x. For Capacitor 3.x, see `https://github.com/capacitor-community/app-icon/tree/master` | ||
## Maintainers | ||
@@ -42,3 +43,9 @@ | ||
``` | ||
### Capacitor 2.x | ||
For Capacitor 2.x projects, you will need to install a version less than 2.0.0. You can do that by specifying the version in your `package.json` or installing like this. | ||
```bash | ||
npm i @capacitor-community/app-icon@1.1.0 | ||
## Configuration | ||
@@ -56,3 +63,3 @@ | ||
<img src="https://github.com/johnborges/app-icon/blob/main/media/xcode_project.png" width="500px" /> | ||
<img src="https://github.com/capacitor-community/app-icon/blob/main/media/xcode_project.png" width="500px" /> | ||
@@ -99,6 +106,4 @@ Providing every resolution for each alternative is not required. By including the icon with the highest supported resolution, iOS will handle the other resolutions by scalling down the large one provided. | ||
```javascript | ||
import { Plugins } from '@capacitor/core'; | ||
import { AppIcon } from '@capacitor-community/app-icon'; | ||
const { AppIcon } = Plugins; | ||
const changeIcon = async (iconName) => { | ||
@@ -105,0 +110,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
190574
68
172
180
12