@capgo/capacitor-mute 7.1.59 → 7.1.65
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/CapgoCapacitorMute.podspec +3 -3
- package/Package.swift +31 -0
- package/android/src/main/java/ee/forgr/plugin/mute/MutePlugin.java +10 -11
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +2 -2
- package/dist/esm/web.js +2 -2
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +2 -2
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2 -2
- package/dist/plugin.js.map +1 -1
- package/ios/{Plugin → Sources/MutePlugin}/Classes/Mute.swift +4 -0
- package/ios/Tests/MutePluginTests/MutePluginTests.swift +11 -0
- package/package.json +6 -4
- package/ios/Plugin/Info.plist +0 -24
- /package/ios/{Plugin → Sources/MutePlugin}/Assets/mute.aiff +0 -0
- /package/ios/{Plugin → Sources/MutePlugin}/MutePlugin.swift +0 -0
- /package/ios/{Plugin → Sources/MutePlugin}/Muted.swift +0 -0
|
@@ -10,13 +10,13 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.homepage = package['repository']['url']
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
|
-
s.source_files = 'ios/
|
|
13
|
+
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
14
|
s.resource_bundles = {
|
|
15
|
-
'Mute' => ['ios/
|
|
15
|
+
'Mute' => ['ios/Sources/MutePlugin/Assets/*.aiff']
|
|
16
16
|
}
|
|
17
17
|
s.pod_target_xcconfig = { 'CODE_SIGNING_ALLOWED' => 'NO' }
|
|
18
18
|
s.ios.deployment_target = '14.0'
|
|
19
19
|
s.dependency 'Capacitor'
|
|
20
20
|
s.frameworks = 'Foundation', 'AudioToolbox'
|
|
21
21
|
s.swift_version = '5.1'
|
|
22
|
-
end
|
|
22
|
+
end
|
package/Package.swift
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// swift-tools-version: 5.9
|
|
2
|
+
import PackageDescription
|
|
3
|
+
|
|
4
|
+
let package = Package(
|
|
5
|
+
name: "CapgoCapacitorMute",
|
|
6
|
+
platforms: [.iOS(.v14)],
|
|
7
|
+
products: [
|
|
8
|
+
.library(
|
|
9
|
+
name: "CapgoCapacitorMute",
|
|
10
|
+
targets: ["MutePlugin"])
|
|
11
|
+
],
|
|
12
|
+
dependencies: [
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
|
|
14
|
+
],
|
|
15
|
+
targets: [
|
|
16
|
+
.target(
|
|
17
|
+
name: "MutePlugin",
|
|
18
|
+
dependencies: [
|
|
19
|
+
.product(name: "Capacitor", package: "capacitor-swift-pm"),
|
|
20
|
+
.product(name: "Cordova", package: "capacitor-swift-pm")
|
|
21
|
+
],
|
|
22
|
+
path: "ios/Sources/MutePlugin",
|
|
23
|
+
resources: [
|
|
24
|
+
.process("Assets")
|
|
25
|
+
]),
|
|
26
|
+
.testTarget(
|
|
27
|
+
name: "MutePluginTests",
|
|
28
|
+
dependencies: ["MutePlugin"],
|
|
29
|
+
path: "ios/Tests/MutePluginTests")
|
|
30
|
+
]
|
|
31
|
+
)
|
|
@@ -11,16 +11,15 @@ import com.getcapacitor.annotation.CapacitorPlugin;
|
|
|
11
11
|
@CapacitorPlugin(name = "Mute")
|
|
12
12
|
public class MutePlugin extends Plugin {
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
@PluginMethod
|
|
15
|
+
public void isMuted(PluginCall call) {
|
|
16
|
+
JSObject ret = new JSObject();
|
|
17
|
+
ret.put("value", true);
|
|
18
|
+
AudioManager audio = (AudioManager) this.bridge.getContext().getSystemService(Context.AUDIO_SERVICE);
|
|
19
|
+
switch (audio.getRingerMode()) {
|
|
20
|
+
case AudioManager.RINGER_MODE_NORMAL:
|
|
21
|
+
ret.put("value", false);
|
|
22
|
+
}
|
|
23
|
+
call.resolve(ret);
|
|
23
24
|
}
|
|
24
|
-
call.resolve(ret);
|
|
25
|
-
}
|
|
26
25
|
}
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { registerPlugin } from
|
|
2
|
-
const Mute = registerPlugin(
|
|
3
|
-
web: () => import(
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const Mute = registerPlugin('Mute', {
|
|
3
|
+
web: () => import('./web').then((m) => new m.MuteWeb()),
|
|
4
4
|
});
|
|
5
|
-
export * from
|
|
5
|
+
export * from './definitions';
|
|
6
6
|
export { Mute };
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,IAAI,GAAG,cAAc,CAAa,MAAM,EAAE;IAC9C,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;CACxD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { registerPlugin } from
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,IAAI,GAAG,cAAc,CAAa,MAAM,EAAE;IAC9C,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;CACxD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { MutePlugin } from './definitions';\n\nconst Mute = registerPlugin<MutePlugin>('Mute', {\n web: () => import('./web').then((m) => new m.MuteWeb()),\n});\n\nexport * from './definitions';\nexport { Mute };\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { WebPlugin } from
|
|
2
|
-
import type { MutePlugin, MuteResponse } from
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { MutePlugin, MuteResponse } from './definitions';
|
|
3
3
|
export declare class MuteWeb extends WebPlugin implements MutePlugin {
|
|
4
4
|
isMuted(): Promise<MuteResponse>;
|
|
5
5
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { WebPlugin } from
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
2
|
export class MuteWeb extends WebPlugin {
|
|
3
3
|
async isMuted() {
|
|
4
|
-
throw new Error(
|
|
4
|
+
throw new Error('Method not implemented.');
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpC,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import { WebPlugin } from
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpC,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { MutePlugin, MuteResponse } from './definitions';\n\nexport class MuteWeb extends WebPlugin implements MutePlugin {\n async isMuted(): Promise<MuteResponse> {\n throw new Error('Method not implemented.');\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@capacitor/core');
|
|
4
4
|
|
|
5
|
-
const Mute = core.registerPlugin(
|
|
5
|
+
const Mute = core.registerPlugin('Mute', {
|
|
6
6
|
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.MuteWeb()),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
class MuteWeb extends core.WebPlugin {
|
|
10
10
|
async isMuted() {
|
|
11
|
-
throw new Error(
|
|
11
|
+
throw new Error('Method not implemented.');
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Mute = registerPlugin('Mute', {\n web: () => import('./web').then((m) => new m.MuteWeb()),\n});\nexport * from './definitions';\nexport { Mute };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class MuteWeb extends WebPlugin {\n async isMuted() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;AACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AAC3D,CAAC;;ACFM,MAAM,OAAO,SAASC,cAAS,CAAC;AACvC,IAAI,MAAM,OAAO,GAAG;AACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD;AACA;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var capacitorMute = (function (exports, core) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
const Mute = core.registerPlugin(
|
|
4
|
+
const Mute = core.registerPlugin('Mute', {
|
|
5
5
|
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.MuteWeb()),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
class MuteWeb extends core.WebPlugin {
|
|
9
9
|
async isMuted() {
|
|
10
|
-
throw new Error(
|
|
10
|
+
throw new Error('Method not implemented.');
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Mute = registerPlugin('Mute', {\n web: () => import('./web').then((m) => new m.MuteWeb()),\n});\nexport * from './definitions';\nexport { Mute };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class MuteWeb extends WebPlugin {\n async isMuted() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;IACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3D,CAAC;;ICFM,MAAM,OAAO,SAASC,cAAS,CAAC;IACvC,IAAI,MAAM,OAAO,GAAG;IACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD;IACA;;;;;;;;;;;;;;;"}
|
|
@@ -68,6 +68,9 @@ public class Mute: NSObject {
|
|
|
68
68
|
|
|
69
69
|
/// Library bundle
|
|
70
70
|
private static var bundle: Bundle {
|
|
71
|
+
#if SWIFT_PACKAGE
|
|
72
|
+
return Bundle.module
|
|
73
|
+
#else
|
|
71
74
|
if let path = Bundle(for: Mute.self).path(forResource: "Mute", ofType: "bundle"),
|
|
72
75
|
let bundle = Bundle(path: path) {
|
|
73
76
|
return bundle
|
|
@@ -91,6 +94,7 @@ public class Mute: NSObject {
|
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
fatalError("Mute.bundle not found")
|
|
97
|
+
#endif
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
/// Mute sound url path
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-mute",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.65",
|
|
4
4
|
"description": "Detect if the mute switch is enabled/disabled on a device",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"android/src/main/",
|
|
11
11
|
"android/build.gradle",
|
|
12
12
|
"dist/",
|
|
13
|
-
"ios/
|
|
13
|
+
"ios/Sources",
|
|
14
|
+
"ios/Tests",
|
|
15
|
+
"Package.swift",
|
|
14
16
|
"CapgoCapacitorMute.podspec"
|
|
15
17
|
],
|
|
16
18
|
"author": "Martin Donadieu <martin@capgo.app>",
|
|
@@ -30,13 +32,13 @@
|
|
|
30
32
|
],
|
|
31
33
|
"scripts": {
|
|
32
34
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
33
|
-
"verify:ios": "
|
|
35
|
+
"verify:ios": "xcodebuild -scheme CapgoCapacitorMute -destination generic/platform=iOS",
|
|
34
36
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
35
37
|
"verify:web": "npm run build",
|
|
36
38
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
37
39
|
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --autocorrect --format",
|
|
38
40
|
"eslint": "eslint .",
|
|
39
|
-
"prettier": "prettier
|
|
41
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
40
42
|
"swiftlint": "node-swiftlint",
|
|
41
43
|
"docgen": "docgen --api MutePlugin --output-readme README.md --output-json dist/docs.json",
|
|
42
44
|
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
package/ios/Plugin/Info.plist
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
-
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
-
<key>CFBundleExecutable</key>
|
|
8
|
-
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
-
<key>CFBundleIdentifier</key>
|
|
10
|
-
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
-
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
-
<string>6.0</string>
|
|
13
|
-
<key>CFBundleName</key>
|
|
14
|
-
<string>$(PRODUCT_NAME)</string>
|
|
15
|
-
<key>CFBundlePackageType</key>
|
|
16
|
-
<string>FMWK</string>
|
|
17
|
-
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>1.0</string>
|
|
19
|
-
<key>CFBundleVersion</key>
|
|
20
|
-
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
-
<key>NSPrincipalClass</key>
|
|
22
|
-
<string></string>
|
|
23
|
-
</dict>
|
|
24
|
-
</plist>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|