capacitor-launch-native 0.0.1 → 1.0.0
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/android/build.gradle
CHANGED
|
@@ -11,7 +11,7 @@ buildscript {
|
|
|
11
11
|
mavenCentral()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.2.1'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -19,10 +19,10 @@ apply plugin: 'com.android.library'
|
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
21
|
namespace "dev.harding.plugins.launchnative"
|
|
22
|
-
|
|
22
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
|
|
23
23
|
defaultConfig {
|
|
24
24
|
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
25
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
|
|
26
26
|
versionCode 1
|
|
27
27
|
versionName "1.0"
|
|
28
28
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -14,7 +14,7 @@ import java.util.Set;
|
|
|
14
14
|
// https://developer.chrome.com/blog/custom-tabs-android-11
|
|
15
15
|
public class LaunchNative {
|
|
16
16
|
public boolean attempt(Context context, String url) {
|
|
17
|
-
|
|
17
|
+
var uri = Uri.parse(url);
|
|
18
18
|
|
|
19
19
|
return Build.VERSION.SDK_INT >= 30 ?
|
|
20
20
|
launchNativeApi30(context, uri) :
|
|
@@ -10,7 +10,12 @@ public class LaunchNativePlugin: CAPPlugin {
|
|
|
10
10
|
@objc func attempt(_ call: CAPPluginCall) {
|
|
11
11
|
let url = call.getString("url") ?? ""
|
|
12
12
|
|
|
13
|
-
let parsedUrl = URL(string: url)
|
|
13
|
+
guard let parsedUrl = URL(string: url) else {
|
|
14
|
+
call.resolve([
|
|
15
|
+
"completed": false
|
|
16
|
+
])
|
|
17
|
+
return
|
|
18
|
+
}
|
|
14
19
|
|
|
15
20
|
DispatchQueue.main.async {
|
|
16
21
|
UIApplication.shared.open(parsedUrl, options: [.universalLinksOnly: true]) { success in
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-launch-native",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Launch an app natively, if it exists",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -27,11 +27,27 @@
|
|
|
27
27
|
"plugin",
|
|
28
28
|
"native"
|
|
29
29
|
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
32
|
+
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
|
|
33
|
+
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
34
|
+
"verify:web": "npm run build",
|
|
35
|
+
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
36
|
+
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
37
|
+
"eslint": "eslint . --ext ts",
|
|
38
|
+
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
39
|
+
"swiftlint": "node-swiftlint",
|
|
40
|
+
"docgen": "docgen --api LaunchNativePlugin --output-readme README.md --output-json dist/docs.json",
|
|
41
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
|
|
42
|
+
"clean": "rimraf ./dist",
|
|
43
|
+
"watch": "tsc --watch",
|
|
44
|
+
"prepublishOnly": "npm run build"
|
|
45
|
+
},
|
|
30
46
|
"devDependencies": {
|
|
31
|
-
"@capacitor/android": "^
|
|
32
|
-
"@capacitor/core": "^
|
|
47
|
+
"@capacitor/android": "^6.0.0",
|
|
48
|
+
"@capacitor/core": "^6.0.0",
|
|
33
49
|
"@capacitor/docgen": "^0.0.18",
|
|
34
|
-
"@capacitor/ios": "^
|
|
50
|
+
"@capacitor/ios": "^6.0.0",
|
|
35
51
|
"@ionic/eslint-config": "^0.3.0",
|
|
36
52
|
"@ionic/prettier-config": "^1.0.1",
|
|
37
53
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
@@ -44,7 +60,7 @@
|
|
|
44
60
|
"typescript": "~4.1.5"
|
|
45
61
|
},
|
|
46
62
|
"peerDependencies": {
|
|
47
|
-
"@capacitor/core": "^
|
|
63
|
+
"@capacitor/core": "^6.0.0"
|
|
48
64
|
},
|
|
49
65
|
"prettier": "@ionic/prettier-config",
|
|
50
66
|
"swiftlint": "@ionic/swiftlint-config",
|
|
@@ -58,20 +74,5 @@
|
|
|
58
74
|
"android": {
|
|
59
75
|
"src": "android"
|
|
60
76
|
}
|
|
61
|
-
},
|
|
62
|
-
"scripts": {
|
|
63
|
-
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
64
|
-
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
|
|
65
|
-
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
66
|
-
"verify:web": "npm run build",
|
|
67
|
-
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
68
|
-
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
69
|
-
"eslint": "eslint . --ext ts",
|
|
70
|
-
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
71
|
-
"swiftlint": "node-swiftlint",
|
|
72
|
-
"docgen": "docgen --api LaunchNativePlugin --output-readme README.md --output-json dist/docs.json",
|
|
73
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
|
|
74
|
-
"clean": "rimraf ./dist",
|
|
75
|
-
"watch": "tsc --watch"
|
|
76
77
|
}
|
|
77
|
-
}
|
|
78
|
+
}
|