@capawesome/capacitor-android-intent-launcher 0.0.1

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.
Files changed (34) hide show
  1. package/CapawesomeCapacitorAndroidIntentLauncher.podspec +17 -0
  2. package/LICENSE +21 -0
  3. package/Package.swift +28 -0
  4. package/README.md +242 -0
  5. package/android/build.gradle +58 -0
  6. package/android/src/main/AndroidManifest.xml +1 -0
  7. package/android/src/main/java/io/capawesome/capacitorjs/plugins/androidintentlauncher/AndroidIntentLauncher.java +106 -0
  8. package/android/src/main/java/io/capawesome/capacitorjs/plugins/androidintentlauncher/AndroidIntentLauncherPlugin.java +103 -0
  9. package/android/src/main/java/io/capawesome/capacitorjs/plugins/androidintentlauncher/classes/CustomException.java +20 -0
  10. package/android/src/main/java/io/capawesome/capacitorjs/plugins/androidintentlauncher/classes/CustomExceptions.java +11 -0
  11. package/android/src/main/java/io/capawesome/capacitorjs/plugins/androidintentlauncher/classes/options/IntentOptions.java +110 -0
  12. package/android/src/main/java/io/capawesome/capacitorjs/plugins/androidintentlauncher/classes/results/CanResolveActivityResult.java +22 -0
  13. package/android/src/main/java/io/capawesome/capacitorjs/plugins/androidintentlauncher/classes/results/StartActivityResult.java +29 -0
  14. package/android/src/main/java/io/capawesome/capacitorjs/plugins/androidintentlauncher/interfaces/Callback.java +5 -0
  15. package/android/src/main/java/io/capawesome/capacitorjs/plugins/androidintentlauncher/interfaces/NonEmptyResultCallback.java +7 -0
  16. package/android/src/main/java/io/capawesome/capacitorjs/plugins/androidintentlauncher/interfaces/Result.java +7 -0
  17. package/android/src/main/res/.gitkeep +0 -0
  18. package/dist/docs.json +296 -0
  19. package/dist/esm/definitions.d.ts +164 -0
  20. package/dist/esm/definitions.js +19 -0
  21. package/dist/esm/definitions.js.map +1 -0
  22. package/dist/esm/index.d.ts +4 -0
  23. package/dist/esm/index.js +7 -0
  24. package/dist/esm/index.js.map +1 -0
  25. package/dist/esm/web.d.ts +6 -0
  26. package/dist/esm/web.js +10 -0
  27. package/dist/esm/web.js.map +1 -0
  28. package/dist/plugin.cjs.js +43 -0
  29. package/dist/plugin.cjs.js.map +1 -0
  30. package/dist/plugin.js +46 -0
  31. package/dist/plugin.js.map +1 -0
  32. package/ios/Plugin/AndroidIntentLauncherPlugin.swift +24 -0
  33. package/ios/Plugin/Info.plist +24 -0
  34. package/package.json +91 -0
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const AndroidIntentLauncher = registerPlugin('AndroidIntentLauncher', {
3
+ web: () => import('./web').then(m => new m.AndroidIntentLauncherWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { AndroidIntentLauncher };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,qBAAqB,GAAG,cAAc,CAC1C,uBAAuB,EACvB;IACE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,wBAAwB,EAAE,CAAC;CACvE,CACF,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { AndroidIntentLauncherPlugin } from './definitions';\n\nconst AndroidIntentLauncher = registerPlugin<AndroidIntentLauncherPlugin>(\n 'AndroidIntentLauncher',\n {\n web: () => import('./web').then(m => new m.AndroidIntentLauncherWeb()),\n },\n);\n\nexport * from './definitions';\nexport { AndroidIntentLauncher };\n"]}
@@ -0,0 +1,6 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { AndroidIntentLauncherPlugin, CanResolveActivityResult, StartActivityResult } from './definitions';
3
+ export declare class AndroidIntentLauncherWeb extends WebPlugin implements AndroidIntentLauncherPlugin {
4
+ canResolveActivity(): Promise<CanResolveActivityResult>;
5
+ startActivity(): Promise<StartActivityResult>;
6
+ }
@@ -0,0 +1,10 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ export class AndroidIntentLauncherWeb extends WebPlugin {
3
+ async canResolveActivity() {
4
+ throw this.unimplemented('Not implemented on web.');
5
+ }
6
+ async startActivity() {
7
+ throw this.unimplemented('Not implemented on web.');
8
+ }
9
+ }
10
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,OAAO,wBACX,SAAQ,SAAS;IAGjB,KAAK,CAAC,kBAAkB;QACtB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACtD,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n AndroidIntentLauncherPlugin,\n CanResolveActivityResult,\n StartActivityResult,\n} from './definitions';\n\nexport class AndroidIntentLauncherWeb\n extends WebPlugin\n implements AndroidIntentLauncherPlugin\n{\n async canResolveActivity(): Promise<CanResolveActivityResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n\n async startActivity(): Promise<StartActivityResult> {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n"]}
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ var core = require('@capacitor/core');
4
+
5
+ /**
6
+ * @since 0.1.0
7
+ */
8
+ exports.ErrorCode = void 0;
9
+ (function (ErrorCode) {
10
+ /**
11
+ * No activity was found that can handle the intent.
12
+ *
13
+ * @since 0.1.0
14
+ */
15
+ ErrorCode["ActivityNotFound"] = "ACTIVITY_NOT_FOUND";
16
+ /**
17
+ * The activity could not be started.
18
+ *
19
+ * @since 0.1.0
20
+ */
21
+ ErrorCode["StartFailed"] = "START_FAILED";
22
+ })(exports.ErrorCode || (exports.ErrorCode = {}));
23
+
24
+ const AndroidIntentLauncher = core.registerPlugin('AndroidIntentLauncher', {
25
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.AndroidIntentLauncherWeb()),
26
+ });
27
+
28
+ class AndroidIntentLauncherWeb extends core.WebPlugin {
29
+ async canResolveActivity() {
30
+ throw this.unimplemented('Not implemented on web.');
31
+ }
32
+ async startActivity() {
33
+ throw this.unimplemented('Not implemented on web.');
34
+ }
35
+ }
36
+
37
+ var web = /*#__PURE__*/Object.freeze({
38
+ __proto__: null,
39
+ AndroidIntentLauncherWeb: AndroidIntentLauncherWeb
40
+ });
41
+
42
+ exports.AndroidIntentLauncher = AndroidIntentLauncher;
43
+ //# sourceMappingURL=plugin.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * No activity was found that can handle the intent.\n *\n * @since 0.1.0\n */\n ErrorCode[\"ActivityNotFound\"] = \"ACTIVITY_NOT_FOUND\";\n /**\n * The activity could not be started.\n *\n * @since 0.1.0\n */\n ErrorCode[\"StartFailed\"] = \"START_FAILED\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst AndroidIntentLauncher = registerPlugin('AndroidIntentLauncher', {\n web: () => import('./web').then(m => new m.AndroidIntentLauncherWeb()),\n});\nexport * from './definitions';\nexport { AndroidIntentLauncher };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AndroidIntentLauncherWeb extends WebPlugin {\n async canResolveActivity() {\n throw this.unimplemented('Not implemented on web.');\n }\n async startActivity() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACWA;AACX,CAAC,UAAU,SAAS,EAAE;AACtB;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,kBAAkB,CAAC,GAAG,oBAAoB;AACxD;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,CAAC,aAAa,CAAC,GAAG,cAAc;AAC7C,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AChB5B,MAAC,qBAAqB,GAAGC,mBAAc,CAAC,uBAAuB,EAAE;AACtE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,wBAAwB,EAAE,CAAC;AAC1E,CAAC;;ACFM,MAAM,wBAAwB,SAASC,cAAS,CAAC;AACxD,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;AAC3D,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js ADDED
@@ -0,0 +1,46 @@
1
+ var capacitorAndroidIntentLauncher = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ /**
5
+ * @since 0.1.0
6
+ */
7
+ exports.ErrorCode = void 0;
8
+ (function (ErrorCode) {
9
+ /**
10
+ * No activity was found that can handle the intent.
11
+ *
12
+ * @since 0.1.0
13
+ */
14
+ ErrorCode["ActivityNotFound"] = "ACTIVITY_NOT_FOUND";
15
+ /**
16
+ * The activity could not be started.
17
+ *
18
+ * @since 0.1.0
19
+ */
20
+ ErrorCode["StartFailed"] = "START_FAILED";
21
+ })(exports.ErrorCode || (exports.ErrorCode = {}));
22
+
23
+ const AndroidIntentLauncher = core.registerPlugin('AndroidIntentLauncher', {
24
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.AndroidIntentLauncherWeb()),
25
+ });
26
+
27
+ class AndroidIntentLauncherWeb extends core.WebPlugin {
28
+ async canResolveActivity() {
29
+ throw this.unimplemented('Not implemented on web.');
30
+ }
31
+ async startActivity() {
32
+ throw this.unimplemented('Not implemented on web.');
33
+ }
34
+ }
35
+
36
+ var web = /*#__PURE__*/Object.freeze({
37
+ __proto__: null,
38
+ AndroidIntentLauncherWeb: AndroidIntentLauncherWeb
39
+ });
40
+
41
+ exports.AndroidIntentLauncher = AndroidIntentLauncher;
42
+
43
+ return exports;
44
+
45
+ })({}, capacitorExports);
46
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * @since 0.1.0\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n /**\n * No activity was found that can handle the intent.\n *\n * @since 0.1.0\n */\n ErrorCode[\"ActivityNotFound\"] = \"ACTIVITY_NOT_FOUND\";\n /**\n * The activity could not be started.\n *\n * @since 0.1.0\n */\n ErrorCode[\"StartFailed\"] = \"START_FAILED\";\n})(ErrorCode || (ErrorCode = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst AndroidIntentLauncher = registerPlugin('AndroidIntentLauncher', {\n web: () => import('./web').then(m => new m.AndroidIntentLauncherWeb()),\n});\nexport * from './definitions';\nexport { AndroidIntentLauncher };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class AndroidIntentLauncherWeb extends WebPlugin {\n async canResolveActivity() {\n throw this.unimplemented('Not implemented on web.');\n }\n async startActivity() {\n throw this.unimplemented('Not implemented on web.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ErrorCode","registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;AACWA;IACX,CAAC,UAAU,SAAS,EAAE;IACtB;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,kBAAkB,CAAC,GAAG,oBAAoB;IACxD;IACA;IACA;IACA;IACA;IACA,IAAI,SAAS,CAAC,aAAa,CAAC,GAAG,cAAc;IAC7C,CAAC,EAAEA,iBAAS,KAAKA,iBAAS,GAAG,EAAE,CAAC,CAAC;;AChB5B,UAAC,qBAAqB,GAAGC,mBAAc,CAAC,uBAAuB,EAAE;IACtE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,wBAAwB,EAAE,CAAC;IAC1E,CAAC;;ICFM,MAAM,wBAAwB,SAASC,cAAS,CAAC;IACxD,IAAI,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ,IAAI,MAAM,aAAa,GAAG;IAC1B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC;IAC3D,IAAI;IACJ;;;;;;;;;;;;;;;"}
@@ -0,0 +1,24 @@
1
+ import Foundation
2
+ import Capacitor
3
+
4
+ @objc(AndroidIntentLauncherPlugin)
5
+ public class AndroidIntentLauncherPlugin: CAPPlugin, CAPBridgedPlugin {
6
+ public let identifier = "AndroidIntentLauncherPlugin"
7
+ public let jsName = "AndroidIntentLauncher"
8
+ public let pluginMethods: [CAPPluginMethod] = [
9
+ CAPPluginMethod(name: "canResolveActivity", returnType: CAPPluginReturnPromise),
10
+ CAPPluginMethod(name: "startActivity", returnType: CAPPluginReturnPromise)
11
+ ]
12
+
13
+ @objc func canResolveActivity(_ call: CAPPluginCall) {
14
+ rejectCallAsUnimplemented(call)
15
+ }
16
+
17
+ @objc func startActivity(_ call: CAPPluginCall) {
18
+ rejectCallAsUnimplemented(call)
19
+ }
20
+
21
+ private func rejectCallAsUnimplemented(_ call: CAPPluginCall) {
22
+ call.unimplemented("This method is not available on this platform.")
23
+ }
24
+ }
@@ -0,0 +1,24 @@
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>
package/package.json ADDED
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "@capawesome/capacitor-android-intent-launcher",
3
+ "version": "0.0.1",
4
+ "description": "Capacitor plugin to launch arbitrary Android intents.",
5
+ "main": "dist/plugin.cjs.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/esm/index.d.ts",
8
+ "unpkg": "dist/plugin.js",
9
+ "files": [
10
+ "android/src/main/",
11
+ "android/build.gradle",
12
+ "dist/",
13
+ "ios/Plugin/",
14
+ "CapawesomeCapacitorAndroidIntentLauncher.podspec",
15
+ "Package.swift"
16
+ ],
17
+ "author": "Robin Genz <mail@robingenz.dev>",
18
+ "license": "MIT",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/capawesome-team/capacitor-plugins.git"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/capawesome-team/capacitor-plugins/issues"
25
+ },
26
+ "funding": [
27
+ {
28
+ "type": "github",
29
+ "url": "https://github.com/sponsors/capawesome-team/"
30
+ },
31
+ {
32
+ "type": "opencollective",
33
+ "url": "https://opencollective.com/capawesome"
34
+ }
35
+ ],
36
+ "homepage": "https://capawesome.io/docs/sdks/capacitor/android-intent-launcher/",
37
+ "keywords": [
38
+ "capacitor",
39
+ "plugin",
40
+ "native"
41
+ ],
42
+ "scripts": {
43
+ "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
44
+ "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
45
+ "verify:android": "cd android && ./gradlew clean build test && cd ..",
46
+ "verify:web": "npm run build",
47
+ "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
48
+ "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
49
+ "eslint": "eslint . --ext ts",
50
+ "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
51
+ "swiftlint": "node-swiftlint",
52
+ "docgen": "docgen --api AndroidIntentLauncherPlugin --output-readme README.md --output-json dist/docs.json",
53
+ "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
54
+ "clean": "rimraf ./dist",
55
+ "watch": "tsc --watch",
56
+ "ios:pod:install": "cd ios && pod install --repo-update && cd ..",
57
+ "ios:spm:install": "cd ios && swift package resolve && cd ..",
58
+ "prepublishOnly": "npm run build"
59
+ },
60
+ "devDependencies": {
61
+ "@capacitor/android": "8.0.0",
62
+ "@capacitor/cli": "8.0.0",
63
+ "@capacitor/core": "8.0.0",
64
+ "@capacitor/docgen": "0.3.1",
65
+ "@capacitor/ios": "8.0.0",
66
+ "@ionic/eslint-config": "0.4.0",
67
+ "eslint": "8.57.0",
68
+ "prettier-plugin-java": "2.6.7",
69
+ "rimraf": "6.1.2",
70
+ "rollup": "4.53.3",
71
+ "swiftlint": "2.0.0",
72
+ "typescript": "5.9.3"
73
+ },
74
+ "peerDependencies": {
75
+ "@capacitor/core": ">=8.0.0"
76
+ },
77
+ "eslintConfig": {
78
+ "extends": "@ionic/eslint-config/recommended"
79
+ },
80
+ "capacitor": {
81
+ "ios": {
82
+ "src": "ios"
83
+ },
84
+ "android": {
85
+ "src": "android"
86
+ }
87
+ },
88
+ "publishConfig": {
89
+ "access": "public"
90
+ }
91
+ }