Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: updating to cordova-ios 8.0.0

Ilian Sapundshievcba8d0159284
diff --git a/cordova/.gitignore b/cordova/.gitignore
index 117aeabbd..53791a1a2 100644
--- a/cordova/.gitignore
+++ b/cordova/.gitignore
@@ -28,5 +28,7 @@ platforms/android/app/build/*
platforms/android/build/*
platforms/android/CordovaLib/build/*
platforms/android/assets/www/*
+platforms/ios/www/dist/*
+platforms/ios/www/modules/*
plugins/**/*
diff --git a/cordova/package-lock.json b/cordova/package-lock.json
index 73456a689..1b5f0a036 100644
--- a/cordova/package-lock.json
+++ b/cordova/package-lock.json
@@ -9,7 +9,6 @@
"version": "1.0.4",
"license": "Apache-2.0",
"dependencies": {
- "cordova-plugin-add-swift-support": "2.0.2",
"cordova-plugin-background-mode": "0.7.3",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-file-opener2": "^3.0.5",
@@ -18,10 +17,10 @@
},
"devDependencies": {
"@globules-io/cordova-plugin-ios-xhr": "^1.0.4",
- "bamboo.cordova.plugin.downloader": "git+https://github.com/sytolk/cordova-plugin-downloader.git",
+ "bamboo.cordova.plugin.downloader": "github:sytolk/cordova-plugin-downloader",
"com-darryncampbell-cordova-plugin-intent": "^2.0.0",
"cordova-android": "^9.1.0",
- "cordova-ios": "^6.2.0",
+ "cordova-ios": "^8.0.0",
"cordova-ourcodeworld-filebrowser": "git+https://github.com/muhammed-noufal/cordova-ourcodeworld-filebrowser.git",
"cordova-plugin-androidx": "^3.0.0",
"cordova-plugin-androidx-adapter": "^1.1.3",
@@ -86,6 +85,7 @@
"version": "0.8.11",
"resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.11.tgz",
"integrity": "sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==",
+ "dev": true,
"license": "MIT",
"engines": {
"node": ">=10.0.0"
@@ -143,12 +143,12 @@
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+ "dev": true
},
"node_modules/bamboo.cordova.plugin.downloader": {
"version": "1.0.0",
"resolved": "git+ssh://[email protected]/sytolk/cordova-plugin-downloader.git#f4d59a2957a6e1b549634f5e3ba8c7d4898c1396",
- "integrity": "sha512-gz7gxh0yERe7te5Tt+dhdSFpT8QoRqEjvbYBaVfq7P0DV1RM7F+QmupVkWq/fJ9SU8LNrk5pIxx1jS+qA5popQ==",
"dev": true,
"engines": [
{
@@ -162,6 +162,7 @@
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "dev": true,
"funding": [
{
"type": "github",
@@ -181,6 +182,7 @@
"version": "1.6.48",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz",
"integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==",
+ "dev": true,
"engines": {
"node": ">=0.6"
}
@@ -189,6 +191,7 @@
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz",
"integrity": "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"stream-buffers": "2.2.x"
@@ -210,6 +213,7 @@
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0",
@@ -238,7 +242,8 @@
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
},
"node_modules/cordova-android": {
"version": "9.1.0",
@@ -303,39 +308,152 @@
}
},
"node_modules/cordova-ios": {
- "version": "6.2.0",
- "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-6.2.0.tgz",
- "integrity": "sha512-sLjZg2QBI1SpQVwfe0MSn89YNVkBGLW9Q1vcFJBsqKBrhvoEOJ5Ytq0gwqdhgTOGzlwJUfxC6OHM3jcsRjtYrw==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-8.0.0.tgz",
+ "integrity": "sha512-QsynOV8rnRIhDC3qwM1KdRr1gy5RaqzVCzdOaB+DSBPeR5wVEUGpyyJO0FzlCACzY5X25iDc5O3kbn/F06dJ5Q==",
"dev": true,
+ "license": "Apache-2.0",
"dependencies": {
- "cordova-common": "^4.0.2",
- "fs-extra": "^9.1.0",
- "ios-sim": "^8.0.2",
- "nopt": "^5.0.0",
- "plist": "^3.0.1",
- "semver": "^7.3.4",
- "unorm": "^1.6.0",
- "which": "^2.0.2",
- "xcode": "^3.0.1",
- "xml-escape": "^1.1.0"
+ "bplist-parser": "^0.3.2",
+ "cordova-common": "^6.0.0",
+ "elementtree": "^0.1.7",
+ "execa": "^5.1.1",
+ "nopt": "^9.0.0",
+ "plist": "^3.1.0",
+ "semver": "^7.7.3",
+ "simctl": "^3.0.0",
+ "which": "^6.0.0",
+ "xcode": "^3.0.1"
+ },
+ "engines": {
+ "node": "^20.17.0 || >=22.9.0"
+ }
+ },
+ "node_modules/cordova-ios/node_modules/abbrev": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-4.0.0.tgz",
+ "integrity": "sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": "^20.17.0 || >=22.9.0"
+ }
+ },
+ "node_modules/cordova-ios/node_modules/bplist-parser": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.2.tgz",
+ "integrity": "sha512-apC2+fspHGI3mMKj+dGevkGo/tCqVB8jMb6i+OX+E29p0Iposz07fABkRIfVUPNd5A5VbuOz1bZbnmkKLYF+wQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "big-integer": "1.6.x"
+ },
+ "engines": {
+ "node": ">= 5.10.0"
+ }
+ },
+ "node_modules/cordova-ios/node_modules/cordova-common": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-6.0.0.tgz",
+ "integrity": "sha512-16WPC1DuxVdshV3RoQUXqhcJVdhxWGwiFysA4TkYuboqoev6mgt0JuIJFxmQbzR/DuyuONaVe0L0O0Hf1C08Mg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@netflix/nerror": "^1.1.3",
+ "ansi": "^0.3.1",
+ "bplist-parser": "^0.3.2",
+ "elementtree": "^0.1.7",
+ "endent": "^2.1.0",
+ "fast-glob": "^3.3.3",
+ "plist": "^3.1.0"
},
+ "engines": {
+ "node": ">=20.9.0"
+ }
+ },
+ "node_modules/cordova-ios/node_modules/endent": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/endent/-/endent-2.1.0.tgz",
+ "integrity": "sha512-r8VyPX7XL8U01Xgnb1CjZ3XV+z90cXIJ9JPE/R9SEC9vpw2P6CfsRPJmp20DppC5N7ZAMCmjYkJIa744Iyg96w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "dedent": "^0.7.0",
+ "fast-json-parse": "^1.0.3",
+ "objectorarray": "^1.0.5"
+ }
+ },
+ "node_modules/cordova-ios/node_modules/execa": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cross-spawn": "^7.0.3",
+ "get-stream": "^6.0.0",
+ "human-signals": "^2.1.0",
+ "is-stream": "^2.0.0",
+ "merge-stream": "^2.0.0",
+ "npm-run-path": "^4.0.1",
+ "onetime": "^5.1.2",
+ "signal-exit": "^3.0.3",
+ "strip-final-newline": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
+ }
+ },
+ "node_modules/cordova-ios/node_modules/get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "dev": true,
+ "license": "MIT",
"engines": {
"node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cordova-ios/node_modules/human-signals": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=10.17.0"
+ }
+ },
+ "node_modules/cordova-ios/node_modules/isexe": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-4.0.0.tgz",
+ "integrity": "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "engines": {
+ "node": ">=20"
}
},
"node_modules/cordova-ios/node_modules/nopt": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
- "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==",
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-9.0.0.tgz",
+ "integrity": "sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==",
"dev": true,
+ "license": "ISC",
"dependencies": {
- "abbrev": "1"
+ "abbrev": "^4.0.0"
},
"bin": {
"nopt": "bin/nopt.js"
},
"engines": {
- "node": ">=6"
+ "node": "^20.17.0 || >=22.9.0"
}
},
"node_modules/cordova-ios/node_modules/semver": {
@@ -356,15 +474,33 @@
"resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz",
"integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==",
"dev": true,
+ "license": "MIT",
"bin": {
"uuid": "dist/bin/uuid"
}
},
+ "node_modules/cordova-ios/node_modules/which": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-6.0.1.tgz",
+ "integrity": "sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "isexe": "^4.0.0"
+ },
+ "bin": {
+ "node-which": "bin/which.js"
+ },
+ "engines": {
+ "node": "^20.17.0 || >=22.9.0"
+ }
+ },
"node_modules/cordova-ios/node_modules/xcode": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz",
"integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==",
"dev": true,
+ "license": "Apache-2.0",
"dependencies": {
"simple-plist": "^1.1.0",
"uuid": "^7.0.3"
@@ -380,16 +516,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/cordova-plugin-add-swift-support": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/cordova-plugin-add-swift-support/-/cordova-plugin-add-swift-support-2.0.2.tgz",
- "integrity": "sha512-K03WDnsD3GT+n7Od3BnS17D8rYnAFZbZjjQJa2r7qW8QLq8+h7hGbFaiF+w5+nUtyAqUNq+HT/d/MdqBGLNzxA==",
- "dependencies": {
- "glob": "^7.1.3",
- "semver": "^6.0.0",
- "xcode": "^2.0.0"
- }
- },
"node_modules/cordova-plugin-androidx": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cordova-plugin-androidx/-/cordova-plugin-androidx-3.0.0.tgz",
@@ -604,19 +730,20 @@
]
},
"node_modules/fast-glob": {
- "version": "3.2.6",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.6.tgz",
- "integrity": "sha512-GnLuqj/pvQ7pX8/L4J84nijv6sAnlwvSDpMkJi9i7nPmPxGtRPkBSStfvDW5l6nMdX9VWe+pkKWFTgD+vF2QSQ==",
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
+ "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.2",
"merge2": "^1.3.0",
- "micromatch": "^4.0.4"
+ "micromatch": "^4.0.8"
},
"engines": {
- "node": ">=8"
+ "node": ">=8.6.0"
}
},
"node_modules/fast-json-parse": {
@@ -665,17 +792,8 @@
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
- },
- "node_modules/function-bind": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
- "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
- "dev": true,
- "license": "MIT",
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+ "dev": true
},
"node_modules/get-stream": {
"version": "5.2.0",
@@ -696,6 +814,7 @@
"version": "7.1.7",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
"integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+ "dev": true,
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
@@ -729,19 +848,6 @@
"integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==",
"dev": true
},
- "node_modules/hasown": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
- "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "function-bind": "^1.1.2"
- },
- "engines": {
- "node": ">= 0.4"
- }
- },
"node_modules/human-signals": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz",
@@ -755,6 +861,7 @@
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "dev": true,
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
@@ -763,73 +870,9 @@
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
- },
- "node_modules/interpret": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
- "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 0.10"
- }
- },
- "node_modules/ios-sim": {
- "version": "8.0.2",
- "resolved": "https://registry.npmjs.org/ios-sim/-/ios-sim-8.0.2.tgz",
- "integrity": "sha512-P7nEG771bfd+JoMRjnis1gpZOkjTUUxu+4Ek1Z+eoaEEoT9byllU9pxfQ8Df7hL3gSkIQxNwTSLhos2I8tWUQA==",
- "dev": true,
- "dependencies": {
- "bplist-parser": "^0.0.6",
- "nopt": "1.0.9",
- "plist": "^3.0.1",
- "simctl": "^2"
- },
- "bin": {
- "ios-sim": "bin/ios-sim"
- },
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/ios-sim/node_modules/bplist-parser": {
- "version": "0.0.6",
- "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.0.6.tgz",
- "integrity": "sha1-ONo0cYF9+dRKs4kuJ3B7u9daEbk=",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
- "node_modules/ios-sim/node_modules/nopt": {
- "version": "1.0.9",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.9.tgz",
- "integrity": "sha1-O8DXy6e/sNWmdtvtfA6+SKT9RU4=",
- "dev": true,
- "dependencies": {
- "abbrev": "1"
- },
- "bin": {
- "nopt": "bin/nopt.js"
- },
- "engines": {
- "node": "*"
- }
- },
- "node_modules/is-core-module": {
- "version": "2.16.1",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
- "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "hasown": "^2.0.2"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
"node_modules/is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
@@ -946,6 +989,7 @@
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.4.tgz",
"integrity": "sha512-twmL+S8+7yIsE9wsqgzU3E8/LumN3M3QELrBZ20OdmQ9jB2JvW5oZtBEmft84k/Gs5CG9mqtWc6Y9vW+JEzGxw==",
+ "dev": true,
"license": "ISC",
"dependencies": {
"brace-expansion": "^1.1.7"
@@ -989,6 +1033,7 @@
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "dev": true,
"dependencies": {
"wrappy": "1"
}
@@ -1058,6 +1103,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "dev": true,
"engines": {
"node": ">=0.10.0"
}
@@ -1071,13 +1117,6 @@
"node": ">=8"
}
},
- "node_modules/path-parse": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
- "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
@@ -1104,6 +1143,7 @@
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz",
"integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@xmldom/xmldom": "^0.8.8",
@@ -1179,18 +1219,6 @@
"node": ">=6"
}
},
- "node_modules/rechoir": {
- "version": "0.6.2",
- "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
- "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==",
- "dev": true,
- "dependencies": {
- "resolve": "^1.1.6"
- },
- "engines": {
- "node": ">= 0.10"
- }
- },
"node_modules/recursive-readdir": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz",
@@ -1204,27 +1232,6 @@
"node": ">=6.0.0"
}
},
- "node_modules/resolve": {
- "version": "1.22.11",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz",
- "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "is-core-module": "^2.16.1",
- "path-parse": "^1.0.7",
- "supports-preserve-symlinks-flag": "^1.0.0"
- },
- "bin": {
- "resolve": "bin/resolve"
- },
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
"node_modules/reusify": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
@@ -1264,15 +1271,6 @@
"integrity": "sha1-dLbTPJrh4AFRDxeakRaFiPGu2qk=",
"dev": true
},
- "node_modules/semver": {
- "version": "6.3.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
- "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
- "license": "ISC",
- "bin": {
- "semver": "bin/semver.js"
- }
- },
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@@ -1294,24 +1292,6 @@
"node": ">=8"
}
},
- "node_modules/shelljs": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz",
- "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==",
- "dev": true,
- "license": "BSD-3-Clause",
- "dependencies": {
- "glob": "^7.0.0",
- "interpret": "^1.0.0",
- "rechoir": "^0.6.2"
- },
- "bin": {
- "shjs": "bin/shjs"
- },
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
@@ -1319,20 +1299,20 @@
"dev": true
},
"node_modules/simctl": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/simctl/-/simctl-2.0.3.tgz",
- "integrity": "sha512-kKCak0yszxHae5eVWcmrjV3ouUGac3sjlhjdLWpyPu4eiQcWoHsCrqS34kkgzHN8Ystqkh/LFjzrldk/g3BYJg==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/simctl/-/simctl-3.0.0.tgz",
+ "integrity": "sha512-AoScwFvWCLU7lx9AlqmooHlxQDQDjGdSGAdyLySDeR2IP6ji5L4Z6DdHxmBLAQM61ftaHylXfnF1KWCR56P58w==",
"dev": true,
"license": "MIT",
- "dependencies": {
- "shelljs": "^0.8.5",
- "tail": "^0.4.0"
+ "engines": {
+ "node": ">= 14.17.0"
}
},
"node_modules/simple-plist": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz",
"integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"bplist-creator": "0.1.0",
@@ -1344,6 +1324,7 @@
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz",
"integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"big-integer": "1.6.x"
@@ -1356,6 +1337,7 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz",
"integrity": "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==",
+ "dev": true,
"license": "Unlicense",
"engines": {
"node": ">= 0.10.0"
@@ -1385,28 +1367,6 @@
"node": ">=6"
}
},
- "node_modules/supports-preserve-symlinks-flag": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
- "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 0.4"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
- "node_modules/tail": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/tail/-/tail-0.4.0.tgz",
- "integrity": "sha1-0p3nJ1DMmdseBTr/E8NZ7PtxMAI=",
- "dev": true,
- "engines": {
- "node": ">= 0.4.0"
- }
- },
"node_modules/to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
@@ -1435,24 +1395,6 @@
"node": ">= 10.0.0"
}
},
- "node_modules/unorm": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
- "integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==",
- "dev": true,
- "engines": {
- "node": ">= 0.4.0"
- }
- },
- "node_modules/uuid": {
- "version": "3.4.0",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
- "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
- "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.",
- "bin": {
- "uuid": "bin/uuid"
- }
- },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
@@ -1485,30 +1427,14 @@
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
- },
- "node_modules/xcode": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/xcode/-/xcode-2.1.0.tgz",
- "integrity": "sha512-uCrmPITrqTEzhn0TtT57fJaNaw8YJs1aCzs+P/QqxsDbvPZSv7XMPPwXrKvHtD6pLjBM/NaVwraWJm8q83Y4iQ==",
- "dependencies": {
- "simple-plist": "^1.0.0",
- "uuid": "^3.3.2"
- },
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/xml-escape": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/xml-escape/-/xml-escape-1.1.0.tgz",
- "integrity": "sha1-OQTBQ/qOs6ADDsZG0pAqLxtwbEQ=",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
},
"node_modules/xmlbuilder": {
"version": "15.1.1",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz",
"integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==",
+ "dev": true,
"license": "MIT",
"engines": {
"node": ">=8.0"
@@ -1562,7 +1488,8 @@
"@xmldom/xmldom": {
"version": "0.8.11",
"resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.11.tgz",
- "integrity": "sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw=="
+ "integrity": "sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==",
+ "dev": true
},
"abbrev": {
"version": "1.1.1",
@@ -1608,28 +1535,31 @@
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
- "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+ "dev": true
},
"bamboo.cordova.plugin.downloader": {
"version": "git+ssh://[email protected]/sytolk/cordova-plugin-downloader.git#f4d59a2957a6e1b549634f5e3ba8c7d4898c1396",
- "integrity": "sha512-gz7gxh0yERe7te5Tt+dhdSFpT8QoRqEjvbYBaVfq7P0DV1RM7F+QmupVkWq/fJ9SU8LNrk5pIxx1jS+qA5popQ==",
"dev": true,
- "from": "bamboo.cordova.plugin.downloader@git+https://github.com/sytolk/cordova-plugin-downloader.git"
+ "from": "bamboo.cordova.plugin.downloader@github:sytolk/cordova-plugin-downloader"
},
"base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
- "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "dev": true
},
"big-integer": {
"version": "1.6.48",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz",
- "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w=="
+ "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==",
+ "dev": true
},
"bplist-creator": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz",
"integrity": "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==",
+ "dev": true,
"requires": {
"stream-buffers": "2.2.x"
}
@@ -1647,6 +1577,7 @@
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
+ "dev": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -1670,7 +1601,8 @@
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
},
"cordova-android": {
"version": "9.1.0",
@@ -1721,30 +1653,106 @@
}
},
"cordova-ios": {
- "version": "6.2.0",
- "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-6.2.0.tgz",
- "integrity": "sha512-sLjZg2QBI1SpQVwfe0MSn89YNVkBGLW9Q1vcFJBsqKBrhvoEOJ5Ytq0gwqdhgTOGzlwJUfxC6OHM3jcsRjtYrw==",
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-8.0.0.tgz",
+ "integrity": "sha512-QsynOV8rnRIhDC3qwM1KdRr1gy5RaqzVCzdOaB+DSBPeR5wVEUGpyyJO0FzlCACzY5X25iDc5O3kbn/F06dJ5Q==",
"dev": true,
"requires": {
- "cordova-common": "^4.0.2",
- "fs-extra": "^9.1.0",
- "ios-sim": "^8.0.2",
- "nopt": "^5.0.0",
- "plist": "^3.0.1",
- "semver": "^7.3.4",
- "unorm": "^1.6.0",
- "which": "^2.0.2",
- "xcode": "^3.0.1",
- "xml-escape": "^1.1.0"
- },
- "dependencies": {
+ "bplist-parser": "^0.3.2",
+ "cordova-common": "^6.0.0",
+ "elementtree": "^0.1.7",
+ "execa": "^5.1.1",
+ "nopt": "^9.0.0",
+ "plist": "^3.1.0",
+ "semver": "^7.7.3",
+ "simctl": "^3.0.0",
+ "which": "^6.0.0",
+ "xcode": "^3.0.1"
+ },
+ "dependencies": {
+ "abbrev": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-4.0.0.tgz",
+ "integrity": "sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==",
+ "dev": true
+ },
+ "bplist-parser": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.2.tgz",
+ "integrity": "sha512-apC2+fspHGI3mMKj+dGevkGo/tCqVB8jMb6i+OX+E29p0Iposz07fABkRIfVUPNd5A5VbuOz1bZbnmkKLYF+wQ==",
+ "dev": true,
+ "requires": {
+ "big-integer": "1.6.x"
+ }
+ },
+ "cordova-common": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-6.0.0.tgz",
+ "integrity": "sha512-16WPC1DuxVdshV3RoQUXqhcJVdhxWGwiFysA4TkYuboqoev6mgt0JuIJFxmQbzR/DuyuONaVe0L0O0Hf1C08Mg==",
+ "dev": true,
+ "requires": {
+ "@netflix/nerror": "^1.1.3",
+ "ansi": "^0.3.1",
+ "bplist-parser": "^0.3.2",
+ "elementtree": "^0.1.7",
+ "endent": "^2.1.0",
+ "fast-glob": "^3.3.3",
+ "plist": "^3.1.0"
+ }
+ },
+ "endent": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/endent/-/endent-2.1.0.tgz",
+ "integrity": "sha512-r8VyPX7XL8U01Xgnb1CjZ3XV+z90cXIJ9JPE/R9SEC9vpw2P6CfsRPJmp20DppC5N7ZAMCmjYkJIa744Iyg96w==",
+ "dev": true,
+ "requires": {
+ "dedent": "^0.7.0",
+ "fast-json-parse": "^1.0.3",
+ "objectorarray": "^1.0.5"
+ }
+ },
+ "execa": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
+ "dev": true,
+ "requires": {
+ "cross-spawn": "^7.0.3",
+ "get-stream": "^6.0.0",
+ "human-signals": "^2.1.0",
+ "is-stream": "^2.0.0",
+ "merge-stream": "^2.0.0",
+ "npm-run-path": "^4.0.1",
+ "onetime": "^5.1.2",
+ "signal-exit": "^3.0.3",
+ "strip-final-newline": "^2.0.0"
+ }
+ },
+ "get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "dev": true
+ },
+ "human-signals": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
+ "dev": true
+ },
+ "isexe": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-4.0.0.tgz",
+ "integrity": "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==",
+ "dev": true
+ },
"nopt": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
- "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==",
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-9.0.0.tgz",
+ "integrity": "sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==",
"dev": true,
"requires": {
- "abbrev": "1"
+ "abbrev": "^4.0.0"
}
},
"semver": {
@@ -1759,6 +1767,15 @@
"integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==",
"dev": true
},
+ "which": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/which/-/which-6.0.1.tgz",
+ "integrity": "sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==",
+ "dev": true,
+ "requires": {
+ "isexe": "^4.0.0"
+ }
+ },
"xcode": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz",
@@ -1777,16 +1794,6 @@
"dev": true,
"from": "cordova-ourcodeworld-filebrowser@git+https://github.com/muhammed-noufal/cordova-ourcodeworld-filebrowser.git"
},
- "cordova-plugin-add-swift-support": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/cordova-plugin-add-swift-support/-/cordova-plugin-add-swift-support-2.0.2.tgz",
- "integrity": "sha512-K03WDnsD3GT+n7Od3BnS17D8rYnAFZbZjjQJa2r7qW8QLq8+h7hGbFaiF+w5+nUtyAqUNq+HT/d/MdqBGLNzxA==",
- "requires": {
- "glob": "^7.1.3",
- "semver": "^6.0.0",
- "xcode": "^2.0.0"
- }
- },
"cordova-plugin-androidx": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cordova-plugin-androidx/-/cordova-plugin-androidx-3.0.0.tgz",
@@ -1916,16 +1923,16 @@
"dev": true
},
"fast-glob": {
- "version": "3.2.6",
- "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.6.tgz",
- "integrity": "sha512-GnLuqj/pvQ7pX8/L4J84nijv6sAnlwvSDpMkJi9i7nPmPxGtRPkBSStfvDW5l6nMdX9VWe+pkKWFTgD+vF2QSQ==",
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
+ "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
"dev": true,
"requires": {
"@nodelib/fs.stat": "^2.0.2",
"@nodelib/fs.walk": "^1.2.3",
"glob-parent": "^5.1.2",
"merge2": "^1.3.0",
- "micromatch": "^4.0.4"
+ "micromatch": "^4.0.8"
}
},
"fast-json-parse": {
@@ -1967,12 +1974,7 @@
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
- "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
- },
- "function-bind": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
- "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"get-stream": {
@@ -1988,6 +1990,7 @@
"version": "7.1.7",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
"integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+ "dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
@@ -2012,15 +2015,6 @@
"integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==",
"dev": true
},
- "hasown": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
- "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
- "dev": true,
- "requires": {
- "function-bind": "^1.1.2"
- }
- },
"human-signals": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz",
@@ -2031,6 +2025,7 @@
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "dev": true,
"requires": {
"once": "^1.3.0",
"wrappy": "1"
@@ -2039,52 +2034,9 @@
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
- "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
- },
- "interpret": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
- "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"dev": true
},
- "ios-sim": {
- "version": "8.0.2",
- "resolved": "https://registry.npmjs.org/ios-sim/-/ios-sim-8.0.2.tgz",
- "integrity": "sha512-P7nEG771bfd+JoMRjnis1gpZOkjTUUxu+4Ek1Z+eoaEEoT9byllU9pxfQ8Df7hL3gSkIQxNwTSLhos2I8tWUQA==",
- "dev": true,
- "requires": {
- "bplist-parser": "^0.0.6",
- "nopt": "1.0.9",
- "plist": "^3.0.1",
- "simctl": "^2"
- },
- "dependencies": {
- "bplist-parser": {
- "version": "0.0.6",
- "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.0.6.tgz",
- "integrity": "sha1-ONo0cYF9+dRKs4kuJ3B7u9daEbk=",
- "dev": true
- },
- "nopt": {
- "version": "1.0.9",
- "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.9.tgz",
- "integrity": "sha1-O8DXy6e/sNWmdtvtfA6+SKT9RU4=",
- "dev": true,
- "requires": {
- "abbrev": "1"
- }
- }
- }
- },
- "is-core-module": {
- "version": "2.16.1",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz",
- "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==",
- "dev": true,
- "requires": {
- "hasown": "^2.0.2"
- }
- },
"is-extglob": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
@@ -2172,6 +2124,7 @@
"version": "3.1.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.4.tgz",
"integrity": "sha512-twmL+S8+7yIsE9wsqgzU3E8/LumN3M3QELrBZ20OdmQ9jB2JvW5oZtBEmft84k/Gs5CG9mqtWc6Y9vW+JEzGxw==",
+ "dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -2205,6 +2158,7 @@
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "dev": true,
"requires": {
"wrappy": "1"
}
@@ -2255,7 +2209,8 @@
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
- "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "dev": true
},
"path-key": {
"version": "3.1.1",
@@ -2263,12 +2218,6 @@
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true
},
- "path-parse": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
- "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
- "dev": true
- },
"picomatch": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
@@ -2285,6 +2234,7 @@
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz",
"integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==",
+ "dev": true,
"requires": {
"@xmldom/xmldom": "^0.8.8",
"base64-js": "^1.5.1",
@@ -2332,15 +2282,6 @@
"with-open-file": "^0.1.6"
}
},
- "rechoir": {
- "version": "0.6.2",
- "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
- "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==",
- "dev": true,
- "requires": {
- "resolve": "^1.1.6"
- }
- },
"recursive-readdir": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz",
@@ -2350,17 +2291,6 @@
"minimatch": "^3.0.5"
}
},
- "resolve": {
- "version": "1.22.11",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz",
- "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==",
- "dev": true,
- "requires": {
- "is-core-module": "^2.16.1",
- "path-parse": "^1.0.7",
- "supports-preserve-symlinks-flag": "^1.0.0"
- }
- },
"reusify": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
@@ -2382,11 +2312,6 @@
"integrity": "sha1-dLbTPJrh4AFRDxeakRaFiPGu2qk=",
"dev": true
},
- "semver": {
- "version": "6.3.1",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
- "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="
- },
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@@ -2402,17 +2327,6 @@
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
- "shelljs": {
- "version": "0.8.5",
- "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz",
- "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==",
- "dev": true,
- "requires": {
- "glob": "^7.0.0",
- "interpret": "^1.0.0",
- "rechoir": "^0.6.2"
- }
- },
"signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
@@ -2420,19 +2334,16 @@
"dev": true
},
"simctl": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/simctl/-/simctl-2.0.3.tgz",
- "integrity": "sha512-kKCak0yszxHae5eVWcmrjV3ouUGac3sjlhjdLWpyPu4eiQcWoHsCrqS34kkgzHN8Ystqkh/LFjzrldk/g3BYJg==",
- "dev": true,
- "requires": {
- "shelljs": "^0.8.5",
- "tail": "^0.4.0"
- }
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/simctl/-/simctl-3.0.0.tgz",
+ "integrity": "sha512-AoScwFvWCLU7lx9AlqmooHlxQDQDjGdSGAdyLySDeR2IP6ji5L4Z6DdHxmBLAQM61ftaHylXfnF1KWCR56P58w==",
+ "dev": true
},
"simple-plist": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz",
"integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==",
+ "dev": true,
"requires": {
"bplist-creator": "0.1.0",
"bplist-parser": "0.3.1",
@@ -2443,6 +2354,7 @@
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz",
"integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==",
+ "dev": true,
"requires": {
"big-integer": "1.6.x"
}
@@ -2452,7 +2364,8 @@
"stream-buffers": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz",
- "integrity": "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg=="
+ "integrity": "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==",
+ "dev": true
},
"string.prototype.codepointat": {
"version": "0.2.1",
@@ -2472,18 +2385,6 @@
"integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
"dev": true
},
- "supports-preserve-symlinks-flag": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
- "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
- "dev": true
- },
- "tail": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/tail/-/tail-0.4.0.tgz",
- "integrity": "sha1-0p3nJ1DMmdseBTr/E8NZ7PtxMAI=",
- "dev": true
- },
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
@@ -2505,17 +2406,6 @@
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"dev": true
},
- "unorm": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
- "integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==",
- "dev": true
- },
- "uuid": {
- "version": "3.4.0",
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
- "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
- },
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
@@ -2539,27 +2429,14 @@
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
- "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
- },
- "xcode": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/xcode/-/xcode-2.1.0.tgz",
- "integrity": "sha512-uCrmPITrqTEzhn0TtT57fJaNaw8YJs1aCzs+P/QqxsDbvPZSv7XMPPwXrKvHtD6pLjBM/NaVwraWJm8q83Y4iQ==",
- "requires": {
- "simple-plist": "^1.0.0",
- "uuid": "^3.3.2"
- }
- },
- "xml-escape": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/xml-escape/-/xml-escape-1.1.0.tgz",
- "integrity": "sha1-OQTBQ/qOs6ADDsZG0pAqLxtwbEQ=",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
},
"xmlbuilder": {
"version": "15.1.1",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz",
- "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg=="
+ "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==",
+ "dev": true
}
}
}
diff --git a/cordova/package.json b/cordova/package.json
index 0f297c4b8..eddfed02a 100644
--- a/cordova/package.json
+++ b/cordova/package.json
@@ -10,7 +10,6 @@
"author": "Apache Cordova Team",
"license": "Apache-2.0",
"dependencies": {
- "cordova-plugin-add-swift-support": "2.0.2",
"cordova-plugin-background-mode": "0.7.3",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-file-opener2": "^3.0.5",
@@ -36,21 +35,21 @@
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-androidx-adapter": {},
- "cordova-plugin-add-swift-support": {},
"com-darryncampbell-cordova-plugin-intent": {},
- "cordova-plugin-androidx": {}
+ "cordova-plugin-androidx": {},
+ "com.whebcraft.cordova.plugin.downloader": {}
},
"platforms": [
- "ios",
- "android"
+ "android",
+ "ios"
]
},
"devDependencies": {
"@globules-io/cordova-plugin-ios-xhr": "^1.0.4",
- "bamboo.cordova.plugin.downloader": "git+https://github.com/sytolk/cordova-plugin-downloader.git",
+ "bamboo.cordova.plugin.downloader": "github:sytolk/cordova-plugin-downloader",
"com-darryncampbell-cordova-plugin-intent": "^2.0.0",
"cordova-android": "^9.1.0",
- "cordova-ios": "^6.2.0",
+ "cordova-ios": "^8.0.0",
"cordova-ourcodeworld-filebrowser": "git+https://github.com/muhammed-noufal/cordova-ourcodeworld-filebrowser.git",
"cordova-plugin-androidx": "^3.0.0",
"cordova-plugin-androidx-adapter": "^1.1.3",
diff --git a/cordova/platforms/android/android.json b/cordova/platforms/android/android.json
index 794b064a1..fd1d455cb 100644
--- a/cordova/platforms/android/android.json
+++ b/cordova/platforms/android/android.json
@@ -167,9 +167,6 @@
"com.whebcraft.cordova.plugin.downloader": {
"PACKAGE_NAME": "org.tagspaces.mobileapp"
},
- "cordova-plugin-add-swift-support": {
- "PACKAGE_NAME": "org.tagspaces.mobileapp"
- },
"cordova-plugin-androidx-adapter": {
"PACKAGE_NAME": "org.tagspaces.mobileapp"
},
@@ -475,7 +472,6 @@
"com-darryncampbell-cordova-plugin-intent": "2.0.0",
"com.ourcodeworld.plugins.Filebrowser": "1.0.0",
"com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "cordova-plugin-add-swift-support": "2.0.2",
"cordova-plugin-androidx-adapter": "1.1.3",
"cordova-plugin-device": "2.0.3",
"cordova-plugin-background-mode": "0.7.3",
diff --git a/cordova/platforms/ios/App.xcodeproj/project.pbxproj b/cordova/platforms/ios/App.xcodeproj/project.pbxproj
new file mode 100755
index 000000000..39acab319
--- /dev/null
+++ b/cordova/platforms/ios/App.xcodeproj/project.pbxproj
@@ -0,0 +1,636 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 60;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 907F98562C06B87200D2D242 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 907F98552C06B87200D2D242 /* PrivacyInfo.xcprivacy */; };
+ 907F98662C06BC1B00D2D242 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 907F98652C06BC1B00D2D242 /* config.xml */; };
+ 907F986A2C06BCD300D2D242 /* www in Resources */ = {isa = PBXBuildFile; fileRef = 907F98692C06BCD300D2D242 /* www */; };
+ 90A914592CA3D370003DB979 /* Cordova in Frameworks */ = {isa = PBXBuildFile; productRef = 90A914582CA3D370003DB979 /* Cordova */; };
+ 90BD9B7A2C06907D000DEBAB /* Base in Resources */ = {isa = PBXBuildFile; fileRef = 90BD9B792C06907D000DEBAB /* Base */; };
+ 90BD9B7C2C06907E000DEBAB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 90BD9B7B2C06907E000DEBAB /* Assets.xcassets */; };
+ 90BD9B7F2C06907E000DEBAB /* Base in Resources */ = {isa = PBXBuildFile; fileRef = 90BD9B7E2C06907E000DEBAB /* Base */; };
+ 90CBB5282C06968500B805A2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90CBB5272C06968500B805A2 /* AppDelegate.swift */; };
+ 90CBB52A2C06968500B805A2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90CBB5292C06968500B805A2 /* SceneDelegate.swift */; };
+ 90CBB52C2C06968500B805A2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90CBB52B2C06968500B805A2 /* ViewController.swift */; };
+ 90D82ABD2CF19AEA001383CF /* CordovaPlugins in Frameworks */ = {isa = PBXBuildFile; productRef = 90D82ABC2CF19AEA001383CF /* CordovaPlugins */; };
+ 8B6D746AB6784BBDBD1FDB5C /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = F08A211998CB4C9CAA7B0B1E /* Downloader.swift */; };
+ 5EE7AF17F1814EAA9DB9B632 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = F6D2E458CF444CDCACBB29A7 /* CDVDevice.m */; };
+ 7AC77B4ED7024E9399B4AEBB /* APPBackgroundMode.m in Sources */ = {isa = PBXBuildFile; fileRef = B5AD53E5FD924993A288DAF8 /* APPBackgroundMode.m */; };
+ 3921269DA02C4B359E4C3021 /* APPMethodMagic.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CA5E14DF9884624B3817506 /* APPMethodMagic.m */; };
+ 97C4D801879447A9A49795F4 /* appbeep.wav in Resources */ = {isa = PBXBuildFile; fileRef = EADE3DA7D3A847D1A388413D /* appbeep.wav */; };
+ 4550856B9FB84DAAAC08AB97 /* CDVFile.m in Sources */ = {isa = PBXBuildFile; fileRef = D93579623C1A4451B27262FF /* CDVFile.m */; };
+ 7C421B76F2FF46C195223500 /* CDVLocalFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = AC07D5F062E24FAAA7469A58 /* CDVLocalFilesystem.m */; };
+ 1ED5D70524C94EE1958772C8 /* CDVAssetLibraryFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 056915956BD4456FB9EADED5 /* CDVAssetLibraryFilesystem.m */; };
+ 7BBD621DCB904C6EB1D4C3BC /* FileOpener2.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B9A8D5D4BEF4488B802F06B /* FileOpener2.m */; };
+ 32E8E41ED89B40D2BE58D24D /* NSString+SSURLEncoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 6623E5A56C4749DEB5D2AB2C /* NSString+SSURLEncoding.m */; };
+ 0645FB225CEA45DBA045E1B0 /* SocialSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D2AE4D4F0934D68904B9100 /* SocialSharing.m */; };
+ CE71D7FE969C408EAC23A1FD /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E181E201B5D34148971AB055 /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 191ACBE97BD049598C9FD160 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E5DF15065E8A4AD99BF7885C /* MessageUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ AA70162D431645389AC4E8C8 /* UIImage+CropScaleOrientation.m in Sources */ = {isa = PBXBuildFile; fileRef = 79408A8909D447A3B71E3A37 /* UIImage+CropScaleOrientation.m */; };
+ 1BE83F16BCB64DF1B6F55046 /* CDVCamera.m in Sources */ = {isa = PBXBuildFile; fileRef = BEBBDA6A98E04CD0A7B766E9 /* CDVCamera.m */; };
+ E0B1AB6529D842688A1974D6 /* CDVJpegHeaderWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 5072190018BB418ABC2FE2CE /* CDVJpegHeaderWriter.m */; };
+ E09C94120362409D8F27D833 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19FA584C297642399D8E9705 /* ImageIO.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
+ 3589191384F64C638E24E2CB /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C38C8E066424CE5BF6960C9 /* CoreLocation.framework */; };
+ 25F57262FB204B99B55314FB /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 770671E12B2C44D59330AA70 /* AVFoundation.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 902AE2152C6C059A0041150F /* Embed Frameworks */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 10;
+ files = (
+ );
+ name = "Embed Frameworks";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 9040B1872C6DD3EB00662C5D /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
+ 9040B1882C6DD41B00662C5D /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
+ 907F98552C06B87200D2D242 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
+ 907F98622C06B97000D2D242 /* Entitlements-Debug.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Entitlements-Debug.plist"; sourceTree = "<group>"; };
+ 907F98632C06B9C800D2D242 /* Entitlements-Release.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Entitlements-Release.plist"; sourceTree = "<group>"; };
+ 907F98652C06BC1B00D2D242 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = "<group>"; };
+ 907F98692C06BCD300D2D242 /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; };
+ 9080B40F2C6DD7EC00078F33 /* config.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
+ 90BD9B6C2C06907D000DEBAB /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 90BD9B792C06907D000DEBAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
+ 90BD9B7B2C06907E000DEBAB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
+ 90BD9B7E2C06907E000DEBAB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/CDVLaunchScreen.storyboard; sourceTree = "<group>"; };
+ 90BD9B802C06907E000DEBAB /* App-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "App-Info.plist"; sourceTree = "<group>"; };
+ 90CBB5272C06968500B805A2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
+ 90CBB5292C06968500B805A2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
+ 90CBB52B2C06968500B805A2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
+ 90EB303B2C6DD83300CEEB2F /* build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = build.xcconfig; path = cordova/build.xcconfig; sourceTree = SOURCE_ROOT; };
+ 90EB303C2C6DD83300CEEB2F /* build-extras.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-extras.xcconfig"; path = "cordova/build-extras.xcconfig"; sourceTree = SOURCE_ROOT; };
+ 90EB303F2C6DD87600CEEB2F /* build-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-debug.xcconfig"; path = "cordova/build-debug.xcconfig"; sourceTree = SOURCE_ROOT; };
+ 90EB30402C6DD87600CEEB2F /* build-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-release.xcconfig"; path = "cordova/build-release.xcconfig"; sourceTree = SOURCE_ROOT; };
+ 90F7E7002C6EB78900AD84C2 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
+ 90F7E7012C6EB78900AD84C2 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
+ F08A211998CB4C9CAA7B0B1E /* Downloader.swift */ = {isa = PBXFileReference; name = "Downloader.swift"; path = "com.whebcraft.cordova.plugin.downloader/Downloader.swift"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.swift; includeInIndex = 0; };
+ F6D2E458CF444CDCACBB29A7 /* CDVDevice.m */ = {isa = PBXFileReference; name = "CDVDevice.m"; path = "cordova-plugin-device/CDVDevice.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ 1579879C3824404F819A9E8F /* CDVDevice.h */ = {isa = PBXFileReference; name = "CDVDevice.h"; path = "cordova-plugin-device/CDVDevice.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ B5AD53E5FD924993A288DAF8 /* APPBackgroundMode.m */ = {isa = PBXFileReference; name = "APPBackgroundMode.m"; path = "cordova-plugin-background-mode/APPBackgroundMode.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ 3CA5E14DF9884624B3817506 /* APPMethodMagic.m */ = {isa = PBXFileReference; name = "APPMethodMagic.m"; path = "cordova-plugin-background-mode/APPMethodMagic.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ 910909FE259C453B9667FAC3 /* APPBackgroundMode.h */ = {isa = PBXFileReference; name = "APPBackgroundMode.h"; path = "cordova-plugin-background-mode/APPBackgroundMode.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ 53A55FEDB6A74B99A86BBDD8 /* APPMethodMagic.h */ = {isa = PBXFileReference; name = "APPMethodMagic.h"; path = "cordova-plugin-background-mode/APPMethodMagic.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ EADE3DA7D3A847D1A388413D /* appbeep.wav */ = {isa = PBXFileReference; name = "appbeep.wav"; path = "appbeep.wav"; sourceTree = "<group>"; lastKnownFileType = unknown; includeInIndex = 0; };
+ D93579623C1A4451B27262FF /* CDVFile.m */ = {isa = PBXFileReference; name = "CDVFile.m"; path = "cordova-plugin-file/CDVFile.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ AC07D5F062E24FAAA7469A58 /* CDVLocalFilesystem.m */ = {isa = PBXFileReference; name = "CDVLocalFilesystem.m"; path = "cordova-plugin-file/CDVLocalFilesystem.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ 056915956BD4456FB9EADED5 /* CDVAssetLibraryFilesystem.m */ = {isa = PBXFileReference; name = "CDVAssetLibraryFilesystem.m"; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ 74623D9AD29148A1B2E8EF5C /* CDVFile.h */ = {isa = PBXFileReference; name = "CDVFile.h"; path = "cordova-plugin-file/CDVFile.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ 37576CA46A7047ED9265AF58 /* CDVLocalFilesystem.h */ = {isa = PBXFileReference; name = "CDVLocalFilesystem.h"; path = "cordova-plugin-file/CDVLocalFilesystem.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ F762E469D4AE4C96B1093AF8 /* CDVAssetLibraryFilesystem.h */ = {isa = PBXFileReference; name = "CDVAssetLibraryFilesystem.h"; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ 2B9A8D5D4BEF4488B802F06B /* FileOpener2.m */ = {isa = PBXFileReference; name = "FileOpener2.m"; path = "cordova-plugin-file-opener2/FileOpener2.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ 30C096BE39254EA387829D33 /* FileOpener2.h */ = {isa = PBXFileReference; name = "FileOpener2.h"; path = "cordova-plugin-file-opener2/FileOpener2.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ 6623E5A56C4749DEB5D2AB2C /* NSString+SSURLEncoding.m */ = {isa = PBXFileReference; name = "NSString+SSURLEncoding.m"; path = "cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ 3D2AE4D4F0934D68904B9100 /* SocialSharing.m */ = {isa = PBXFileReference; name = "SocialSharing.m"; path = "cordova-plugin-x-socialsharing/SocialSharing.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ 4A11CC71BD4C4F878AE3232C /* NSString+SSURLEncoding.h */ = {isa = PBXFileReference; name = "NSString+SSURLEncoding.h"; path = "cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ 544B3072C77B4C1B8D7DF4D5 /* SocialSharing.h */ = {isa = PBXFileReference; name = "SocialSharing.h"; path = "cordova-plugin-x-socialsharing/SocialSharing.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ E181E201B5D34148971AB055 /* Social.framework */ = {isa = PBXFileReference; name = "Social.framework"; path = "System/Library/Frameworks/Social.framework"; sourceTree = SDKROOT; lastKnownFileType = wrapper.framework; includeInIndex = 0; };
+ E5DF15065E8A4AD99BF7885C /* MessageUI.framework */ = {isa = PBXFileReference; name = "MessageUI.framework"; path = "System/Library/Frameworks/MessageUI.framework"; sourceTree = SDKROOT; lastKnownFileType = wrapper.framework; includeInIndex = 0; };
+ 79408A8909D447A3B71E3A37 /* UIImage+CropScaleOrientation.m */ = {isa = PBXFileReference; name = "UIImage+CropScaleOrientation.m"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ BEBBDA6A98E04CD0A7B766E9 /* CDVCamera.m */ = {isa = PBXFileReference; name = "CDVCamera.m"; path = "cordova-plugin-camera/CDVCamera.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ 5072190018BB418ABC2FE2CE /* CDVJpegHeaderWriter.m */ = {isa = PBXFileReference; name = "CDVJpegHeaderWriter.m"; path = "cordova-plugin-camera/CDVJpegHeaderWriter.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; includeInIndex = 0; };
+ D8C16A6E22A04975950CED74 /* UIImage+CropScaleOrientation.h */ = {isa = PBXFileReference; name = "UIImage+CropScaleOrientation.h"; path = "cordova-plugin-camera/UIImage+CropScaleOrientation.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ 4B41B040A42E4840A98FC527 /* CDVCamera.h */ = {isa = PBXFileReference; name = "CDVCamera.h"; path = "cordova-plugin-camera/CDVCamera.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ ACAE658C7FE64932ACC0101B /* CDVJpegHeaderWriter.h */ = {isa = PBXFileReference; name = "CDVJpegHeaderWriter.h"; path = "cordova-plugin-camera/CDVJpegHeaderWriter.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ 76F264E800DC4D41A6F1F655 /* CDVExif.h */ = {isa = PBXFileReference; name = "CDVExif.h"; path = "cordova-plugin-camera/CDVExif.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; includeInIndex = 0; };
+ 19FA584C297642399D8E9705 /* ImageIO.framework */ = {isa = PBXFileReference; name = "ImageIO.framework"; path = "System/Library/Frameworks/ImageIO.framework"; sourceTree = SDKROOT; lastKnownFileType = wrapper.framework; includeInIndex = 0; };
+ 9C38C8E066424CE5BF6960C9 /* CoreLocation.framework */ = {isa = PBXFileReference; name = "CoreLocation.framework"; path = "System/Library/Frameworks/CoreLocation.framework"; sourceTree = SDKROOT; lastKnownFileType = wrapper.framework; includeInIndex = 0; };
+ 770671E12B2C44D59330AA70 /* AVFoundation.framework */ = {isa = PBXFileReference; name = "AVFoundation.framework"; path = "System/Library/Frameworks/AVFoundation.framework"; sourceTree = SDKROOT; lastKnownFileType = wrapper.framework; includeInIndex = 0; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 90BD9B692C06907D000DEBAB /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 90A914592CA3D370003DB979 /* Cordova in Frameworks */,
+ 90D82ABD2CF19AEA001383CF /* CordovaPlugins in Frameworks */,
+ CE71D7FE969C408EAC23A1FD /* Social.framework in Frameworks */,
+ 191ACBE97BD049598C9FD160 /* MessageUI.framework in Frameworks */,
+ E09C94120362409D8F27D833 /* ImageIO.framework in Frameworks */,
+ 3589191384F64C638E24E2CB /* CoreLocation.framework in Frameworks */,
+ 25F57262FB204B99B55314FB /* AVFoundation.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 905D2F6D2C6DDEE100117937 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ EADE3DA7D3A847D1A388413D /* appbeep.wav */,
+ );
+ path = Resources;
+ sourceTree = "<group>";
+ };
+ 907F98542C06B85800D2D242 /* Plugins */ = {
+ isa = PBXGroup;
+ children = (
+ F08A211998CB4C9CAA7B0B1E /* Downloader.swift */,
+ F6D2E458CF444CDCACBB29A7 /* CDVDevice.m */,
+ 1579879C3824404F819A9E8F /* CDVDevice.h */,
+ B5AD53E5FD924993A288DAF8 /* APPBackgroundMode.m */,
+ 3CA5E14DF9884624B3817506 /* APPMethodMagic.m */,
+ 910909FE259C453B9667FAC3 /* APPBackgroundMode.h */,
+ 53A55FEDB6A74B99A86BBDD8 /* APPMethodMagic.h */,
+ D93579623C1A4451B27262FF /* CDVFile.m */,
+ AC07D5F062E24FAAA7469A58 /* CDVLocalFilesystem.m */,
+ 056915956BD4456FB9EADED5 /* CDVAssetLibraryFilesystem.m */,
+ 74623D9AD29148A1B2E8EF5C /* CDVFile.h */,
+ 37576CA46A7047ED9265AF58 /* CDVLocalFilesystem.h */,
+ F762E469D4AE4C96B1093AF8 /* CDVAssetLibraryFilesystem.h */,
+ 2B9A8D5D4BEF4488B802F06B /* FileOpener2.m */,
+ 30C096BE39254EA387829D33 /* FileOpener2.h */,
+ 6623E5A56C4749DEB5D2AB2C /* NSString+SSURLEncoding.m */,
+ 3D2AE4D4F0934D68904B9100 /* SocialSharing.m */,
+ 4A11CC71BD4C4F878AE3232C /* NSString+SSURLEncoding.h */,
+ 544B3072C77B4C1B8D7DF4D5 /* SocialSharing.h */,
+ 79408A8909D447A3B71E3A37 /* UIImage+CropScaleOrientation.m */,
+ BEBBDA6A98E04CD0A7B766E9 /* CDVCamera.m */,
+ 5072190018BB418ABC2FE2CE /* CDVJpegHeaderWriter.m */,
+ D8C16A6E22A04975950CED74 /* UIImage+CropScaleOrientation.h */,
+ 4B41B040A42E4840A98FC527 /* CDVCamera.h */,
+ ACAE658C7FE64932ACC0101B /* CDVJpegHeaderWriter.h */,
+ 76F264E800DC4D41A6F1F655 /* CDVExif.h */,
+ );
+ path = Plugins;
+ sourceTree = "<group>";
+ };
+ 907F98602C06B8F000D2D242 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ E181E201B5D34148971AB055 /* Social.framework */,
+ E5DF15065E8A4AD99BF7885C /* MessageUI.framework */,
+ 19FA584C297642399D8E9705 /* ImageIO.framework */,
+ 9C38C8E066424CE5BF6960C9 /* CoreLocation.framework */,
+ 770671E12B2C44D59330AA70 /* AVFoundation.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 9080B40D2C6DD79000078F33 /* config */ = {
+ isa = PBXGroup;
+ children = (
+ 90EB303F2C6DD87600CEEB2F /* build-debug.xcconfig */,
+ 90EB30402C6DD87600CEEB2F /* build-release.xcconfig */,
+ 90EB303C2C6DD83300CEEB2F /* build-extras.xcconfig */,
+ 90EB303B2C6DD83300CEEB2F /* build.xcconfig */,
+ );
+ name = config;
+ sourceTree = "<group>";
+ };
+ 9080B40E2C6DD7A100078F33 /* staging */ = {
+ isa = PBXGroup;
+ children = (
+ 907F98652C06BC1B00D2D242 /* config.xml */,
+ 907F98692C06BCD300D2D242 /* www */,
+ );
+ name = staging;
+ sourceTree = "<group>";
+ };
+ 90BD9B632C06907D000DEBAB /* CustomTemplate */ = {
+ isa = PBXGroup;
+ children = (
+ 9080B40F2C6DD7EC00078F33 /* config.xml */,
+ 9040B1882C6DD41B00662C5D /* www */,
+ 90BD9B6E2C06907D000DEBAB /* App */,
+ 90BD9B6D2C06907D000DEBAB /* Products */,
+ 907F98602C06B8F000D2D242 /* Frameworks */,
+ );
+ name = CustomTemplate;
+ sourceTree = "<group>";
+ };
+ 90BD9B6D2C06907D000DEBAB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 90BD9B6C2C06907D000DEBAB /* App.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 90BD9B6E2C06907D000DEBAB /* App */ = {
+ isa = PBXGroup;
+ children = (
+ 90CBB5272C06968500B805A2 /* AppDelegate.swift */,
+ 90CBB5292C06968500B805A2 /* SceneDelegate.swift */,
+ 90CBB52B2C06968500B805A2 /* ViewController.swift */,
+ 90BD9B7D2C06907E000DEBAB /* CDVLaunchScreen.storyboard */,
+ 90BD9B782C06907D000DEBAB /* Main.storyboard */,
+ 90BD9B7B2C06907E000DEBAB /* Assets.xcassets */,
+ 90BD9B802C06907E000DEBAB /* Info.plist */,
+ 907F98552C06B87200D2D242 /* PrivacyInfo.xcprivacy */,
+ 907F98622C06B97000D2D242 /* Entitlements-Debug.plist */,
+ 907F98632C06B9C800D2D242 /* Entitlements-Release.plist */,
+ 90F7E7002C6EB78900AD84C2 /* AppDelegate.h */,
+ 9040B1872C6DD3EB00662C5D /* Bridging-Header.h */,
+ 90F7E7012C6EB78900AD84C2 /* MainViewController.h */,
+ 907F98542C06B85800D2D242 /* Plugins */,
+ 905D2F6D2C6DDEE100117937 /* Resources */,
+ 9080B40D2C6DD79000078F33 /* config */,
+ 9080B40E2C6DD7A100078F33 /* staging */,
+ );
+ path = App;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 90BD9B6B2C06907D000DEBAB /* App */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 90BD9B852C06907E000DEBAB /* Build configuration list for PBXNativeTarget "App" */;
+ buildPhases = (
+ 90BD9B682C06907D000DEBAB /* Sources */,
+ 90BD9B692C06907D000DEBAB /* Frameworks */,
+ 90BD9B6A2C06907D000DEBAB /* Resources */,
+ 902AE2152C6C059A0041150F /* Embed Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = App;
+ packageProductDependencies = (
+ 90A914582CA3D370003DB979 /* Cordova */,
+ 90D82ABC2CF19AEA001383CF /* CordovaPlugins */,
+ );
+ productName = App;
+ productReference = 90BD9B6C2C06907D000DEBAB /* App.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 90BD9B642C06907D000DEBAB /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ BuildIndependentTargetsInParallel = YES;
+ LastSwiftUpdateCheck = 1540;
+ LastUpgradeCheck = 2600;
+ TargetAttributes = {
+ 90BD9B6B2C06907D000DEBAB = {
+ CreatedOnToolsVersion = 15.4;
+ };
+ };
+ };
+ buildConfigurationList = 90BD9B672C06907D000DEBAB /* Build configuration list for PBXProject "App" */;
+ compatibilityVersion = "Xcode 15.0";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 90BD9B632C06907D000DEBAB /* CustomTemplate */;
+ packageReferences = (
+ 90A914572CA3D370003DB979 /* XCLocalSwiftPackageReference "../../../cordova-ios" */,
+ 90D82ABB2CF19AEA001383CF /* XCLocalSwiftPackageReference "CordovaPlugins" */,
+ );
+ productRefGroup = 90BD9B6D2C06907D000DEBAB /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 90BD9B6B2C06907D000DEBAB /* App */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 90BD9B6A2C06907D000DEBAB /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 907F986A2C06BCD300D2D242 /* www in Resources */,
+ 90BD9B7C2C06907E000DEBAB /* Assets.xcassets in Resources */,
+ 90BD9B7F2C06907E000DEBAB /* Base in Resources */,
+ 907F98562C06B87200D2D242 /* PrivacyInfo.xcprivacy in Resources */,
+ 90BD9B7A2C06907D000DEBAB /* Base in Resources */,
+ 907F98662C06BC1B00D2D242 /* config.xml in Resources */,
+ 97C4D801879447A9A49795F4 /* appbeep.wav in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 90BD9B682C06907D000DEBAB /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 90CBB52C2C06968500B805A2 /* ViewController.swift in Sources */,
+ 90CBB5282C06968500B805A2 /* AppDelegate.swift in Sources */,
+ 90CBB52A2C06968500B805A2 /* SceneDelegate.swift in Sources */,
+ 8B6D746AB6784BBDBD1FDB5C /* Downloader.swift in Sources */,
+ 5EE7AF17F1814EAA9DB9B632 /* CDVDevice.m in Sources */,
+ 7AC77B4ED7024E9399B4AEBB /* APPBackgroundMode.m in Sources */,
+ 3921269DA02C4B359E4C3021 /* APPMethodMagic.m in Sources */,
+ 4550856B9FB84DAAAC08AB97 /* CDVFile.m in Sources */,
+ 7C421B76F2FF46C195223500 /* CDVLocalFilesystem.m in Sources */,
+ 1ED5D70524C94EE1958772C8 /* CDVAssetLibraryFilesystem.m in Sources */,
+ 7BBD621DCB904C6EB1D4C3BC /* FileOpener2.m in Sources */,
+ 32E8E41ED89B40D2BE58D24D /* NSString+SSURLEncoding.m in Sources */,
+ 0645FB225CEA45DBA045E1B0 /* SocialSharing.m in Sources */,
+ AA70162D431645389AC4E8C8 /* UIImage+CropScaleOrientation.m in Sources */,
+ 1BE83F16BCB64DF1B6F55046 /* CDVCamera.m in Sources */,
+ E0B1AB6529D842688A1974D6 /* CDVJpegHeaderWriter.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXVariantGroup section */
+ 90BD9B782C06907D000DEBAB /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 90BD9B792C06907D000DEBAB /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "<group>";
+ };
+ 90BD9B7D2C06907E000DEBAB /* CDVLaunchScreen.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 90BD9B7E2C06907E000DEBAB /* Base */,
+ );
+ name = CDVLaunchScreen.storyboard;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 90BD9B832C06907E000DEBAB /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ "DEPLOYMENT_LOCATION[sdk=iphonesimulator*]" = YES;
+ "DEPLOYMENT_LOCATION[sdk=macosx*]" = YES;
+ "DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
+ DSTROOT = "$(SRCROOT)/build";
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ "INSTALL_PATH[sdk=iphonesimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
+ "INSTALL_PATH[sdk=macosx*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
+ "INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = iphoneos;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
+ SUPPORTS_MACCATALYST = YES;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_WORKSPACE = NO;
+ };
+ name = Debug;
+ };
+ 90BD9B842C06907E000DEBAB /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ "DEPLOYMENT_LOCATION[sdk=iphonesimulator*]" = YES;
+ "DEPLOYMENT_LOCATION[sdk=macosx*]" = YES;
+ "DEPLOYMENT_LOCATION[sdk=xrsimulator*]" = YES;
+ DSTROOT = "$(SRCROOT)/build";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ "INSTALL_PATH[sdk=iphonesimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
+ "INSTALL_PATH[sdk=macosx*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
+ "INSTALL_PATH[sdk=xrsimulator*]" = "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)";
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = iphoneos;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
+ SUPPORTS_MACCATALYST = YES;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = Release;
+ };
+ 90BD9B862C06907E000DEBAB /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 90EB303F2C6DD87600CEEB2F /* build-debug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CODE_SIGN_ENTITLEMENTS = "$(TARGET_NAME)/Entitlements-$(CONFIGURATION).plist";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1.0.0;
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_FILE = "$(TARGET_NAME)/$(TARGET_NAME)-Info.plist";
+ INFOPLIST_KEY_CFBundleDisplayName = "$(PRODUCT_NAME)";
+ INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
+ INFOPLIST_KEY_UILaunchStoryboardName = CDVLaunchScreen;
+ INFOPLIST_KEY_UIMainStoryboardFile = Main;
+ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ MARKETING_VERSION = 1.0.0;
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-ObjC",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "org.tagspaces.mobileapp";
+ PRODUCT_NAME = "TagSpaces";
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
+ SUPPORTS_MACCATALYST = YES;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_OBJC_BRIDGING_HEADER = "$(TARGET_NAME)/Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2,6,7";
+ };
+ name = Debug;
+ };
+ 90BD9B872C06907E000DEBAB /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 90EB30402C6DD87600CEEB2F /* build-release.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ CODE_SIGN_ENTITLEMENTS = "$(TARGET_NAME)/Entitlements-$(CONFIGURATION).plist";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1.0.0;
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_FILE = "$(TARGET_NAME)/$(TARGET_NAME)-Info.plist";
+ INFOPLIST_KEY_CFBundleDisplayName = "$(PRODUCT_NAME)";
+ INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
+ INFOPLIST_KEY_UILaunchStoryboardName = CDVLaunchScreen;
+ INFOPLIST_KEY_UIMainStoryboardFile = Main;
+ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+ INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ );
+ MARKETING_VERSION = 1.0.0;
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-ObjC",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = "org.tagspaces.mobileapp";
+ PRODUCT_NAME = "TagSpaces";
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
+ SUPPORTS_MACCATALYST = YES;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_OBJC_BRIDGING_HEADER = "$(TARGET_NAME)/Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2,6,7";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 90BD9B672C06907D000DEBAB /* Build configuration list for PBXProject "App" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 90BD9B832C06907E000DEBAB /* Debug */,
+ 90BD9B842C06907E000DEBAB /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 90BD9B852C06907E000DEBAB /* Build configuration list for PBXNativeTarget "App" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 90BD9B862C06907E000DEBAB /* Debug */,
+ 90BD9B872C06907E000DEBAB /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+
+/* Begin XCLocalSwiftPackageReference section */
+ 90A914572CA3D370003DB979 /* XCLocalSwiftPackageReference "../../../cordova-ios" */ = {
+ isa = XCLocalSwiftPackageReference;
+ relativePath = "packages/cordova-ios";
+ };
+ 90D82ABB2CF19AEA001383CF /* XCLocalSwiftPackageReference "packages/cordova-ios-plugins" */ = {
+ isa = XCLocalSwiftPackageReference;
+ relativePath = "packages/cordova-ios-plugins";
+ };
+/* End XCLocalSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+ 90A914582CA3D370003DB979 /* Cordova */ = {
+ isa = XCSwiftPackageProductDependency;
+ productName = Cordova;
+ };
+ 90D82ABC2CF19AEA001383CF /* CordovaPlugins */ = {
+ isa = XCSwiftPackageProductDependency;
+ productName = CordovaPlugins;
+ };
+/* End XCSwiftPackageProductDependency section */
+ };
+ rootObject = 90BD9B642C06907D000DEBAB /* Project object */;
+}
diff --git a/cordova/platforms/ios/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/cordova/platforms/ios/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 000000000..21fc716e2
--- /dev/null
+++ b/cordova/platforms/ios/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:">
+ </FileRef>
+</Workspace>
diff --git a/cordova/platforms/ios/TagSpaces.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cordova/platforms/ios/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
similarity index 100%
rename from cordova/platforms/ios/TagSpaces.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
rename to cordova/platforms/ios/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
diff --git a/cordova/platforms/ios/App.xcworkspace/contents.xcworkspacedata b/cordova/platforms/ios/App.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 000000000..4bae5d8d7
--- /dev/null
+++ b/cordova/platforms/ios/App.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "group:App.xcodeproj">
+ </FileRef>
+</Workspace>
diff --git a/cordova/platforms/ios/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist b/cordova/platforms/ios/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
similarity index 54%
rename from cordova/platforms/ios/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist
rename to cordova/platforms/ios/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
index 3a4ef209b..18d981003 100644
--- a/cordova/platforms/ios/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist
+++ b/cordova/platforms/ios/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -2,13 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
- <key>SchemeUserState</key>
- <dict>
- <key>TagSpaces.xcscheme_^#shared#^_</key>
- <dict>
- <key>orderHint</key>
- <integer>0</integer>
- </dict>
- </dict>
+ <key>IDEDidComputeMac32BitWarning</key>
+ <true/>
</dict>
</plist>
diff --git a/cordova/platforms/ios/TagSpaces.xcworkspace/xcshareddata/xcschemes/TagSpaces.xcscheme b/cordova/platforms/ios/App.xcworkspace/xcshareddata/xcschemes/App.xcscheme
similarity index 58%
rename from cordova/platforms/ios/TagSpaces.xcworkspace/xcshareddata/xcschemes/TagSpaces.xcscheme
rename to cordova/platforms/ios/App.xcworkspace/xcshareddata/xcschemes/App.xcscheme
index 2c61e25a3..3f54405ff 100644
--- a/cordova/platforms/ios/TagSpaces.xcworkspace/xcshareddata/xcschemes/TagSpaces.xcscheme
+++ b/cordova/platforms/ios/App.xcworkspace/xcshareddata/xcschemes/App.xcscheme
@@ -1,6 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<Scheme
- LastUpgradeVersion = "0730"
+ LastUpgradeVersion = "2600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -14,10 +32,10 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
- BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
- BuildableName = "TagSpaces.app"
- BlueprintName = "TagSpaces"
- ReferencedContainer = "container:TagSpaces.xcodeproj">
+ BlueprintIdentifier = "90BD9B6B2C06907D000DEBAB"
+ BuildableName = "App.app"
+ BlueprintName = "App"
+ ReferencedContainer = "container:App.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
@@ -27,19 +45,17 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
- <Testables>
- </Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
- BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
- BuildableName = "TagSpaces.app"
- BlueprintName = "TagSpaces"
- ReferencedContainer = "container:TagSpaces.xcodeproj">
+ BlueprintIdentifier = "90BD9B6B2C06907D000DEBAB"
+ BuildableName = "App.app"
+ BlueprintName = "App"
+ ReferencedContainer = "container:App.xcodeproj">
</BuildableReference>
</MacroExpansion>
- <AdditionalOptions>
- </AdditionalOptions>
+ <Testables>
+ </Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -55,14 +71,12 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
- BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
- BuildableName = "TagSpaces.app"
- BlueprintName = "TagSpaces"
- ReferencedContainer = "container:TagSpaces.xcodeproj">
+ BlueprintIdentifier = "90BD9B6B2C06907D000DEBAB"
+ BuildableName = "App.app"
+ BlueprintName = "App"
+ ReferencedContainer = "container:App.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
- <AdditionalOptions>
- </AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -74,10 +88,10 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
- BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
- BuildableName = "TagSpaces.app"
- BlueprintName = "TagSpaces"
- ReferencedContainer = "container:TagSpaces.xcodeproj">
+ BlueprintIdentifier = "90BD9B6B2C06907D000DEBAB"
+ BuildableName = "App.app"
+ BlueprintName = "App"
+ ReferencedContainer = "container:App.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
diff --git a/cordova/platforms/ios/TagSpaces/.gitignore b/cordova/platforms/ios/App/.gitignore
similarity index 100%
rename from cordova/platforms/ios/TagSpaces/.gitignore
rename to cordova/platforms/ios/App/.gitignore
diff --git a/cordova/platforms/ios/App/App-Info.plist b/cordova/platforms/ios/App/App-Info.plist
new file mode 100644
index 000000000..c482dfb63
--- /dev/null
+++ b/cordova/platforms/ios/App/App-Info.plist
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>UTImportedTypeDeclarations</key>
+ <array>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.data</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>WebAssembly</string>
+ <key>UTTypeIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <string>wasm</string>
+ <key>public.mime-type</key>
+ <string>application/wasm</string>
+ </dict>
+ </dict>
+ </array>
+ <key>UIApplicationSceneManifest</key>
+ <dict>
+ <key>UIApplicationSupportsMultipleScenes</key>
+ <false/>
+ <key>UISceneConfigurations</key>
+ <dict>
+ <key>UIWindowSceneSessionRoleApplication</key>
+ <array>
+ <dict>
+ <key>UISceneConfigurationName</key>
+ <string>Default Configuration</string>
+ <key>UISceneDelegateClassName</key>
+ <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
+ <key>UISceneStoryboardFile</key>
+ <string>Main</string>
+ </dict>
+ </array>
+ </dict>
+ </dict>
+ <key>NSAppTransportSecurity</key>
+ <dict>
+ <key>NSAllowsArbitraryLoads</key>
+ <true/>
+ </dict>
+ <key>UIBackgroundModes</key>
+ <array>
+ <string>audio</string>
+ </array>
+ <key>NSPhotoLibraryAddUsageDescription</key>
+ <string>This app requires photo library access to function properly.</string>
+ <key>NSPhotoLibraryUsageDescription</key>
+ <string>This app requires photo library access to function properly.</string>
+</dict>
+</plist>
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/AppDelegate.h b/cordova/platforms/ios/App/AppDelegate.h
new file mode 100644
index 000000000..62a77631f
--- /dev/null
+++ b/cordova/platforms/ios/App/AppDelegate.h
@@ -0,0 +1,29 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+#import <Cordova/CDVAppDelegate.h>
+
+#ifndef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
+ #warning It is unsafe to rely on the AppDelegate class as an extension point. \
+ Update your code to extend CDVAppDelegate instead -- \
+ This code will stop working in Cordova iOS 9!
+#endif
+
+@interface AppDelegate : CDVAppDelegate
+@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVConfigParser.h b/cordova/platforms/ios/App/AppDelegate.swift
similarity index 64%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVConfigParser.h
rename to cordova/platforms/ios/App/AppDelegate.swift
index bae3d0f8b..d0ec40f45 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVConfigParser.h
+++ b/cordova/platforms/ios/App/AppDelegate.swift
@@ -15,16 +15,19 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
- */
+*/
-@interface CDVConfigParser : NSObject <NSXMLParserDelegate>
-{
- NSString* featureName;
-}
+import UIKit
-@property (nonatomic, readonly, strong) NSMutableDictionary* pluginsDict;
-@property (nonatomic, readonly, strong) NSMutableDictionary* settings;
-@property (nonatomic, readonly, strong) NSMutableArray* startupPluginNames;
-@property (nonatomic, readonly, strong) NSString* startPage;
+@main
+#if compiler(>=6.1)
+@objc @implementation
+#else
+@_objcImplementation
+#endif
+extension AppDelegate {
+ open override func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
+ return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
+ }
+}
-@end
diff --git a/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 000000000..2c8c083ab
--- /dev/null
+++ b/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,20 @@
+{
+ "images" : [
+ {
+ "filename" : "icon.png",
+ "idiom" : "universal",
+ "platform": "ios",
+ "size" : "1024x1024"
+ },
+ {
+ "filename" : "icon.png",
+ "idiom" : "universal",
+ "platform": "watchos",
+ "size" : "1024x1024"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
diff --git a/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/icon.png b/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/icon.png
new file mode 100644
index 000000000..b9250b124
Binary files /dev/null and b/cordova/platforms/ios/App/Assets.xcassets/AppIcon.appiconset/icon.png differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/BackgroundColor.colorset/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/BackgroundColor.colorset/Contents.json
similarity index 100%
rename from cordova/platforms/ios/TagSpaces/Images.xcassets/BackgroundColor.colorset/Contents.json
rename to cordova/platforms/ios/App/Assets.xcassets/BackgroundColor.colorset/Contents.json
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/Contents.json
similarity index 100%
rename from cordova/platforms/ios/TagSpaces/Images.xcassets/Contents.json
rename to cordova/platforms/ios/App/Assets.xcassets/Contents.json
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/LaunchStoryboard.imageset/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/LaunchStoryboard.imageset/Contents.json
similarity index 100%
rename from cordova/platforms/ios/TagSpaces/Images.xcassets/LaunchStoryboard.imageset/Contents.json
rename to cordova/platforms/ios/App/Assets.xcassets/LaunchStoryboard.imageset/Contents.json
diff --git a/cordova/platforms/ios/App/Assets.xcassets/SplashScreenBackgroundColor.colorset/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/SplashScreenBackgroundColor.colorset/Contents.json
new file mode 100644
index 000000000..38ce5e7c7
--- /dev/null
+++ b/cordova/platforms/ios/App/Assets.xcassets/SplashScreenBackgroundColor.colorset/Contents.json
@@ -0,0 +1,15 @@
+{
+ "colors": [
+ {
+ "idiom": "universal",
+ "color": {
+ "platform": "ios",
+ "reference": "systemBackgroundColor"
+ }
+ }
+ ],
+ "info": {
+ "author": "Xcode",
+ "version": 1
+ }
+}
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/Assets.xcassets/StatusBarBackgroundColor.colorset/Contents.json b/cordova/platforms/ios/App/Assets.xcassets/StatusBarBackgroundColor.colorset/Contents.json
new file mode 100644
index 000000000..38ce5e7c7
--- /dev/null
+++ b/cordova/platforms/ios/App/Assets.xcassets/StatusBarBackgroundColor.colorset/Contents.json
@@ -0,0 +1,15 @@
+{
+ "colors": [
+ {
+ "idiom": "universal",
+ "color": {
+ "platform": "ios",
+ "reference": "systemBackgroundColor"
+ }
+ }
+ ],
+ "info": {
+ "author": "Xcode",
+ "version": 1
+ }
+}
\ No newline at end of file
diff --git a/cordova/platforms/ios/TagSpaces/CDVLaunchScreen.storyboard b/cordova/platforms/ios/App/Base.lproj/CDVLaunchScreen.storyboard
similarity index 96%
rename from cordova/platforms/ios/TagSpaces/CDVLaunchScreen.storyboard
rename to cordova/platforms/ios/App/Base.lproj/CDVLaunchScreen.storyboard
index 924392e34..be89abe10 100644
--- a/cordova/platforms/ios/TagSpaces/CDVLaunchScreen.storyboard
+++ b/cordova/platforms/ios/App/Base.lproj/CDVLaunchScreen.storyboard
@@ -42,7 +42,7 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
</imageView>
</subviews>
- <color key="backgroundColor" name="BackgroundColor"/>
+ <color key="backgroundColor" name="SplashScreenBackgroundColor"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="2ns-9I-Qjs" secondAttribute="trailing" id="FZL-3Z-NFz"/>
<constraint firstItem="2ns-9I-Qjs" firstAttribute="bottom" secondItem="Ze5-6b-2t3" secondAttribute="bottom" id="L9l-pw-wXj"/>
@@ -58,7 +58,7 @@
</scenes>
<resources>
<image name="LaunchStoryboard" width="1366" height="1366"/>
- <namedColor name="BackgroundColor">
+ <namedColor name="SplashScreenBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</namedColor>
</resources>
diff --git a/cordova/platforms/ios/App/Base.lproj/Main.storyboard b/cordova/platforms/ios/App/Base.lproj/Main.storyboard
new file mode 100644
index 000000000..3372d5d22
--- /dev/null
+++ b/cordova/platforms/ios/App/Base.lproj/Main.storyboard
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
+ <dependencies>
+ <deployment identifier="iOS"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
+ <capability name="Named colors" minToolsVersion="9.0"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+ </dependencies>
+ <scenes>
+ <!--View Controller-->
+ <scene sceneID="tne-QT-ifu">
+ <objects>
+ <viewController id="BYZ-38-t0r" customClass="ViewController" customModule="$(PRODUCT_MODULE_NAME)" customModuleProvider="target" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="8bC-Xf-vdC">
+ <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" name="BackgroundColor"/>
+ </view>
+ <userDefinedRuntimeAttributes>
+ <userDefinedRuntimeAttribute type="color" keyPath="backgroundColor">
+ <color key="value" name="BackgroundColor"/>
+ </userDefinedRuntimeAttribute>
+ <userDefinedRuntimeAttribute type="color" keyPath="splashBackgroundColor">
+ <color key="value" name="SplashScreenBackgroundColor"/>
+ </userDefinedRuntimeAttribute>
+ <userDefinedRuntimeAttribute type="boolean" keyPath="showSplashScreen" value="YES"/>
+ <userDefinedRuntimeAttribute type="color" keyPath="statusBarBackgroundColor">
+ <color key="value" name="StatusBarBackgroundColor"/>
+ </userDefinedRuntimeAttribute>
+ </userDefinedRuntimeAttributes>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
+ </objects>
+ </scene>
+ </scenes>
+ <resources>
+ <namedColor name="BackgroundColor">
+ <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+ </namedColor>
+ <namedColor name="SplashScreenBackgroundColor">
+ <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+ </namedColor>
+ <namedColor name="StatusBarBackgroundColor">
+ <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+ </namedColor>
+ </resources>
+</document>
+
diff --git a/cordova/platforms/ios/App/Bridging-Header.h b/cordova/platforms/ios/App/Bridging-Header.h
new file mode 100644
index 000000000..9dec52955
--- /dev/null
+++ b/cordova/platforms/ios/App/Bridging-Header.h
@@ -0,0 +1,25 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Cordova/Cordova.h>
+
+#define __CORDOVA_SILENCE_HEADER_DEPRECATIONS
+#import "AppDelegate.h"
+#import "MainViewController.h"
+#undef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
diff --git a/cordova/platforms/ios/TagSpaces/Entitlements-Debug.plist b/cordova/platforms/ios/App/Entitlements-Debug.plist
similarity index 100%
rename from cordova/platforms/ios/TagSpaces/Entitlements-Debug.plist
rename to cordova/platforms/ios/App/Entitlements-Debug.plist
diff --git a/cordova/platforms/ios/TagSpaces/Entitlements-Release.plist b/cordova/platforms/ios/App/Entitlements-Release.plist
similarity index 100%
rename from cordova/platforms/ios/TagSpaces/Entitlements-Release.plist
rename to cordova/platforms/ios/App/Entitlements-Release.plist
diff --git a/cordova/platforms/ios/TagSpaces/Classes/MainViewController.h b/cordova/platforms/ios/App/MainViewController.h
similarity index 70%
rename from cordova/platforms/ios/TagSpaces/Classes/MainViewController.h
rename to cordova/platforms/ios/App/MainViewController.h
index 06aeb677d..ddb37c4a7 100644
--- a/cordova/platforms/ios/TagSpaces/Classes/MainViewController.h
+++ b/cordova/platforms/ios/App/MainViewController.h
@@ -15,26 +15,15 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
- */
-
-//
-// MainViewController.h
-// TagSpaces
-//
-// Created by ___FULLUSERNAME___ on ___DATE___.
-// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
+*/
#import <Cordova/CDVViewController.h>
-#import <Cordova/CDVCommandDelegateImpl.h>
-#import <Cordova/CDVCommandQueue.h>
-
-@interface MainViewController : CDVViewController
-@end
+#ifndef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
+ #warning It is unsafe to rely on the MainViewController class as an extension point. \
+ Update your code to extend CDVViewController instead -- \
+ This code will stop working in Cordova iOS 9!
+#endif
-@interface MainCommandDelegate : CDVCommandDelegateImpl
-@end
-
-@interface MainCommandQueue : CDVCommandQueue
+@interface MainViewController : CDVViewController
@end
diff --git a/cordova/platforms/ios/TagSpaces/Plugins/README b/cordova/platforms/ios/App/Plugins/README
similarity index 100%
rename from cordova/platforms/ios/TagSpaces/Plugins/README
rename to cordova/platforms/ios/App/Plugins/README
diff --git a/cordova/platforms/ios/TagSpaces/Plugins/com.whebcraft.cordova.plugin.downloader/Downloader.swift b/cordova/platforms/ios/App/Plugins/com.whebcraft.cordova.plugin.downloader/Downloader.swift
similarity index 99%
rename from cordova/platforms/ios/TagSpaces/Plugins/com.whebcraft.cordova.plugin.downloader/Downloader.swift
rename to cordova/platforms/ios/App/Plugins/com.whebcraft.cordova.plugin.downloader/Downloader.swift
index 3e30eda66..2178afbbf 100644
--- a/cordova/platforms/ios/TagSpaces/Plugins/com.whebcraft.cordova.plugin.downloader/Downloader.swift
+++ b/cordova/platforms/ios/App/Plugins/com.whebcraft.cordova.plugin.downloader/Downloader.swift
@@ -46,7 +46,7 @@ import Foundation
if (try? data!.write(to: destinationUrl!, options: [.atomic])) != nil {
pluginResult = CDVPluginResult(
status: CDVCommandStatus_OK,
- messageAs: documentsUrl?.path
+ messageAs: documentsUrl?.path ?? ""
)
self.commandDelegate!.send(
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.h
new file mode 100755
index 000000000..e7ed1e5a3
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.h
@@ -0,0 +1,35 @@
+/*
+ Copyright 2013-2017 appPlant GmbH
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+#import <AVFoundation/AVFoundation.h>
+#import <Cordova/CDVPlugin.h>
+
+@interface APPBackgroundMode : CDVPlugin {
+ AVAudioPlayer* audioPlayer;
+ BOOL enabled;
+}
+
+// Activate the background mode
+- (void) enable:(CDVInvokedUrlCommand*)command;
+// Deactivate the background mode
+- (void) disable:(CDVInvokedUrlCommand*)command;
+
+@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.m
new file mode 100755
index 000000000..e0792cccc
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPBackgroundMode.m
@@ -0,0 +1,276 @@
+/*
+ Copyright 2013-2017 appPlant GmbH
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+#import "APPMethodMagic.h"
+#import "APPBackgroundMode.h"
+#import <Cordova/CDVAvailability.h>
+
+@implementation APPBackgroundMode
+
+#pragma mark -
+#pragma mark Constants
+
+NSString* const kAPPBackgroundJsNamespace = @"cordova.plugins.backgroundMode";
+NSString* const kAPPBackgroundEventActivate = @"activate";
+NSString* const kAPPBackgroundEventDeactivate = @"deactivate";
+
+
+#pragma mark -
+#pragma mark Life Cycle
+
+/**
+ * Called by runtime once the Class has been loaded.
+ * Exchange method implementations to hook into their execution.
+ */
++ (void) load
+{
+ [self swizzleWKWebViewEngine];
+}
+
+/**
+ * Initialize the plugin.
+ */
+- (void) pluginInitialize
+{
+ enabled = NO;
+ [self configureAudioPlayer];
+ [self configureAudioSession];
+ [self observeLifeCycle];
+}
+
+/**
+ * Register the listener for pause and resume events.
+ */
+- (void) observeLifeCycle
+{
+ NSNotificationCenter* listener = [NSNotificationCenter
+ defaultCenter];
+
+ [listener addObserver:self
+ selector:@selector(keepAwake)
+ name:UIApplicationDidEnterBackgroundNotification
+ object:nil];
+
+ [listener addObserver:self
+ selector:@selector(stopKeepingAwake)
+ name:UIApplicationWillEnterForegroundNotification
+ object:nil];
+
+ [listener addObserver:self
+ selector:@selector(handleAudioSessionInterruption:)
+ name:AVAudioSessionInterruptionNotification
+ object:nil];
+}
+
+#pragma mark -
+#pragma mark Interface
+
+/**
+ * Enable the mode to stay awake
+ * when switching to background for the next time.
+ */
+- (void) enable:(CDVInvokedUrlCommand*)command
+{
+ if (enabled)
+ return;
+
+ enabled = YES;
+ [self execCallback:command];
+}
+
+/**
+ * Disable the background mode
+ * and stop being active in background.
+ */
+- (void) disable:(CDVInvokedUrlCommand*)command
+{
+ if (!enabled)
+ return;
+
+ enabled = NO;
+ [self stopKeepingAwake];
+ [self execCallback:command];
+}
+
+#pragma mark -
+#pragma mark Core
+
+/**
+ * Keep the app awake.
+ */
+- (void) keepAwake
+{
+ if (!enabled)
+ return;
+
+ [audioPlayer play];
+ [self fireEvent:kAPPBackgroundEventActivate];
+}
+
+/**
+ * Let the app going to sleep.
+ */
+- (void) stopKeepingAwake
+{
+ if (TARGET_IPHONE_SIMULATOR) {
+ NSLog(@"BackgroundMode: On simulator apps never pause in background!");
+ }
+
+ if (audioPlayer.isPlaying) {
+ [self fireEvent:kAPPBackgroundEventDeactivate];
+ }
+
+ [audioPlayer pause];
+}
+
+/**
+ * Configure the audio player.
+ */
+- (void) configureAudioPlayer
+{
+ NSString* path = [[NSBundle mainBundle]
+ pathForResource:@"appbeep" ofType:@"wav"];
+
+ NSURL* url = [NSURL fileURLWithPath:path];
+
+
+ audioPlayer = [[AVAudioPlayer alloc]
+ initWithContentsOfURL:url error:NULL];
+
+ audioPlayer.volume = 0;
+ audioPlayer.numberOfLoops = -1;
+};
+
+/**
+ * Configure the audio session.
+ */
+- (void) configureAudioSession
+{
+ AVAudioSession* session = [AVAudioSession
+ sharedInstance];
+
+ // Don't activate the audio session yet
+ [session setActive:NO error:NULL];
+
+ // Play music even in background and dont stop playing music
+ // even another app starts playing sound
+ [session setCategory:AVAudioSessionCategoryPlayback
+ error:NULL];
+
+ // Active the audio session
+ [session setActive:YES error:NULL];
+};
+
+#pragma mark -
+#pragma mark Helper
+
+/**
+ * Simply invokes the callback without any parameter.
+ */
+- (void) execCallback:(CDVInvokedUrlCommand*)command
+{
+ CDVPluginResult *result = [CDVPluginResult
+ resultWithStatus:CDVCommandStatus_OK];
+
+ [self.commandDelegate sendPluginResult:result
+ callbackId:command.callbackId];
+}
+
+/**
+ * Restart playing sound when interrupted by phone calls.
+ */
+- (void) handleAudioSessionInterruption:(NSNotification*)notification
+{
+ [self fireEvent:kAPPBackgroundEventDeactivate];
+ [self keepAwake];
+}
+
+/**
+ * Find out if the app runs inside the webkit powered webview.
+ */
++ (BOOL) isRunningWebKit
+{
+ return IsAtLeastiOSVersion(@"8.0") && NSClassFromString(@"CDVWKWebViewEngine");
+}
+
+/**
+ * Method to fire an event with some parameters in the browser.
+ */
+- (void) fireEvent:(NSString*)event
+{
+ NSString* active =
+ [event isEqualToString:kAPPBackgroundEventActivate] ? @"true" : @"false";
+
+ NSString* flag = [NSString stringWithFormat:@"%@._isActive=%@;",
+ kAPPBackgroundJsNamespace, active];
+
+ NSString* depFn = [NSString stringWithFormat:@"%@.on('%@');",
+ kAPPBackgroundJsNamespace, event];
+
+ NSString* fn = [NSString stringWithFormat:@"%@.fireEvent('%@');",
+ kAPPBackgroundJsNamespace, event];
+
+ NSString* js = [NSString stringWithFormat:@"%@%@%@", flag, depFn, fn];
+
+ [self.commandDelegate evalJs:js];
+}
+
+#pragma mark -
+#pragma mark Swizzling
+
+/**
+ * Method to swizzle.
+ */
++ (NSString*) wkProperty
+{
+ NSString* str = @"YWx3YXlzUnVuc0F0Rm9yZWdyb3VuZFByaW9yaXR5";
+ NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
+
+ return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+}
+
+/**
+ * Swizzle some implementations of CDVWKWebViewEngine.
+ */
++ (void) swizzleWKWebViewEngine
+{
+ if (![self isRunningWebKit])
+ return;
+
+ Class wkWebViewEngineCls = NSClassFromString(@"CDVWKWebViewEngine");
+ SEL selector = NSSelectorFromString(@"createConfigurationFromSettings:");
+
+ SwizzleSelectorWithBlock_Begin(wkWebViewEngineCls, selector)
+ ^(CDVPlugin *self, NSDictionary *settings) {
+ id obj = ((id (*)(id, SEL, NSDictionary*))_imp)(self, _cmd, settings);
+
+ [obj setValue:[NSNumber numberWithBool:YES]
+ forKey:[APPBackgroundMode wkProperty]];
+
+ [obj setValue:[NSNumber numberWithBool:NO]
+ forKey:@"requiresUserActionForMediaPlayback"];
+
+ return obj;
+ }
+ SwizzleSelectorWithBlock_End;
+}
+
+@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.h
new file mode 100755
index 000000000..84de79111
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.h
@@ -0,0 +1,93 @@
+/*
+ Copyright 2013-2017 appPlant GmbH
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+/**
+ * Code extracted from
+ * - http://defagos.github.io/yet_another_article_about_method_swizzling/
+ * - https://gist.github.com/defagos/1312fec96b48540efa5c
+ */
+
+#import <objc/runtime.h>
+#import <objc/message.h>
+
+#define SwizzleSelector(clazz, selector, newImpl, oldImpl) \
+(*oldImpl) = (__typeof((*oldImpl)))class_swizzleSelector((clazz), (selector), (IMP)(newImpl))
+
+#define SwizzleClassSelector(clazz, selector, newImpl, oldImpl) \
+(*oldImpl) = (__typeof((*oldImpl)))class_swizzleClassSelector((clazz), (selector), (IMP)(newImpl))
+
+#define SwizzleSelectorWithBlock_Begin(clazz, selector) { \
+SEL _cmd = selector; \
+__block IMP _imp = class_swizzleSelectorWithBlock((clazz), (selector),
+#define SwizzleSelectorWithBlock_End );}
+
+#define SwizzleClassSelectorWithBlock_Begin(clazz, selector) { \
+SEL _cmd = selector; \
+__block IMP _imp = class_swizzleClassSelectorWithBlock((clazz), (selector),
+#define SwizzleClassSelectorWithBlock_End );}
+
+/**
+ * Swizzle class method specified by class and selector
+ * through the provided method implementation.
+ *
+ * @param [ Class ] clazz The class containing the method.
+ * @param [ SEL ] selector The selector of the method.
+ * @param [ IMP ] newImpl The new implementation of the method.
+ *
+ * @return [ IMP ] The previous implementation of the method.
+ */
+IMP class_swizzleClassSelector(Class clazz, SEL selector, IMP newImpl);
+
+/**
+ * Swizzle class method specified by class and selector
+ * through the provided code block.
+ *
+ * @param [ Class ] clazz The class containing the method.
+ * @param [ SEL ] selector The selector of the method.
+ * @param [ id ] newImplBlock The new implementation of the method.
+ *
+ * @return [ IMP ] The previous implementation of the method.
+ */
+IMP class_swizzleClassSelectorWithBlock(Class clazz, SEL selector, id newImplBlock);
+
+/**
+ * Swizzle method specified by class and selector
+ * through the provided code block.
+ *
+ * @param [ Class ] clazz The class containing the method.
+ * @param [ SEL ] selector The selector of the method.
+ * @param [ id ] newImplBlock The new implementation of the method.
+ *
+ * @return [ IMP ] The previous implementation of the method.
+ */
+IMP class_swizzleSelectorWithBlock(Class clazz, SEL selector, id newImplBlock);
+
+/**
+ * Swizzle method specified by class and selector
+ * through the provided method implementation.
+ *
+ * @param [ Class ] clazz The class containing the method.
+ * @param [ SEL ] selector The selector of the method.
+ * @param [ IMP ] newImpl The new implementation of the method.
+ *
+ * @return [ IMP ] The previous implementation of the method.
+ */
+IMP class_swizzleSelector(Class clazz, SEL selector, IMP newImpl);
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.m
new file mode 100755
index 000000000..cb9cc35f5
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-background-mode/APPMethodMagic.m
@@ -0,0 +1,105 @@
+/*
+ Copyright 2013-2017 appPlant GmbH
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+/**
+ * Code extracted from
+ * - http://defagos.github.io/yet_another_article_about_method_swizzling/
+ * - https://gist.github.com/defagos/1312fec96b48540efa5c
+ */
+
+#import "APPMethodMagic.h"
+#import <objc/runtime.h>
+#import <objc/message.h>
+
+/**
+ * Swizzle class method specified by class and selector
+ * through the provided method implementation.
+ *
+ * @param [ Class ] clazz The class containing the method.
+ * @param [ SEL ] selector The selector of the method.
+ * @param [ IMP ] newImpl The new implementation of the method.
+ *
+ * @return [ IMP ] The previous implementation of the method.
+ */
+IMP class_swizzleClassSelector(Class clazz, SEL selector, IMP newImpl)
+{
+ return class_swizzleSelector(object_getClass(clazz), selector, newImpl);
+}
+
+/**
+ * Swizzle class method specified by class and selector
+ * through the provided code block.
+ *
+ * @param [ Class ] clazz The class containing the method.
+ * @param [ SEL ] selector The selector of the method.
+ * @param [ id ] newImplBlock The new implementation of the method.
+ *
+ * @return [ IMP ] The previous implementation of the method.
+ */
+IMP class_swizzleClassSelectorWithBlock(Class clazz, SEL selector, id newImplBlock)
+{
+ IMP newImpl = imp_implementationWithBlock(newImplBlock);
+ return class_swizzleClassSelector(clazz, selector, newImpl);
+}
+
+/**
+ * Swizzle method specified by class and selector
+ * through the provided code block.
+ *
+ * @param [ Class ] clazz The class containing the method.
+ * @param [ SEL ] selector The selector of the method.
+ * @param [ id ] newImplBlock The new implementation of the method.
+ *
+ * @return [ IMP ] The previous implementation of the method.
+ */
+IMP class_swizzleSelectorWithBlock(Class clazz, SEL selector, id newImplBlock)
+{
+ IMP newImpl = imp_implementationWithBlock(newImplBlock);
+ return class_swizzleSelector(clazz, selector, newImpl);
+}
+
+/**
+ * Swizzle method specified by class and selector
+ * through the provided method implementation.
+ *
+ * @param [ Class ] clazz The class containing the method.
+ * @param [ SEL ] selector The selector of the method.
+ * @param [ IMP ] newImpl The new implementation of the method.
+ *
+ * @return [ IMP ] The previous implementation of the method.
+ */
+IMP class_swizzleSelector(Class clazz, SEL selector, IMP newImpl)
+{
+ Method method = class_getInstanceMethod(clazz, selector);
+ const char *types = method_getTypeEncoding(method);
+
+ class_addMethod(clazz, selector, imp_implementationWithBlock(^(__unsafe_unretained id self, va_list argp) {
+ struct objc_super super = {
+ .receiver = self,
+ .super_class = class_getSuperclass(clazz)
+ };
+
+ id (*objc_msgSendSuper_typed)(struct objc_super*, SEL, va_list) = (void*)&objc_msgSendSuper;
+ return objc_msgSendSuper_typed(&super, selector, argp);
+ }), types);
+
+ return class_replaceMethod(clazz, selector, newImpl, types);
+}
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.h
new file mode 100755
index 000000000..f64f66c27
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.h
@@ -0,0 +1,116 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import <CoreLocation/CoreLocation.h>
+#import <CoreLocation/CLLocationManager.h>
+#import <Cordova/CDVPlugin.h>
+
+enum CDVDestinationType {
+ DestinationTypeDataUrl = 0,
+ DestinationTypeFileUri,
+ DestinationTypeNativeUri
+};
+typedef NSUInteger CDVDestinationType;
+
+enum CDVEncodingType {
+ EncodingTypeJPEG = 0,
+ EncodingTypePNG
+};
+typedef NSUInteger CDVEncodingType;
+
+enum CDVMediaType {
+ MediaTypePicture = 0,
+ MediaTypeVideo,
+ MediaTypeAll
+};
+typedef NSUInteger CDVMediaType;
+
+@interface CDVPictureOptions : NSObject
+
+@property (strong) NSNumber* quality;
+@property (assign) CDVDestinationType destinationType;
+@property (assign) UIImagePickerControllerSourceType sourceType;
+@property (assign) CGSize targetSize;
+@property (assign) CDVEncodingType encodingType;
+@property (assign) CDVMediaType mediaType;
+@property (assign) BOOL allowsEditing;
+@property (assign) BOOL correctOrientation;
+@property (assign) BOOL saveToPhotoAlbum;
+@property (strong) NSDictionary* popoverOptions;
+@property (assign) UIImagePickerControllerCameraDevice cameraDirection;
+
+@property (assign) BOOL popoverSupported;
+@property (assign) BOOL usesGeolocation;
+@property (assign) BOOL cropToSize;
+
++ (instancetype) createFromTakePictureArguments:(CDVInvokedUrlCommand*)command;
+
+@end
+
+@interface CDVCameraPicker : UIImagePickerController
+
+@property (strong) CDVPictureOptions* pictureOptions;
+
+@property (copy) NSString* callbackId;
+@property (copy) NSString* postUrl;
+@property (strong) UIPopoverController* pickerPopoverController;
+@property (assign) BOOL cropToSize;
+@property (strong) UIView* webView;
+
++ (instancetype) createFromPictureOptions:(CDVPictureOptions*)options;
+
+@end
+
+// ======================================================================= //
+
+@interface CDVCamera : CDVPlugin <UIImagePickerControllerDelegate,
+ UINavigationControllerDelegate,
+ UIPopoverControllerDelegate,
+ CLLocationManagerDelegate>
+{}
+
+@property (strong) CDVCameraPicker* pickerController;
+@property (strong) NSMutableDictionary *metadata;
+@property (strong, nonatomic) CLLocationManager *locationManager;
+@property (strong) NSData* data;
+
+/*
+ * getPicture
+ *
+ * arguments:
+ * 1: this is the javascript function that will be called with the results, the first parameter passed to the
+ * javascript function is the picture as a Base64 encoded string
+ * 2: this is the javascript function to be called if there was an error
+ * options:
+ * quality: integer between 1 and 100
+ */
+- (void)takePicture:(CDVInvokedUrlCommand*)command;
+- (void)cleanup:(CDVInvokedUrlCommand*)command;
+- (void)repositionPopover:(CDVInvokedUrlCommand*)command;
+
+- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info;
+- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingImage:(UIImage*)image editingInfo:(NSDictionary*)editingInfo;
+- (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker;
+- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
+
+- (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation:(CLLocation*)oldLocation;
+- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error;
+
+@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.m
new file mode 100755
index 000000000..bf02ca2e6
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVCamera.m
@@ -0,0 +1,773 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVCamera.h"
+#import "CDVJpegHeaderWriter.h"
+#import "UIImage+CropScaleOrientation.h"
+#import <ImageIO/CGImageProperties.h>
+#import <AssetsLibrary/ALAssetRepresentation.h>
+#import <AssetsLibrary/AssetsLibrary.h>
+#import <AVFoundation/AVFoundation.h>
+#import <ImageIO/CGImageSource.h>
+#import <ImageIO/CGImageProperties.h>
+#import <ImageIO/CGImageDestination.h>
+#import <MobileCoreServices/UTCoreTypes.h>
+#import <objc/message.h>
+
+#ifndef __CORDOVA_4_0_0
+ #import <Cordova/NSData+Base64.h>
+#endif
+
+#define CDV_PHOTO_PREFIX @"cdv_photo_"
+
+static NSSet* org_apache_cordova_validArrowDirections;
+
+static NSString* toBase64(NSData* data) {
+ SEL s1 = NSSelectorFromString(@"cdv_base64EncodedString");
+ SEL s2 = NSSelectorFromString(@"base64EncodedString");
+ SEL s3 = NSSelectorFromString(@"base64EncodedStringWithOptions:");
+
+ if ([data respondsToSelector:s1]) {
+ NSString* (*func)(id, SEL) = (void *)[data methodForSelector:s1];
+ return func(data, s1);
+ } else if ([data respondsToSelector:s2]) {
+ NSString* (*func)(id, SEL) = (void *)[data methodForSelector:s2];
+ return func(data, s2);
+ } else if ([data respondsToSelector:s3]) {
+ NSString* (*func)(id, SEL, NSUInteger) = (void *)[data methodForSelector:s3];
+ return func(data, s3, 0);
+ } else {
+ return nil;
+ }
+}
+
+@implementation CDVPictureOptions
+
++ (instancetype) createFromTakePictureArguments:(CDVInvokedUrlCommand*)command
+{
+ CDVPictureOptions* pictureOptions = [[CDVPictureOptions alloc] init];
+
+ pictureOptions.quality = [command argumentAtIndex:0 withDefault:@(50)];
+ pictureOptions.destinationType = [[command argumentAtIndex:1 withDefault:@(DestinationTypeFileUri)] unsignedIntegerValue];
+ pictureOptions.sourceType = [[command argumentAtIndex:2 withDefault:@(UIImagePickerControllerSourceTypeCamera)] unsignedIntegerValue];
+
+ NSNumber* targetWidth = [command argumentAtIndex:3 withDefault:nil];
+ NSNumber* targetHeight = [command argumentAtIndex:4 withDefault:nil];
+ pictureOptions.targetSize = CGSizeMake(0, 0);
+ if ((targetWidth != nil) && (targetHeight != nil)) {
+ pictureOptions.targetSize = CGSizeMake([targetWidth floatValue], [targetHeight floatValue]);
+ }
+
+ pictureOptions.encodingType = [[command argumentAtIndex:5 withDefault:@(EncodingTypeJPEG)] unsignedIntegerValue];
+ pictureOptions.mediaType = [[command argumentAtIndex:6 withDefault:@(MediaTypePicture)] unsignedIntegerValue];
+ pictureOptions.allowsEditing = [[command argumentAtIndex:7 withDefault:@(NO)] boolValue];
+ pictureOptions.correctOrientation = [[command argumentAtIndex:8 withDefault:@(NO)] boolValue];
+ pictureOptions.saveToPhotoAlbum = [[command argumentAtIndex:9 withDefault:@(NO)] boolValue];
+ pictureOptions.popoverOptions = [command argumentAtIndex:10 withDefault:nil];
+ pictureOptions.cameraDirection = [[command argumentAtIndex:11 withDefault:@(UIImagePickerControllerCameraDeviceRear)] unsignedIntegerValue];
+
+ pictureOptions.popoverSupported = NO;
+ pictureOptions.usesGeolocation = NO;
+
+ return pictureOptions;
+}
+
+@end
+
+
+@interface CDVCamera ()
+
+@property (readwrite, assign) BOOL hasPendingOperation;
+
+@end
+
+@implementation CDVCamera
+
++ (void)initialize
+{
+ org_apache_cordova_validArrowDirections = [[NSSet alloc] initWithObjects:[NSNumber numberWithInt:UIPopoverArrowDirectionUp], [NSNumber numberWithInt:UIPopoverArrowDirectionDown], [NSNumber numberWithInt:UIPopoverArrowDirectionLeft], [NSNumber numberWithInt:UIPopoverArrowDirectionRight], [NSNumber numberWithInt:UIPopoverArrowDirectionAny], nil];
+}
+
+@synthesize hasPendingOperation, pickerController, locationManager;
+
+- (NSURL*) urlTransformer:(NSURL*)url
+{
+ NSURL* urlToTransform = url;
+
+ // for backwards compatibility - we check if this property is there
+ SEL sel = NSSelectorFromString(@"urlTransformer");
+ if ([self.commandDelegate respondsToSelector:sel]) {
+ // grab the block from the commandDelegate
+ NSURL* (^urlTransformer)(NSURL*) = ((id(*)(id, SEL))objc_msgSend)(self.commandDelegate, sel);
+ // if block is not null, we call it
+ if (urlTransformer) {
+ urlToTransform = urlTransformer(url);
+ }
+ }
+
+ return urlToTransform;
+}
+
+- (BOOL)usesGeolocation
+{
+ id useGeo = [self.commandDelegate.settings objectForKey:[@"CameraUsesGeolocation" lowercaseString]];
+ return [(NSNumber*)useGeo boolValue];
+}
+
+- (BOOL)popoverSupported
+{
+ return (NSClassFromString(@"UIPopoverController") != nil) &&
+ (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
+}
+
+- (void)takePicture:(CDVInvokedUrlCommand*)command
+{
+ self.hasPendingOperation = YES;
+ __weak CDVCamera* weakSelf = self;
+
+ [self.commandDelegate runInBackground:^{
+ CDVPictureOptions* pictureOptions = [CDVPictureOptions createFromTakePictureArguments:command];
+ pictureOptions.popoverSupported = [weakSelf popoverSupported];
+ pictureOptions.usesGeolocation = [weakSelf usesGeolocation];
+ pictureOptions.cropToSize = NO;
+
+ BOOL hasCamera = [UIImagePickerController isSourceTypeAvailable:pictureOptions.sourceType];
+ if (!hasCamera) {
+ NSLog(@"Camera.getPicture: source type %lu not available.", (unsigned long)pictureOptions.sourceType);
+ CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"No camera available"];
+ [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId];
+ return;
+ }
+
+ // Validate the app has permission to access the camera
+ if (pictureOptions.sourceType == UIImagePickerControllerSourceTypeCamera) {
+ [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted)
+ {
+ if(!granted)
+ {
+ // Denied; show an alert
+ dispatch_async(dispatch_get_main_queue(), ^{
+ UIAlertController *alertController = [UIAlertController alertControllerWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] message:NSLocalizedString(@"Access to the camera has been prohibited; please enable it in the Settings app to continue.", nil) preferredStyle:UIAlertControllerStyleAlert];
+ [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+ [weakSelf sendNoPermissionResult:command.callbackId];
+ }]];
+ [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Settings", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+ [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+ [weakSelf sendNoPermissionResult:command.callbackId];
+ }]];
+ [weakSelf.viewController presentViewController:alertController animated:YES completion:nil];
+ });
+ } else {
+ [weakSelf showCameraPicker:command.callbackId withOptions:pictureOptions];
+ }
+ }];
+ } else {
+ [weakSelf showCameraPicker:command.callbackId withOptions:pictureOptions];
+ }
+ }];
+}
+
+- (void)showCameraPicker:(NSString*)callbackId withOptions:(CDVPictureOptions *) pictureOptions
+{
+ CDVCameraPicker* cameraPicker = [CDVCameraPicker createFromPictureOptions:pictureOptions];
+ self.pickerController = cameraPicker;
+
+ cameraPicker.delegate = self;
+ cameraPicker.callbackId = callbackId;
+ // we need to capture this state for memory warnings that dealloc this object
+ cameraPicker.webView = self.webView;
+
+ // Perform UI operations on the main thread
+ dispatch_async(dispatch_get_main_queue(), ^{
+ // If a popover is already open, close it; we only want one at a time.
+ if (([[self pickerController] pickerPopoverController] != nil) && [[[self pickerController] pickerPopoverController] isPopoverVisible]) {
+ [[[self pickerController] pickerPopoverController] dismissPopoverAnimated:YES];
+ [[[self pickerController] pickerPopoverController] setDelegate:nil];
+ [[self pickerController] setPickerPopoverController:nil];
+ }
+
+ if ([self popoverSupported] && (pictureOptions.sourceType != UIImagePickerControllerSourceTypeCamera)) {
+ if (cameraPicker.pickerPopoverController == nil) {
+ cameraPicker.pickerPopoverController = [[NSClassFromString(@"UIPopoverController") alloc] initWithContentViewController:cameraPicker];
+ }
+ [self displayPopover:pictureOptions.popoverOptions];
+ self.hasPendingOperation = NO;
+ } else {
+ cameraPicker.modalPresentationStyle = UIModalPresentationCurrentContext;
+ [self.viewController presentViewController:cameraPicker animated:YES completion:^{
+ self.hasPendingOperation = NO;
+ }];
+ }
+ });
+}
+
+- (void)sendNoPermissionResult:(NSString*)callbackId
+{
+ CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to camera"]; // error callback expects string ATM
+
+ [self.commandDelegate sendPluginResult:result callbackId:callbackId];
+
+ self.hasPendingOperation = NO;
+ self.pickerController = nil;
+}
+
+- (void)repositionPopover:(CDVInvokedUrlCommand*)command
+{
+ if (([[self pickerController] pickerPopoverController] != nil) && [[[self pickerController] pickerPopoverController] isPopoverVisible]) {
+
+ [[[self pickerController] pickerPopoverController] dismissPopoverAnimated:NO];
+
+ NSDictionary* options = [command argumentAtIndex:0 withDefault:nil];
+ [self displayPopover:options];
+ }
+}
+
+- (NSInteger)integerValueForKey:(NSDictionary*)dict key:(NSString*)key defaultValue:(NSInteger)defaultValue
+{
+ NSInteger value = defaultValue;
+
+ NSNumber* val = [dict valueForKey:key]; // value is an NSNumber
+
+ if (val != nil) {
+ value = [val integerValue];
+ }
+ return value;
+}
+
+- (void)displayPopover:(NSDictionary*)options
+{
+ NSInteger x = 0;
+ NSInteger y = 32;
+ NSInteger width = 320;
+ NSInteger height = 480;
+ UIPopoverArrowDirection arrowDirection = UIPopoverArrowDirectionAny;
+
+ if (options) {
+ x = [self integerValueForKey:options key:@"x" defaultValue:0];
+ y = [self integerValueForKey:options key:@"y" defaultValue:32];
+ width = [self integerValueForKey:options key:@"width" defaultValue:320];
+ height = [self integerValueForKey:options key:@"height" defaultValue:480];
+ arrowDirection = [self integerValueForKey:options key:@"arrowDir" defaultValue:UIPopoverArrowDirectionAny];
+ if (![org_apache_cordova_validArrowDirections containsObject:[NSNumber numberWithUnsignedInteger:arrowDirection]]) {
+ arrowDirection = UIPopoverArrowDirectionAny;
+ }
+ }
+
+ [[[self pickerController] pickerPopoverController] setDelegate:self];
+ [[[self pickerController] pickerPopoverController] presentPopoverFromRect:CGRectMake(x, y, width, height)
+ inView:[self.webView superview]
+ permittedArrowDirections:arrowDirection
+ animated:YES];
+}
+
+- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
+{
+ if([navigationController isKindOfClass:[UIImagePickerController class]]){
+
+ // If popoverWidth and popoverHeight are specified and are greater than 0, then set popover size, else use apple's default popoverSize
+ NSDictionary* options = self.pickerController.pictureOptions.popoverOptions;
+ if(options) {
+ NSInteger popoverWidth = [self integerValueForKey:options key:@"popoverWidth" defaultValue:0];
+ NSInteger popoverHeight = [self integerValueForKey:options key:@"popoverHeight" defaultValue:0];
+ if(popoverWidth > 0 && popoverHeight > 0)
+ {
+ [viewController setPreferredContentSize:CGSizeMake(popoverWidth,popoverHeight)];
+ }
+ }
+
+
+ UIImagePickerController* cameraPicker = (UIImagePickerController*)navigationController;
+
+ if(![cameraPicker.mediaTypes containsObject:(NSString*)kUTTypeImage]){
+ [viewController.navigationItem setTitle:NSLocalizedString(@"Videos", nil)];
+ }
+ }
+}
+
+- (void)cleanup:(CDVInvokedUrlCommand*)command
+{
+ // empty the tmp directory
+ NSFileManager* fileMgr = [[NSFileManager alloc] init];
+ NSError* err = nil;
+ BOOL hasErrors = NO;
+
+ // clear contents of NSTemporaryDirectory
+ NSString* tempDirectoryPath = NSTemporaryDirectory();
+ NSDirectoryEnumerator* directoryEnumerator = [fileMgr enumeratorAtPath:tempDirectoryPath];
+ NSString* fileName = nil;
+ BOOL result;
+
+ while ((fileName = [directoryEnumerator nextObject])) {
+ // only delete the files we created
+ if (![fileName hasPrefix:CDV_PHOTO_PREFIX]) {
+ continue;
+ }
+ NSString* filePath = [tempDirectoryPath stringByAppendingPathComponent:fileName];
+ result = [fileMgr removeItemAtPath:filePath error:&err];
+ if (!result && err) {
+ NSLog(@"Failed to delete: %@ (error: %@)", filePath, err);
+ hasErrors = YES;
+ }
+ }
+
+ CDVPluginResult* pluginResult;
+ if (hasErrors) {
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:@"One or more files failed to be deleted."];
+ } else {
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ }
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+}
+
+- (void)popoverControllerDidDismissPopover:(id)popoverController
+{
+ UIPopoverController* pc = (UIPopoverController*)popoverController;
+
+ [pc dismissPopoverAnimated:YES];
+ pc.delegate = nil;
+ if (self.pickerController && self.pickerController.callbackId && self.pickerController.pickerPopoverController) {
+ self.pickerController.pickerPopoverController = nil;
+ NSString* callbackId = self.pickerController.callbackId;
+ CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"no image selected"]; // error callback expects string ATM
+ [self.commandDelegate sendPluginResult:result callbackId:callbackId];
+ }
+ self.hasPendingOperation = NO;
+}
+
+- (NSData*)processImage:(UIImage*)image info:(NSDictionary*)info options:(CDVPictureOptions*)options
+{
+ NSData* data = nil;
+
+ switch (options.encodingType) {
+ case EncodingTypePNG:
+ data = UIImagePNGRepresentation(image);
+ break;
+ case EncodingTypeJPEG:
+ {
+ if ((options.allowsEditing == NO) && (options.targetSize.width <= 0) && (options.targetSize.height <= 0) && (options.correctOrientation == NO) && (([options.quality integerValue] == 100) || (options.sourceType != UIImagePickerControllerSourceTypeCamera))){
+ // use image unedited as requested , don't resize
+ data = UIImageJPEGRepresentation(image, 1.0);
+ } else {
+ data = UIImageJPEGRepresentation(image, [options.quality floatValue] / 100.0f);
+ }
+
+ if (options.usesGeolocation) {
+ NSDictionary* controllerMetadata = [info objectForKey:@"UIImagePickerControllerMediaMetadata"];
+ if (controllerMetadata) {
+ self.data = data;
+ self.metadata = [[NSMutableDictionary alloc] init];
+
+ NSMutableDictionary* EXIFDictionary = [[controllerMetadata objectForKey:(NSString*)kCGImagePropertyExifDictionary]mutableCopy];
+ if (EXIFDictionary) {
+ [self.metadata setObject:EXIFDictionary forKey:(NSString*)kCGImagePropertyExifDictionary];
+ }
+
+ if (IsAtLeastiOSVersion(@"8.0")) {
+ [[self locationManager] performSelector:NSSelectorFromString(@"requestWhenInUseAuthorization") withObject:nil afterDelay:0];
+ }
+ [[self locationManager] startUpdatingLocation];
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ };
+
+ return data;
+}
+
+- (NSString*)tempFilePath:(NSString*)extension
+{
+ NSString* docsPath = [NSTemporaryDirectory()stringByStandardizingPath];
+ NSFileManager* fileMgr = [[NSFileManager alloc] init]; // recommended by Apple (vs [NSFileManager defaultManager]) to be threadsafe
+ NSString* filePath;
+
+ // generate unique file name
+ int i = 1;
+ do {
+ filePath = [NSString stringWithFormat:@"%@/%@%03d.%@", docsPath, CDV_PHOTO_PREFIX, i++, extension];
+ } while ([fileMgr fileExistsAtPath:filePath]);
+
+ return filePath;
+}
+
+- (UIImage*)retrieveImage:(NSDictionary*)info options:(CDVPictureOptions*)options
+{
+ // get the image
+ UIImage* image = nil;
+ if (options.allowsEditing && [info objectForKey:UIImagePickerControllerEditedImage]) {
+ image = [info objectForKey:UIImagePickerControllerEditedImage];
+ } else {
+ image = [info objectForKey:UIImagePickerControllerOriginalImage];
+ }
+
+ if (options.correctOrientation) {
+ image = [image imageCorrectedForCaptureOrientation];
+ }
+
+ UIImage* scaledImage = nil;
+
+ if ((options.targetSize.width > 0) && (options.targetSize.height > 0)) {
+ // if cropToSize, resize image and crop to target size, otherwise resize to fit target without cropping
+ if (options.cropToSize) {
+ scaledImage = [image imageByScalingAndCroppingForSize:options.targetSize];
+ } else {
+ scaledImage = [image imageByScalingNotCroppingForSize:options.targetSize];
+ }
+ }
+
+ return (scaledImage == nil ? image : scaledImage);
+}
+
+- (void)resultForImage:(CDVPictureOptions*)options info:(NSDictionary*)info completion:(void (^)(CDVPluginResult* res))completion
+{
+ CDVPluginResult* result = nil;
+ BOOL saveToPhotoAlbum = options.saveToPhotoAlbum;
+ UIImage* image = nil;
+
+ switch (options.destinationType) {
+ case DestinationTypeNativeUri:
+ {
+ NSURL* url = [info objectForKey:UIImagePickerControllerReferenceURL];
+ saveToPhotoAlbum = NO;
+ // If, for example, we use sourceType = Camera, URL might be nil because image is stored in memory.
+ // In this case we must save image to device before obtaining an URI.
+ if (url == nil) {
+ image = [self retrieveImage:info options:options];
+ ALAssetsLibrary* library = [ALAssetsLibrary new];
+ [library writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)(image.imageOrientation) completionBlock:^(NSURL *assetURL, NSError *error) {
+ CDVPluginResult* resultToReturn = nil;
+ if (error) {
+ resultToReturn = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[error localizedDescription]];
+ } else {
+ NSString* nativeUri = [[self urlTransformer:assetURL] absoluteString];
+ resultToReturn = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nativeUri];
+ }
+ completion(resultToReturn);
+ }];
+ return;
+ } else {
+ NSString* nativeUri = [[self urlTransformer:url] absoluteString];
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nativeUri];
+ }
+ }
+ break;
+ case DestinationTypeFileUri:
+ {
+ image = [self retrieveImage:info options:options];
+ NSData* data = [self processImage:image info:info options:options];
+ if (data) {
+
+ NSString* extension = options.encodingType == EncodingTypePNG? @"png" : @"jpg";
+ NSString* filePath = [self tempFilePath:extension];
+ NSError* err = nil;
+
+ // save file
+ if (![data writeToFile:filePath options:NSAtomicWrite error:&err]) {
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[err localizedDescription]];
+ } else {
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[[self urlTransformer:[NSURL fileURLWithPath:filePath]] absoluteString]];
+ }
+ }
+ }
+ break;
+ case DestinationTypeDataUrl:
+ {
+ image = [self retrieveImage:info options:options];
+ NSData* data = [self processImage:image info:info options:options];
+ if (data) {
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:toBase64(data)];
+ }
+ }
+ break;
+ default:
+ break;
+ };
+
+ if (saveToPhotoAlbum && image) {
+ ALAssetsLibrary* library = [ALAssetsLibrary new];
+ [library writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)(image.imageOrientation) completionBlock:nil];
+ }
+
+ completion(result);
+}
+
+- (CDVPluginResult*)resultForVideo:(NSDictionary*)info
+{
+ NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] absoluteString];
+ return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:moviePath];
+}
+
+- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
+{
+ __weak CDVCameraPicker* cameraPicker = (CDVCameraPicker*)picker;
+ __weak CDVCamera* weakSelf = self;
+
+ dispatch_block_t invoke = ^(void) {
+ __block CDVPluginResult* result = nil;
+
+ NSString* mediaType = [info objectForKey:UIImagePickerControllerMediaType];
+ if ([mediaType isEqualToString:(NSString*)kUTTypeImage]) {
+ [weakSelf resultForImage:cameraPicker.pictureOptions info:info completion:^(CDVPluginResult* res) {
+ if (![self usesGeolocation] || picker.sourceType != UIImagePickerControllerSourceTypeCamera) {
+ [weakSelf.commandDelegate sendPluginResult:res callbackId:cameraPicker.callbackId];
+ weakSelf.hasPendingOperation = NO;
+ weakSelf.pickerController = nil;
+ }
+ }];
+ }
+ else {
+ result = [weakSelf resultForVideo:info];
+ [weakSelf.commandDelegate sendPluginResult:result callbackId:cameraPicker.callbackId];
+ weakSelf.hasPendingOperation = NO;
+ weakSelf.pickerController = nil;
+ }
+ };
+
+ if (cameraPicker.pictureOptions.popoverSupported && (cameraPicker.pickerPopoverController != nil)) {
+ [cameraPicker.pickerPopoverController dismissPopoverAnimated:YES];
+ cameraPicker.pickerPopoverController.delegate = nil;
+ cameraPicker.pickerPopoverController = nil;
+ invoke();
+ } else {
+ [[cameraPicker presentingViewController] dismissViewControllerAnimated:YES completion:invoke];
+ }
+}
+
+// older api calls newer didFinishPickingMediaWithInfo
+- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingImage:(UIImage*)image editingInfo:(NSDictionary*)editingInfo
+{
+ NSDictionary* imageInfo = [NSDictionary dictionaryWithObject:image forKey:UIImagePickerControllerOriginalImage];
+
+ [self imagePickerController:picker didFinishPickingMediaWithInfo:imageInfo];
+}
+
+- (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker
+{
+ __weak CDVCameraPicker* cameraPicker = (CDVCameraPicker*)picker;
+ __weak CDVCamera* weakSelf = self;
+
+ dispatch_block_t invoke = ^ (void) {
+ CDVPluginResult* result;
+ if (picker.sourceType == UIImagePickerControllerSourceTypeCamera && [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] != ALAuthorizationStatusAuthorized) {
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to camera"];
+ } else if (picker.sourceType != UIImagePickerControllerSourceTypeCamera && ! IsAtLeastiOSVersion(@"11.0") && [ALAssetsLibrary authorizationStatus] != ALAuthorizationStatusAuthorized) {
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"has no access to assets"];
+ } else {
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"No Image Selected"];
+ }
+
+
+ [weakSelf.commandDelegate sendPluginResult:result callbackId:cameraPicker.callbackId];
+
+ weakSelf.hasPendingOperation = NO;
+ weakSelf.pickerController = nil;
+ };
+
+ [[cameraPicker presentingViewController] dismissViewControllerAnimated:YES completion:invoke];
+}
+
+- (CLLocationManager*)locationManager
+{
+ if (locationManager != nil) {
+ return locationManager;
+ }
+
+ locationManager = [[CLLocationManager alloc] init];
+ [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
+ [locationManager setDelegate:self];
+
+ return locationManager;
+}
+
+- (void)locationManager:(CLLocationManager*)manager didUpdateToLocation:(CLLocation*)newLocation fromLocation:(CLLocation*)oldLocation
+{
+ if (locationManager == nil) {
+ return;
+ }
+
+ [self.locationManager stopUpdatingLocation];
+ self.locationManager = nil;
+
+ NSMutableDictionary *GPSDictionary = [[NSMutableDictionary dictionary] init];
+
+ CLLocationDegrees latitude = newLocation.coordinate.latitude;
+ CLLocationDegrees longitude = newLocation.coordinate.longitude;
+
+ // latitude
+ if (latitude < 0.0) {
+ latitude = latitude * -1.0f;
+ [GPSDictionary setObject:@"S" forKey:(NSString*)kCGImagePropertyGPSLatitudeRef];
+ } else {
+ [GPSDictionary setObject:@"N" forKey:(NSString*)kCGImagePropertyGPSLatitudeRef];
+ }
+ [GPSDictionary setObject:[NSNumber numberWithFloat:latitude] forKey:(NSString*)kCGImagePropertyGPSLatitude];
+
+ // longitude
+ if (longitude < 0.0) {
+ longitude = longitude * -1.0f;
+ [GPSDictionary setObject:@"W" forKey:(NSString*)kCGImagePropertyGPSLongitudeRef];
+ }
+ else {
+ [GPSDictionary setObject:@"E" forKey:(NSString*)kCGImagePropertyGPSLongitudeRef];
+ }
+ [GPSDictionary setObject:[NSNumber numberWithFloat:longitude] forKey:(NSString*)kCGImagePropertyGPSLongitude];
+
+ // altitude
+ CGFloat altitude = newLocation.altitude;
+ if (!isnan(altitude)){
+ if (altitude < 0) {
+ altitude = -altitude;
+ [GPSDictionary setObject:@"1" forKey:(NSString *)kCGImagePropertyGPSAltitudeRef];
+ } else {
+ [GPSDictionary setObject:@"0" forKey:(NSString *)kCGImagePropertyGPSAltitudeRef];
+ }
+ [GPSDictionary setObject:[NSNumber numberWithFloat:altitude] forKey:(NSString *)kCGImagePropertyGPSAltitude];
+ }
+
+ // Time and date
+ NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
+ [formatter setDateFormat:@"HH:mm:ss.SSSSSS"];
+ [formatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
+ [GPSDictionary setObject:[formatter stringFromDate:newLocation.timestamp] forKey:(NSString *)kCGImagePropertyGPSTimeStamp];
+ [formatter setDateFormat:@"yyyy:MM:dd"];
+ [GPSDictionary setObject:[formatter stringFromDate:newLocation.timestamp] forKey:(NSString *)kCGImagePropertyGPSDateStamp];
+
+ [self.metadata setObject:GPSDictionary forKey:(NSString *)kCGImagePropertyGPSDictionary];
+ [self imagePickerControllerReturnImageResult];
+}
+
+- (void)locationManager:(CLLocationManager*)manager didFailWithError:(NSError*)error
+{
+ if (locationManager == nil) {
+ return;
+ }
+
+ [self.locationManager stopUpdatingLocation];
+ self.locationManager = nil;
+
+ [self imagePickerControllerReturnImageResult];
+}
+
+- (void)imagePickerControllerReturnImageResult
+{
+ CDVPictureOptions* options = self.pickerController.pictureOptions;
+ CDVPluginResult* result = nil;
+
+ if (self.metadata) {
+ CGImageSourceRef sourceImage = CGImageSourceCreateWithData((__bridge CFDataRef)self.data, NULL);
+ CFStringRef sourceType = CGImageSourceGetType(sourceImage);
+
+ CGImageDestinationRef destinationImage = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)self.data, sourceType, 1, NULL);
+ CGImageDestinationAddImageFromSource(destinationImage, sourceImage, 0, (__bridge CFDictionaryRef)self.metadata);
+ CGImageDestinationFinalize(destinationImage);
+
+ CFRelease(sourceImage);
+ CFRelease(destinationImage);
+ }
+
+ switch (options.destinationType) {
+ case DestinationTypeFileUri:
+ {
+ NSError* err = nil;
+ NSString* extension = self.pickerController.pictureOptions.encodingType == EncodingTypePNG ? @"png":@"jpg";
+ NSString* filePath = [self tempFilePath:extension];
+
+ // save file
+ if (![self.data writeToFile:filePath options:NSAtomicWrite error:&err]) {
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsString:[err localizedDescription]];
+ }
+ else {
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:[[self urlTransformer:[NSURL fileURLWithPath:filePath]] absoluteString]];
+ }
+ }
+ break;
+ case DestinationTypeDataUrl:
+ {
+ result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:toBase64(self.data)];
+ }
+ break;
+ case DestinationTypeNativeUri:
+ default:
+ break;
+ };
+
+ if (result) {
+ [self.commandDelegate sendPluginResult:result callbackId:self.pickerController.callbackId];
+ }
+
+ self.hasPendingOperation = NO;
+ self.pickerController = nil;
+ self.data = nil;
+ self.metadata = nil;
+
+ if (options.saveToPhotoAlbum) {
+ ALAssetsLibrary *library = [ALAssetsLibrary new];
+ [library writeImageDataToSavedPhotosAlbum:self.data metadata:self.metadata completionBlock:nil];
+ }
+}
+
+@end
+
+@implementation CDVCameraPicker
+
+- (BOOL)prefersStatusBarHidden
+{
+ return YES;
+}
+
+- (UIViewController*)childViewControllerForStatusBarHidden
+{
+ return nil;
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+ SEL sel = NSSelectorFromString(@"setNeedsStatusBarAppearanceUpdate");
+ if ([self respondsToSelector:sel]) {
+ [self performSelector:sel withObject:nil afterDelay:0];
+ }
+
+ [super viewWillAppear:animated];
+}
+
++ (instancetype) createFromPictureOptions:(CDVPictureOptions*)pictureOptions;
+{
+ CDVCameraPicker* cameraPicker = [[CDVCameraPicker alloc] init];
+ cameraPicker.pictureOptions = pictureOptions;
+ cameraPicker.sourceType = pictureOptions.sourceType;
+ cameraPicker.allowsEditing = pictureOptions.allowsEditing;
+
+ if (cameraPicker.sourceType == UIImagePickerControllerSourceTypeCamera) {
+ // We only allow taking pictures (no video) in this API.
+ cameraPicker.mediaTypes = @[(NSString*)kUTTypeImage];
+ // We can only set the camera device if we're actually using the camera.
+ cameraPicker.cameraDevice = pictureOptions.cameraDirection;
+ } else if (pictureOptions.mediaType == MediaTypeAll) {
+ cameraPicker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:cameraPicker.sourceType];
+ } else {
+ NSArray* mediaArray = @[(NSString*)(pictureOptions.mediaType == MediaTypeVideo ? kUTTypeMovie : kUTTypeImage)];
+ cameraPicker.mediaTypes = mediaArray;
+ }
+
+ return cameraPicker;
+}
+
+@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVExif.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVExif.h
new file mode 100755
index 000000000..3e8adbd02
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVExif.h
@@ -0,0 +1,43 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#ifndef CordovaLib_ExifData_h
+#define CordovaLib_ExifData_h
+
+// exif data types
+typedef enum exifDataTypes {
+ EDT_UBYTE = 1, // 8 bit unsigned integer
+ EDT_ASCII_STRING, // 8 bits containing 7 bit ASCII code, null terminated
+ EDT_USHORT, // 16 bit unsigned integer
+ EDT_ULONG, // 32 bit unsigned integer
+ EDT_URATIONAL, // 2 longs, first is numerator and second is denominator
+ EDT_SBYTE,
+ EDT_UNDEFINED, // 8 bits
+ EDT_SSHORT,
+ EDT_SLONG, // 32bit signed integer (2's complement)
+ EDT_SRATIONAL, // 2 SLONGS, first long is numerator, second is denominator
+ EDT_SINGLEFLOAT,
+ EDT_DOUBLEFLOAT
+} ExifDataTypes;
+
+// maps integer code for exif data types to width in bytes
+static const int DataTypeToWidth[] = {1,1,2,4,8,1,1,2,4,8,4,8};
+
+static const int RECURSE_HORIZON = 8;
+#endif
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.h
new file mode 100755
index 000000000..3b43ef0b7
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.h
@@ -0,0 +1,62 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface CDVJpegHeaderWriter : NSObject {
+ NSDictionary * SubIFDTagFormatDict;
+ NSDictionary * IFD0TagFormatDict;
+}
+
+- (NSData*) spliceExifBlockIntoJpeg: (NSData*) jpegdata
+ withExifBlock: (NSString*) exifstr;
+- (NSString*) createExifAPP1 : (NSDictionary*) datadict;
+- (NSString*) formattedHexStringFromDecimalNumber: (NSNumber*) numb
+ withPlaces: (NSNumber*) width;
+- (NSString*) formatNumberWithLeadingZeroes: (NSNumber*) numb
+ withPlaces: (NSNumber*) places;
+- (NSString*) decimalToUnsignedRational: (NSNumber*) numb
+ withResultNumerator: (NSNumber**) numerator
+ withResultDenominator: (NSNumber**) denominator;
+- (void) continuedFraction: (double) val
+ withFractionList: (NSMutableArray*) fractionlist
+ withHorizon: (int) horizon;
+//- (void) expandContinuedFraction: (NSArray*) fractionlist;
+- (void) splitDouble: (double) val
+ withIntComponent: (int*) rightside
+ withFloatRemainder: (double*) leftside;
+- (NSString*) formatRationalWithNumerator: (NSNumber*) numerator
+ withDenominator: (NSNumber*) denominator
+ asSigned: (Boolean) signedFlag;
+- (NSString*) hexStringFromData : (NSData*) data;
+- (NSNumber*) numericFromHexString : (NSString *) hexstring;
+
+/*
+- (void) readExifMetaData : (NSData*) imgdata;
+- (void) spliceImageData : (NSData*) imgdata withExifData: (NSDictionary*) exifdata;
+- (void) locateExifMetaData : (NSData*) imgdata;
+- (NSString*) createExifAPP1 : (NSDictionary*) datadict;
+- (void) createExifDataString : (NSDictionary*) datadict;
+- (NSString*) createDataElement : (NSString*) element
+ withElementData: (NSString*) data
+ withExternalDataBlock: (NSDictionary*) memblock;
+- (NSString*) hexStringFromData : (NSData*) data;
+- (NSNumber*) numericFromHexString : (NSString *) hexstring;
+*/
+@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.m
new file mode 100755
index 000000000..4d3ea2443
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/CDVJpegHeaderWriter.m
@@ -0,0 +1,547 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVJpegHeaderWriter.h"
+#include "CDVExif.h"
+
+/* macros for tag info shorthand:
+ tagno : tag number
+ typecode : data type
+ components : number of components
+ appendString (TAGINF_W_APPEND only) : string to append to data
+ Exif date data format include an extra 0x00 to the end of the data
+ */
+#define TAGINF(tagno, typecode, components) [NSArray arrayWithObjects: tagno, typecode, components, nil]
+#define TAGINF_W_APPEND(tagno, typecode, components, appendString) [NSArray arrayWithObjects: tagno, typecode, components, appendString, nil]
+
+const uint mJpegId = 0xffd8; // JPEG format marker
+const uint mExifMarker = 0xffe1; // APP1 jpeg header marker
+const uint mExif = 0x45786966; // ASCII 'Exif', first characters of valid exif header after size
+const uint mMotorallaByteAlign = 0x4d4d; // 'MM', motorola byte align, msb first or 'sane'
+const uint mIntelByteAlgin = 0x4949; // 'II', Intel byte align, lsb first or 'batshit crazy reverso world'
+const uint mTiffLength = 0x2a; // after byte align bits, next to bits are 0x002a(MM) or 0x2a00(II), tiff version number
+
+
+@implementation CDVJpegHeaderWriter
+
+- (id) init {
+ self = [super init];
+ // supported tags for exif IFD
+ IFD0TagFormatDict = [[NSDictionary alloc] initWithObjectsAndKeys:
+ // TAGINF(@"010e", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"ImageDescription",
+ TAGINF_W_APPEND(@"0132", [NSNumber numberWithInt:EDT_ASCII_STRING], @20, @"00"), @"DateTime",
+ TAGINF(@"010f", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"Make",
+ TAGINF(@"0110", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"Model",
+ TAGINF(@"0131", [NSNumber numberWithInt:EDT_ASCII_STRING], @0), @"Software",
+ TAGINF(@"011a", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"XResolution",
+ TAGINF(@"011b", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"YResolution",
+ // currently supplied outside of Exif data block by UIImagePickerControllerMediaMetadata, this is set manually in CDVCamera.m
+ /* TAGINF(@"0112", [NSNumber numberWithInt:EDT_USHORT], @1), @"Orientation",
+
+ // rest of the tags are supported by exif spec, but are not specified by UIImagePickerControllerMediaMedadata
+ // should camera hardware supply these values in future versions, or if they can be derived, ImageHeaderWriter will include them gracefully
+ TAGINF(@"0128", [NSNumber numberWithInt:EDT_USHORT], @1), @"ResolutionUnit",
+ TAGINF(@"013e", [NSNumber numberWithInt:EDT_URATIONAL], @2), @"WhitePoint",
+ TAGINF(@"013f", [NSNumber numberWithInt:EDT_URATIONAL], @6), @"PrimaryChromaticities",
+ TAGINF(@"0211", [NSNumber numberWithInt:EDT_URATIONAL], @3), @"YCbCrCoefficients",
+ TAGINF(@"0213", [NSNumber numberWithInt:EDT_USHORT], @1), @"YCbCrPositioning",
+ TAGINF(@"0214", [NSNumber numberWithInt:EDT_URATIONAL], @6), @"ReferenceBlackWhite",
+ TAGINF(@"8298", [NSNumber numberWithInt:EDT_URATIONAL], @0), @"Copyright",
+
+ // offset to exif subifd, we determine this dynamically based on the size of the main exif IFD
+ TAGINF(@"8769", [NSNumber numberWithInt:EDT_ULONG], @1), @"ExifOffset",*/
+ nil];
+
+
+ // supported tages for exif subIFD
+ SubIFDTagFormatDict = [[NSDictionary alloc] initWithObjectsAndKeys:
+ //TAGINF(@"9000", [NSNumber numberWithInt:], @), @"ExifVersion",
+ //TAGINF(@"9202",[NSNumber numberWithInt:EDT_URATIONAL],@1), @"ApertureValue",
+ //TAGINF(@"9203",[NSNumber numberWithInt:EDT_SRATIONAL],@1), @"BrightnessValue",
+ TAGINF(@"a001",[NSNumber numberWithInt:EDT_USHORT],@1), @"ColorSpace",
+ TAGINF_W_APPEND(@"9004",[NSNumber numberWithInt:EDT_ASCII_STRING],@20,@"00"), @"DateTimeDigitized",
+ TAGINF_W_APPEND(@"9003",[NSNumber numberWithInt:EDT_ASCII_STRING],@20,@"00"), @"DateTimeOriginal",
+ TAGINF(@"a402", [NSNumber numberWithInt:EDT_USHORT], @1), @"ExposureMode",
+ TAGINF(@"8822", [NSNumber numberWithInt:EDT_USHORT], @1), @"ExposureProgram",
+ //TAGINF(@"829a", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"ExposureTime",
+ //TAGINF(@"829d", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"FNumber",
+ TAGINF(@"9209", [NSNumber numberWithInt:EDT_USHORT], @1), @"Flash",
+ // FocalLengthIn35mmFilm
+ TAGINF(@"a405", [NSNumber numberWithInt:EDT_USHORT], @1), @"FocalLenIn35mmFilm",
+ //TAGINF(@"920a", [NSNumber numberWithInt:EDT_URATIONAL], @1), @"FocalLength",
+ //TAGINF(@"8827", [NSNumber numberWithInt:EDT_USHORT], @2), @"ISOSpeedRatings",
+ TAGINF(@"9207", [NSNumber numberWithInt:EDT_USHORT],@1), @"MeteringMode",
+ // specific to compressed data
+ TAGINF(@"a002", [NSNumber numberWithInt:EDT_ULONG],@1), @"PixelXDimension",
+ TAGINF(@"a003", [NSNumber numberWithInt:EDT_ULONG],@1), @"PixelYDimension",
+ // data type undefined, but this is a DSC camera, so value is always 1, treat as ushort
+ TAGINF(@"a301", [NSNumber numberWithInt:EDT_USHORT],@1), @"SceneType",
+ TAGINF(@"a217",[NSNumber numberWithInt:EDT_USHORT],@1), @"SensingMethod",
+ //TAGINF(@"9201", [NSNumber numberWithInt:EDT_SRATIONAL], @1), @"ShutterSpeedValue",
+ // specifies location of main subject in scene (x,y,wdith,height) expressed before rotation processing
+ //TAGINF(@"9214", [NSNumber numberWithInt:EDT_USHORT], @4), @"SubjectArea",
+ TAGINF(@"a403", [NSNumber numberWithInt:EDT_USHORT], @1), @"WhiteBalance",
+ nil];
+ return self;
+}
+
+- (NSData*) spliceExifBlockIntoJpeg: (NSData*) jpegdata withExifBlock: (NSString*) exifstr {
+
+ CDVJpegHeaderWriter * exifWriter = [[CDVJpegHeaderWriter alloc] init];
+
+ NSMutableData * exifdata = [NSMutableData dataWithCapacity: [exifstr length]/2];
+ int idx;
+ for (idx = 0; idx+1 < [exifstr length]; idx+=2) {
+ NSRange range = NSMakeRange(idx, 2);
+ NSString* hexStr = [exifstr substringWithRange:range];
+ NSScanner* scanner = [NSScanner scannerWithString:hexStr];
+ unsigned int intValue;
+ [scanner scanHexInt:&intValue];
+ [exifdata appendBytes:&intValue length:1];
+ }
+
+ NSMutableData * ddata = [NSMutableData dataWithCapacity: [jpegdata length]];
+ NSMakeRange(0,4);
+ int loc = 0;
+ bool done = false;
+ // read the jpeg data until we encounter the app1==0xFFE1 marker
+ while (loc+1 < [jpegdata length]) {
+ NSData * blag = [jpegdata subdataWithRange: NSMakeRange(loc,2)];
+ if( [[blag description] isEqualToString : @"<ffe1>"]) {
+ // read the APP1 block size bits
+ NSString * the = [exifWriter hexStringFromData:[jpegdata subdataWithRange: NSMakeRange(loc+2,2)]];
+ NSNumber * app1width = [exifWriter numericFromHexString:the];
+ //consume the original app1 block
+ [ddata appendData:exifdata];
+ // advance our loc marker past app1
+ loc += [app1width intValue] + 2;
+ done = true;
+ } else {
+ if(!done) {
+ [ddata appendData:blag];
+ loc += 2;
+ } else {
+ break;
+ }
+ }
+ }
+ // copy the remaining data
+ [ddata appendData:[jpegdata subdataWithRange: NSMakeRange(loc,[jpegdata length]-loc)]];
+ return ddata;
+}
+
+
+
+/**
+ * Create the Exif data block as a hex string
+ * jpeg uses Application Markers (APP's) as markers for application data
+ * APP1 is the application marker reserved for exif data
+ *
+ * (NSDictionary*) datadict - with subdictionaries marked '{TIFF}' and '{EXIF}' as returned by imagePickerController with a valid
+ * didFinishPickingMediaWithInfo data dict, under key @"UIImagePickerControllerMediaMetadata"
+ *
+ * the following constructs a hex string to Exif specifications, and is therefore brittle
+ * altering the order of arguments to the string constructors, modifying field sizes or formats,
+ * and any other minor change will likely prevent the exif data from being read
+ */
+- (NSString*) createExifAPP1 : (NSDictionary*) datadict {
+ NSMutableString * app1; // holds finalized product
+ NSString * exifIFD; // exif information file directory
+ NSString * subExifIFD; // subexif information file directory
+
+ // FFE1 is the hex APP1 marker code, and will allow client apps to read the data
+ NSString * app1marker = @"ffe1";
+ // SSSS size, to be determined
+ // EXIF ascii characters followed by 2bytes of zeros
+ NSString * exifmarker = @"457869660000";
+ // Tiff header: 4d4d is motorolla byte align (big endian), 002a is hex for 42
+ NSString * tiffheader = @"4d4d002a";
+ //first IFD offset from the Tiff header to IFD0. Since we are writing it, we know it's address 0x08
+ NSString * ifd0offset = @"00000008";
+ // current offset to next data area
+ int currentDataOffset = 0;
+
+ //data labeled as TIFF in UIImagePickerControllerMediaMetaData is part of the EXIF IFD0 portion of APP1
+ exifIFD = [self createExifIFDFromDict: [datadict objectForKey:@"{TIFF}"] withFormatDict: IFD0TagFormatDict isIFD0:YES currentDataOffset:&currentDataOffset];
+
+ //data labeled as EXIF in UIImagePickerControllerMediaMetaData is part of the EXIF Sub IFD portion of APP1
+ subExifIFD = [self createExifIFDFromDict: [datadict objectForKey:@"{Exif}"] withFormatDict: SubIFDTagFormatDict isIFD0:NO currentDataOffset:&currentDataOffset];
+ /*
+ NSLog(@"SUB EXIF IFD %@ WITH SIZE: %d",exifIFD,[exifIFD length]);
+
+ NSLog(@"SUB EXIF IFD %@ WITH SIZE: %d",subExifIFD,[subExifIFD length]);
+ */
+ // construct the complete app1 data block
+ app1 = [[NSMutableString alloc] initWithFormat: @"%@%04x%@%@%@%@%@",
+ app1marker,
+ (unsigned int)(16 + ([exifIFD length]/2) + ([subExifIFD length]/2)) /*16+[exifIFD length]/2*/,
+ exifmarker,
+ tiffheader,
+ ifd0offset,
+ exifIFD,
+ subExifIFD];
+
+ return app1;
+}
+
+// returns hex string representing a valid exif information file directory constructed from the datadict and formatdict
+- (NSString*) createExifIFDFromDict : (NSDictionary*) datadict
+ withFormatDict : (NSDictionary*) formatdict
+ isIFD0 : (BOOL) ifd0flag
+ currentDataOffset : (int*) dataoffset {
+ NSArray * datakeys = [datadict allKeys]; // all known data keys
+ NSArray * knownkeys = [formatdict allKeys]; // only keys in knowkeys are considered for entry in this IFD
+ NSMutableArray * ifdblock = [[NSMutableArray alloc] initWithCapacity: [datadict count]]; // all ifd entries
+ NSMutableArray * ifddatablock = [[NSMutableArray alloc] initWithCapacity: [datadict count]]; // data block entries
+ // ifd0flag = NO; // ifd0 requires a special flag and has offset to next ifd appended to end
+
+ // iterate through known provided data keys
+ for (int i = 0; i < [datakeys count]; i++) {
+ NSString * key = [datakeys objectAtIndex:i];
+ // don't muck about with unknown keys
+ if ([knownkeys indexOfObject: key] != NSNotFound) {
+ // create new IFD entry
+ NSString * entry = [self createIFDElement: key
+ withFormat: [formatdict objectForKey:key]
+ withElementData: [datadict objectForKey:key]];
+ // create the IFD entry's data block
+ NSString * data = [self createIFDElementDataWithFormat: [formatdict objectForKey:key]
+ withData: [datadict objectForKey:key]];
+ if (entry) {
+ [ifdblock addObject:entry];
+ if(!data) {
+ [ifdblock addObject:@""];
+ } else {
+ [ifddatablock addObject:data];
+ }
+ }
+ }
+ }
+
+ NSMutableString * exifstr = [[NSMutableString alloc] initWithCapacity: [ifdblock count] * 24];
+ NSMutableString * dbstr = [[NSMutableString alloc] initWithCapacity: 100];
+
+ int addr=*dataoffset; // current offset/address in datablock
+ if (ifd0flag) {
+ // calculate offset to datablock based on ifd file entry count
+ addr += 14+(12*([ifddatablock count]+1)); // +1 for tag 0x8769, exifsubifd offset
+ } else {
+ // current offset + numSubIFDs (2-bytes) + 12*numSubIFDs + endMarker (4-bytes)
+ addr += 2+(12*[ifddatablock count])+4;
+ }
+
+ for (int i = 0; i < [ifdblock count]; i++) {
+ NSString * entry = [ifdblock objectAtIndex:i];
+ NSString * data = [ifddatablock objectAtIndex:i];
+
+ // check if the data fits into 4 bytes
+ if( [data length] <= 8) {
+ // concatenate the entry and the (4byte) data entry into the final IFD entry and append to exif ifd string
+ [exifstr appendFormat : @"%@%@", entry, data];
+ } else {
+ [exifstr appendFormat : @"%@%08x", entry, addr];
+ [dbstr appendFormat: @"%@", data];
+ addr+= [data length] / 2;
+ /*
+ NSLog(@"=====data-length[%i]=======",[data length]);
+ NSLog(@"addr-offset[%i]",addr);
+ NSLog(@"entry[%@]",entry);
+ NSLog(@"data[%@]",data);
+ */
+ }
+ }
+
+ // calculate IFD0 terminal offset tags, currently ExifSubIFD
+ unsigned int entrycount = (unsigned int)[ifdblock count];
+ if (ifd0flag) {
+ // 18 accounts for 8769's width + offset to next ifd, 8 accounts for start of header
+ NSNumber * offset = [NSNumber numberWithUnsignedInteger:[exifstr length] / 2 + [dbstr length] / 2 + 18+8];
+
+ [self appendExifOffsetTagTo: exifstr
+ withOffset : offset];
+ entrycount++;
+ }
+ *dataoffset = addr;
+ return [[NSString alloc] initWithFormat: @"%04x%@%@%@",
+ entrycount,
+ exifstr,
+ @"00000000", // offset to next IFD, 0 since there is none
+ dbstr]; // lastly, the datablock
+}
+
+// Creates an exif formatted exif information file directory entry
+- (NSString*) createIFDElement: (NSString*) elementName withFormat: (NSArray*) formtemplate withElementData: (NSString*) data {
+ //NSArray * fielddata = [formatdict objectForKey: elementName];// format data of desired field
+ if (formtemplate) {
+ // format string @"%@%@%@%@", tag number, data format, components, value
+ NSNumber * dataformat = [formtemplate objectAtIndex:1];
+ NSNumber * components = [formtemplate objectAtIndex:2];
+ if([components intValue] == 0) {
+ components = [NSNumber numberWithUnsignedInteger:[data length] * DataTypeToWidth[[dataformat intValue]-1]];
+ }
+
+ return [[NSString alloc] initWithFormat: @"%@%@%08x",
+ [formtemplate objectAtIndex:0], // the field code
+ [self formatNumberWithLeadingZeroes: dataformat withPlaces: @4], // the data type code
+ [components intValue]]; // number of components
+ }
+ return NULL;
+}
+
+/**
+ * appends exif IFD0 tag 8769 "ExifOffset" to the string provided
+ * (NSMutableString*) str - string you wish to append the 8769 tag to: APP1 or IFD0 hex data string
+ * // TAGINF(@"8769", [NSNumber numberWithInt:EDT_ULONG], @1), @"ExifOffset",
+ */
+- (void) appendExifOffsetTagTo: (NSMutableString*) str withOffset : (NSNumber*) offset {
+ NSArray * format = TAGINF(@"8769", [NSNumber numberWithInt:EDT_ULONG], @1);
+
+ NSString * entry = [self createIFDElement: @"ExifOffset"
+ withFormat: format
+ withElementData: [offset stringValue]];
+
+ NSString * data = [self createIFDElementDataWithFormat: format
+ withData: [offset stringValue]];
+ [str appendFormat:@"%@%@", entry, data];
+}
+
+// formats the Information File Directory Data to exif format
+- (NSString*) createIFDElementDataWithFormat: (NSArray*) dataformat withData: (NSString*) data {
+ NSMutableString * datastr = nil;
+ NSNumber * tmp = nil;
+ NSNumber * formatcode = [dataformat objectAtIndex:1];
+ NSUInteger formatItemsCount = [dataformat count];
+ NSNumber * num = @0;
+ NSNumber * denom = @0;
+
+ switch ([formatcode intValue]) {
+ case EDT_UBYTE:
+ break;
+ case EDT_ASCII_STRING:
+ datastr = [[NSMutableString alloc] init];
+ for (int i = 0; i < [data length]; i++) {
+ [datastr appendFormat:@"%02x",[data characterAtIndex:i]];
+ }
+ if (formatItemsCount > 3) {
+ // We have additional data to append.
+ // currently used by Date format to append final 0x00 but can be used by other data types as well in the future
+ [datastr appendString:[dataformat objectAtIndex:3]];
+ }
+ if ([datastr length] < 8) {
+ NSString * format = [NSString stringWithFormat:@"%%0%dd", (int)(8 - [datastr length])];
+ [datastr appendFormat:format,0];
+ }
+ return datastr;
+ case EDT_USHORT:
+ return [[NSString alloc] initWithFormat : @"%@%@",
+ [self formattedHexStringFromDecimalNumber: [NSNumber numberWithInt: [data intValue]] withPlaces: @4],
+ @"0000"];
+ case EDT_ULONG:
+ tmp = [NSNumber numberWithUnsignedLong:[data intValue]];
+ return [NSString stringWithFormat : @"%@",
+ [self formattedHexStringFromDecimalNumber: tmp withPlaces: @8]];
+ case EDT_URATIONAL:
+ return [self decimalToUnsignedRational: [NSNumber numberWithDouble:[data doubleValue]]
+ withResultNumerator: &num
+ withResultDenominator: &denom];
+ case EDT_SBYTE:
+
+ break;
+ case EDT_UNDEFINED:
+ break; // 8 bits
+ case EDT_SSHORT:
+ break;
+ case EDT_SLONG:
+ break; // 32bit signed integer (2's complement)
+ case EDT_SRATIONAL:
+ break; // 2 SLONGS, first long is numerator, second is denominator
+ case EDT_SINGLEFLOAT:
+ break;
+ case EDT_DOUBLEFLOAT:
+ break;
+ }
+ return datastr;
+}
+
+//======================================================================================================================
+// Utility Methods
+//======================================================================================================================
+
+// creates a formatted little endian hex string from a number and width specifier
+- (NSString*) formattedHexStringFromDecimalNumber: (NSNumber*) numb withPlaces: (NSNumber*) width {
+ NSMutableString * str = [[NSMutableString alloc] initWithCapacity:[width intValue]];
+ NSString * formatstr = [[NSString alloc] initWithFormat: @"%%%@%dx", @"0", [width intValue]];
+ [str appendFormat:formatstr, [numb intValue]];
+ return str;
+}
+
+// format number as string with leading 0's
+- (NSString*) formatNumberWithLeadingZeroes: (NSNumber *) numb withPlaces: (NSNumber *) places {
+ NSNumberFormatter * formatter = [[NSNumberFormatter alloc] init];
+ NSString *formatstr = [@"" stringByPaddingToLength:[places unsignedIntegerValue] withString:@"0" startingAtIndex:0];
+ [formatter setPositiveFormat:formatstr];
+ return [formatter stringFromNumber:numb];
+}
+
+// approximate a decimal with a rational by method of continued fraction
+// can be collasped into decimalToUnsignedRational after testing
+- (void) decimalToRational: (NSNumber *) numb
+ withResultNumerator: (NSNumber**) numerator
+ withResultDenominator: (NSNumber**) denominator {
+ NSMutableArray * fractionlist = [[NSMutableArray alloc] initWithCapacity:8];
+
+ [self continuedFraction: [numb doubleValue]
+ withFractionList: fractionlist
+ withHorizon: 8];
+
+ // simplify complex fraction represented by partial fraction list
+ [self expandContinuedFraction: fractionlist
+ withResultNumerator: numerator
+ withResultDenominator: denominator];
+
+}
+
+// approximate a decimal with an unsigned rational by method of continued fraction
+- (NSString*) decimalToUnsignedRational: (NSNumber *) numb
+ withResultNumerator: (NSNumber**) numerator
+ withResultDenominator: (NSNumber**) denominator {
+ NSMutableArray * fractionlist = [[NSMutableArray alloc] initWithCapacity:8];
+
+ // generate partial fraction list
+ [self continuedFraction: [numb doubleValue]
+ withFractionList: fractionlist
+ withHorizon: 8];
+
+ // simplify complex fraction represented by partial fraction list
+ [self expandContinuedFraction: fractionlist
+ withResultNumerator: numerator
+ withResultDenominator: denominator];
+
+ return [self formatFractionList: fractionlist];
+}
+
+// recursive implementation of decimal approximation by continued fraction
+- (void) continuedFraction: (double) val
+ withFractionList: (NSMutableArray*) fractionlist
+ withHorizon: (int) horizon {
+ int whole;
+ double remainder;
+ // 1. split term
+ [self splitDouble: val withIntComponent: &whole withFloatRemainder: &remainder];
+ [fractionlist addObject: [NSNumber numberWithInt:whole]];
+
+ // 2. calculate reciprocal of remainder
+ if (!remainder) return; // early exit, exact fraction found, avoids recip/0
+ double recip = 1 / remainder;
+
+ // 3. exit condition
+ if ([fractionlist count] > horizon) {
+ return;
+ }
+
+ // 4. recurse
+ [self continuedFraction:recip withFractionList: fractionlist withHorizon: horizon];
+
+}
+
+// expand continued fraction list, creating a single level rational approximation
+-(void) expandContinuedFraction: (NSArray*) fractionlist
+ withResultNumerator: (NSNumber**) numerator
+ withResultDenominator: (NSNumber**) denominator {
+ NSUInteger i = 0;
+ int den = 0;
+ int num = 0;
+ if ([fractionlist count] == 1) {
+ *numerator = [NSNumber numberWithInt:[[fractionlist objectAtIndex:0] intValue]];
+ *denominator = @1;
+ return;
+ }
+
+ //begin at the end of the list
+ i = [fractionlist count] - 1;
+ num = 1;
+ den = [[fractionlist objectAtIndex:i] intValue];
+
+ while (i > 0) {
+ int t = [[fractionlist objectAtIndex: i-1] intValue];
+ num = t * den + num;
+ if (i==1) {
+ break;
+ } else {
+ t = num;
+ num = den;
+ den = t;
+ }
+ i--;
+ }
+ // set result parameters values
+ *numerator = [NSNumber numberWithInt: num];
+ *denominator = [NSNumber numberWithInt: den];
+}
+
+// formats expanded fraction list to string matching exif specification
+- (NSString*) formatFractionList: (NSArray *) fractionlist {
+ NSMutableString * str = [[NSMutableString alloc] initWithCapacity:16];
+
+ if ([fractionlist count] == 1){
+ [str appendFormat: @"%08x00000001", [[fractionlist objectAtIndex:0] intValue]];
+ }
+ return str;
+}
+
+// format rational as
+- (NSString*) formatRationalWithNumerator: (NSNumber*) numerator withDenominator: (NSNumber*) denominator asSigned: (Boolean) signedFlag {
+ NSMutableString * str = [[NSMutableString alloc] initWithCapacity:16];
+ if (signedFlag) {
+ long num = [numerator longValue];
+ long den = [denominator longValue];
+ [str appendFormat: @"%08lx%08lx", num >= 0 ? num : ~ABS(num) + 1, num >= 0 ? den : ~ABS(den) + 1];
+ } else {
+ [str appendFormat: @"%08lx%08lx", [numerator unsignedLongValue], [denominator unsignedLongValue]];
+ }
+ return str;
+}
+
+// split a floating point number into two integer values representing the left and right side of the decimal
+- (void) splitDouble: (double) val withIntComponent: (int*) rightside withFloatRemainder: (double*) leftside {
+ *rightside = val; // convert numb to int representation, which truncates the decimal portion
+ *leftside = val - *rightside;
+}
+
+
+//
+- (NSString*) hexStringFromData : (NSData*) data {
+ //overflow detection
+ const unsigned char *dataBuffer = [data bytes];
+ return [[NSString alloc] initWithFormat: @"%02x%02x",
+ (unsigned char)dataBuffer[0],
+ (unsigned char)dataBuffer[1]];
+}
+
+// convert a hex string to a number
+- (NSNumber*) numericFromHexString : (NSString *) hexstring {
+ NSScanner * scan = NULL;
+ unsigned int numbuf= 0;
+
+ scan = [NSScanner scannerWithString:hexstring];
+ [scan scanHexInt:&numbuf];
+ return [NSNumber numberWithInt:numbuf];
+}
+
+@end
diff --git a/cordova/platforms/ios/TagSpaces/main.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.h
old mode 100644
new mode 100755
similarity index 71%
rename from cordova/platforms/ios/TagSpaces/main.m
rename to cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.h
index 6fea699de..31bc42ff0
--- a/cordova/platforms/ios/TagSpaces/main.m
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.h
@@ -6,9 +6,9 @@
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -16,20 +16,14 @@
specific language governing permissions and limitations
under the License.
*/
-//
-// main.m
-// TagSpaces
-//
-// Created by ___FULLUSERNAME___ on ___DATE___.
-// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
#import <UIKit/UIKit.h>
-int main(int argc, char* argv[])
-{
- @autoreleasepool {
- int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
- return retVal;
- }
-}
+@interface UIImage (CropScaleOrientation)
+
+- (UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize;
+- (UIImage*)imageCorrectedForCaptureOrientation;
+- (UIImage*)imageCorrectedForCaptureOrientation:(UIImageOrientation)imageOrientation;
+- (UIImage*)imageByScalingNotCroppingForSize:(CGSize)targetSize;
+
+@end
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.m
new file mode 100755
index 000000000..a66a5d88d
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-camera/UIImage+CropScaleOrientation.m
@@ -0,0 +1,175 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "UIImage+CropScaleOrientation.h"
+
+@implementation UIImage (CropScaleOrientation)
+
+- (UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize
+{
+ UIImage* sourceImage = self;
+ UIImage* newImage = nil;
+ CGSize imageSize = sourceImage.size;
+ CGFloat width = imageSize.width;
+ CGFloat height = imageSize.height;
+ CGFloat targetWidth = targetSize.width;
+ CGFloat targetHeight = targetSize.height;
+ CGFloat scaleFactor = 0.0;
+ CGFloat scaledWidth = targetWidth;
+ CGFloat scaledHeight = targetHeight;
+ CGPoint thumbnailPoint = CGPointMake(0.0, 0.0);
+
+ if (CGSizeEqualToSize(imageSize, targetSize) == NO) {
+ CGFloat widthFactor = targetWidth / width;
+ CGFloat heightFactor = targetHeight / height;
+
+ if (widthFactor > heightFactor) {
+ scaleFactor = widthFactor; // scale to fit height
+ } else {
+ scaleFactor = heightFactor; // scale to fit width
+ }
+ scaledWidth = width * scaleFactor;
+ scaledHeight = height * scaleFactor;
+
+ // center the image
+ if (widthFactor > heightFactor) {
+ thumbnailPoint.y = (targetHeight - scaledHeight) * 0.5;
+ } else if (widthFactor < heightFactor) {
+ thumbnailPoint.x = (targetWidth - scaledWidth) * 0.5;
+ }
+ }
+
+ UIGraphicsBeginImageContext(targetSize); // this will crop
+
+ CGRect thumbnailRect = CGRectZero;
+ thumbnailRect.origin = thumbnailPoint;
+ thumbnailRect.size.width = scaledWidth;
+ thumbnailRect.size.height = scaledHeight;
+
+ [sourceImage drawInRect:thumbnailRect];
+
+ newImage = UIGraphicsGetImageFromCurrentImageContext();
+ if (newImage == nil) {
+ NSLog(@"could not scale image");
+ }
+
+ // pop the context to get back to the default
+ UIGraphicsEndImageContext();
+ return newImage;
+}
+
+- (UIImage*)imageCorrectedForCaptureOrientation:(UIImageOrientation)imageOrientation
+{
+ float rotation_radians = 0;
+ bool perpendicular = false;
+
+ switch (imageOrientation) {
+ case UIImageOrientationUp :
+ rotation_radians = 0.0;
+ break;
+
+ case UIImageOrientationDown:
+ rotation_radians = M_PI; // don't be scared of radians, if you're reading this, you're good at math
+ break;
+
+ case UIImageOrientationRight:
+ rotation_radians = M_PI_2;
+ perpendicular = true;
+ break;
+
+ case UIImageOrientationLeft:
+ rotation_radians = -M_PI_2;
+ perpendicular = true;
+ break;
+
+ default:
+ break;
+ }
+
+ UIGraphicsBeginImageContext(CGSizeMake(self.size.width, self.size.height));
+ CGContextRef context = UIGraphicsGetCurrentContext();
+
+ // Rotate around the center point
+ CGContextTranslateCTM(context, self.size.width / 2, self.size.height / 2);
+ CGContextRotateCTM(context, rotation_radians);
+
+ CGContextScaleCTM(context, 1.0, -1.0);
+ float width = perpendicular ? self.size.height : self.size.width;
+ float height = perpendicular ? self.size.width : self.size.height;
+ CGContextDrawImage(context, CGRectMake(-width / 2, -height / 2, width, height), [self CGImage]);
+
+ // Move the origin back since the rotation might've change it (if its 90 degrees)
+ if (perpendicular) {
+ CGContextTranslateCTM(context, -self.size.height / 2, -self.size.width / 2);
+ }
+
+ UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
+ UIGraphicsEndImageContext();
+ return newImage;
+}
+
+- (UIImage*)imageCorrectedForCaptureOrientation
+{
+ return [self imageCorrectedForCaptureOrientation:[self imageOrientation]];
+}
+
+- (UIImage*)imageByScalingNotCroppingForSize:(CGSize)targetSize
+{
+ UIImage* sourceImage = self;
+ UIImage* newImage = nil;
+ CGSize imageSize = sourceImage.size;
+ CGFloat width = imageSize.width;
+ CGFloat height = imageSize.height;
+ CGFloat targetWidth = targetSize.width;
+ CGFloat targetHeight = targetSize.height;
+ CGFloat scaleFactor = 0.0;
+ CGSize scaledSize = targetSize;
+
+ if (CGSizeEqualToSize(imageSize, targetSize) == NO) {
+ CGFloat widthFactor = targetWidth / width;
+ CGFloat heightFactor = targetHeight / height;
+
+ // opposite comparison to imageByScalingAndCroppingForSize in order to contain the image within the given bounds
+ if (widthFactor > heightFactor) {
+ scaleFactor = heightFactor; // scale to fit height
+ } else {
+ scaleFactor = widthFactor; // scale to fit width
+ }
+ scaledSize = CGSizeMake(MIN(width * scaleFactor, targetWidth), MIN(height * scaleFactor, targetHeight));
+ }
+
+ // If the pixels are floats, it causes a white line in iOS8 and probably other versions too
+ scaledSize.width = (int)scaledSize.width;
+ scaledSize.height = (int)scaledSize.height;
+
+ UIGraphicsBeginImageContext(scaledSize); // this will resize
+
+ [sourceImage drawInRect:CGRectMake(0, 0, scaledSize.width, scaledSize.height)];
+
+ newImage = UIGraphicsGetImageFromCurrentImageContext();
+ if (newImage == nil) {
+ NSLog(@"could not scale image");
+ }
+
+ // pop the context to get back to the default
+ UIGraphicsEndImageContext();
+ return newImage;
+}
+
+@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.h
old mode 100644
new mode 100755
similarity index 75%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.h
rename to cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.h
index de5b518f8..a146d8829
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.h
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.h
@@ -17,12 +17,14 @@
under the License.
*/
-#import <Foundation/Foundation.h>
-#import "CDVViewController.h"
+#import <UIKit/UIKit.h>
+#import <Cordova/CDVPlugin.h>
-@interface CDVAppDelegate : NSObject <UIApplicationDelegate>{}
+@interface CDVDevice : CDVPlugin
+{}
-@property (nonatomic, strong) IBOutlet UIWindow* window;
-@property (nonatomic, strong) IBOutlet CDVViewController* viewController;
++ (NSString*)cordovaVersion;
+
+- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command;
@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.m
new file mode 100755
index 000000000..4d75a5748
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-device/CDVDevice.m
@@ -0,0 +1,112 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include "TargetConditionals.h"
+
+#import <Cordova/CDV.h>
+#import "CDVDevice.h"
+
+@implementation UIDevice (ModelVersion)
+
+- (NSString*)modelVersion
+{
+ size_t size;
+
+ sysctlbyname("hw.machine", NULL, &size, NULL, 0);
+ char* machine = malloc(size);
+ sysctlbyname("hw.machine", machine, &size, NULL, 0);
+ NSString* platform = [NSString stringWithUTF8String:machine];
+ free(machine);
+
+ return platform;
+}
+
+@end
+
+@interface CDVDevice () {}
+@end
+
+@implementation CDVDevice
+
+- (NSString*)uniqueAppInstanceIdentifier:(UIDevice*)device
+{
+ NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
+ static NSString* UUID_KEY = @"CDVUUID";
+
+ // Check user defaults first to maintain backwards compaitibility with previous versions
+ // which didn't user identifierForVendor
+ NSString* app_uuid = [userDefaults stringForKey:UUID_KEY];
+ if (app_uuid == nil) {
+ if ([device respondsToSelector:@selector(identifierForVendor)]) {
+ app_uuid = [[device identifierForVendor] UUIDString];
+ } else {
+ CFUUIDRef uuid = CFUUIDCreate(NULL);
+ app_uuid = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid);
+ CFRelease(uuid);
+ }
+
+ [userDefaults setObject:app_uuid forKey:UUID_KEY];
+ [userDefaults synchronize];
+ }
+
+ return app_uuid;
+}
+
+- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command
+{
+ NSDictionary* deviceProperties = [self deviceProperties];
+ CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties];
+
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+}
+
+- (NSDictionary*)deviceProperties
+{
+ UIDevice* device = [UIDevice currentDevice];
+
+ return @{
+ @"manufacturer": @"Apple",
+ @"model": [device modelVersion],
+ @"platform": @"iOS",
+ @"version": [device systemVersion],
+ @"uuid": [self uniqueAppInstanceIdentifier:device],
+ @"cordova": [[self class] cordovaVersion],
+ @"isVirtual": @([self isVirtual])
+ };
+}
+
++ (NSString*)cordovaVersion
+{
+ return CDV_VERSION;
+}
+
+- (BOOL)isVirtual
+{
+ #if TARGET_OS_SIMULATOR
+ return true;
+ #elif TARGET_IPHONE_SIMULATOR
+ return true;
+ #else
+ return false;
+ #endif
+}
+
+@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.h
new file mode 100644
index 000000000..f3014d07c
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.h
@@ -0,0 +1,35 @@
+/*
+The MIT License (MIT)
+
+Copyright (c) 2013 pwlin - [email protected]
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#import <Cordova/CDV.h>
+
+@interface FileOpener2 : CDVPlugin <UIDocumentInteractionControllerDelegate> {
+ NSString *localFile;
+}
+
+@property(nonatomic, strong) UIDocumentInteractionController *controller;
+@property(nonatomic, strong) CDVViewController *cdvViewController;
+
+- (void) open: (CDVInvokedUrlCommand*)command;
+
+@end
\ No newline at end of file
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.m
new file mode 100644
index 000000000..716170543
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-file-opener2/FileOpener2.m
@@ -0,0 +1,137 @@
+/*
+The MIT License (MIT)
+
+Copyright (c) 2013 pwlin - [email protected]
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+#import "FileOpener2.h"
+#import <Cordova/CDV.h>
+
+#import <QuartzCore/QuartzCore.h>
+#import <MobileCoreServices/MobileCoreServices.h>
+
+@implementation FileOpener2
+@synthesize controller = docController;
+
+- (void) open: (CDVInvokedUrlCommand*)command {
+
+ NSString *path = [command.arguments objectAtIndex:0];
+ NSString *contentType = [command.arguments objectAtIndex:1];
+ BOOL showPreview = YES;
+
+ if ([command.arguments count] >= 3) {
+ showPreview = [[command.arguments objectAtIndex:2] boolValue];
+ }
+
+ CDVViewController* cont = (CDVViewController*)[super viewController];
+ self.cdvViewController = cont;
+ NSString *uti = nil;
+
+ if([contentType length] == 0){
+ NSArray *dotParts = [path componentsSeparatedByString:@"."];
+ NSString *fileExt = [dotParts lastObject];
+
+ uti = (__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)fileExt, NULL);
+ } else {
+ uti = (__bridge NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (__bridge CFStringRef)contentType, NULL);
+ }
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ NSURL *fileURL = NULL;
+ NSString *decodedPath = [path stringByRemovingPercentEncoding];
+ if ([path isEqualToString:decodedPath]) {
+ NSLog(@"Path parameter not encoded. Building file URL encoding it...");
+ fileURL = [NSURL fileURLWithPath:[path stringByReplacingOccurrencesOfString:@"file://" withString:@""]];;
+ } else {
+ NSLog(@"Path parameter already encoded. Building file URL without encoding it...");
+ fileURL = [NSURL URLWithString:path];
+ }
+
+ localFile = fileURL.path;
+
+ NSLog(@"looking for file at %@", fileURL);
+ NSFileManager *fm = [NSFileManager defaultManager];
+ if(![fm fileExistsAtPath:localFile]) {
+ NSDictionary *jsonObj = @{@"status" : @"9",
+ @"message" : @"File does not exist"};
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:jsonObj];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ return;
+ }
+
+ docController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
+ docController.delegate = self;
+ docController.UTI = uti;
+
+ CDVPluginResult* pluginResult = nil;
+
+ //Opens the file preview
+ CGRect rect;
+ if ([command.arguments count] >= 4) {
+ NSArray *positionValues = [command.arguments objectAtIndex:3];
+
+ if (![positionValues isEqual:[NSNull null]] && [positionValues count] >= 2) {
+ rect = CGRectMake(0, 0, [[positionValues objectAtIndex:0] floatValue], [[positionValues objectAtIndex:1] floatValue]);
+ } else {
+ rect = CGRectMake(0, 0, 0, 0);
+ }
+ } else {
+ rect = CGRectMake(0, 0, cont.view.bounds.size.width, cont.view.bounds.size.height);
+ }
+
+ BOOL wasOpened = NO;
+
+ if (showPreview) {
+ wasOpened = [docController presentPreviewAnimated: NO];
+ } else {
+ CDVViewController* cont = self.cdvViewController;
+ wasOpened = [docController presentOpenInMenuFromRect:rect inView:cont.view animated:YES];
+ }
+
+ if(wasOpened) {
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString: @""];
+ //NSLog(@"Success");
+ } else {
+ NSDictionary *jsonObj = [ [NSDictionary alloc]
+ initWithObjectsAndKeys :
+ @"9", @"status",
+ @"Could not handle UTI", @"message",
+ nil
+ ];
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:jsonObj];
+ }
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ });
+}
+
+@end
+
+@implementation FileOpener2 (UIDocumentInteractionControllerDelegate)
+ - (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller {
+ UIViewController *presentingViewController = self.viewController;
+ if (presentingViewController.view.window != [UIApplication sharedApplication].keyWindow){
+ presentingViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
+ }
+
+ while (presentingViewController.presentedViewController != nil && ![presentingViewController.presentedViewController isBeingDismissed]){
+ presentingViewController = presentingViewController.presentedViewController;
+ }
+ return presentingViewController;
+ }
+@end
diff --git a/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.h
old mode 100644
new mode 100755
similarity index 100%
rename from cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.h
rename to cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.h
diff --git a/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.m
old mode 100644
new mode 100755
similarity index 100%
rename from cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.m
rename to cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVAssetLibraryFilesystem.m
diff --git a/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVFile.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVFile.h
old mode 100644
new mode 100755
similarity index 100%
rename from cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVFile.h
rename to cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVFile.h
diff --git a/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVFile.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVFile.m
old mode 100644
new mode 100755
similarity index 99%
rename from cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVFile.m
rename to cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVFile.m
index 75640c9c1..59e7d6407
--- a/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVFile.m
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVFile.m
@@ -27,7 +27,7 @@ static NSString* toBase64(NSData* data) {
SEL s1 = NSSelectorFromString(@"cdv_base64EncodedString");
SEL s2 = NSSelectorFromString(@"base64EncodedString");
SEL s3 = NSSelectorFromString(@"base64EncodedStringWithOptions:");
-
+
if ([data respondsToSelector:s1]) {
NSString* (*func)(id, SEL) = (void *)[data methodForSelector:s1];
return func(data, s1);
@@ -160,7 +160,7 @@ NSString* const kCDVFilesystemURLPrefix = @"cdvfile";
CDVFilesystemURL* url = [CDVFilesystemURL fileSystemURLWithURL:[[self request] URL]];
NSObject<CDVFileSystem> *fs = [filePlugin filesystemForURL:url];
__weak CDVFilesystemURLProtocol* weakSelf = self;
-
+
[fs readFileAtURL:url start:0 end:-1 callback:^void(NSData *data, NSString *mimetype, CDVFileError error) {
NSMutableDictionary* responseHeaders = [[NSMutableDictionary alloc] init];
responseHeaders[@"Cache-Control"] = @"no-cache";
@@ -1074,7 +1074,7 @@ NSString* const kCDVFilesystemURLPrefix = @"cdvfile";
- (void)getFreeDiskSpace:(CDVInvokedUrlCommand*)command
{
// no arguments
-
+
NSNumber* pNumAvail = [self checkFreeDiskSpace:self.rootDocsPath];
NSString* strFreeSpace = [NSString stringWithFormat:@"%qu", [pNumAvail unsignedLongLongValue]];
diff --git a/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVLocalFilesystem.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVLocalFilesystem.h
old mode 100644
new mode 100755
similarity index 100%
rename from cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVLocalFilesystem.h
rename to cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVLocalFilesystem.h
diff --git a/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVLocalFilesystem.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVLocalFilesystem.m
old mode 100644
new mode 100755
similarity index 99%
rename from cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVLocalFilesystem.m
rename to cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVLocalFilesystem.m
index ddc77404d..c340ce0cc
--- a/cordova/platforms/ios/TagSpaces/Plugins/cordova-plugin-file/CDVLocalFilesystem.m
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-file/CDVLocalFilesystem.m
@@ -736,11 +736,11 @@
if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
return nil;
}
-
+
CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[path pathExtension], NULL);
CFStringRef mimeType = UTTypeCopyPreferredTagWithClass (UTI, kUTTagClassMIMEType);
CFRelease(UTI);
-
+
if (!mimeType) {
return @"application/octet-stream";
}
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h
new file mode 100644
index 000000000..696bac338
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.h
@@ -0,0 +1,5 @@
+#import <Foundation/Foundation.h>
+
+@interface NSString (SSURLEncoding)
+@property (readonly) NSString *SSURLEncodedString;
+@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m
new file mode 100644
index 000000000..d72effa08
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/NSString+SSURLEncoding.m
@@ -0,0 +1,30 @@
+#import "NSString+SSURLEncoding.h"
+
+@implementation NSString (SSURLEncoding)
+- (NSString*)SSURLEncodedString
+{
+ NSString* result = (NSString *)CFBridgingRelease(
+ CFURLCreateStringByAddingPercentEscapes(
+ kCFAllocatorDefault,
+ (CFStringRef)self,
+ CFSTR("#%"), // don't escape these
+ NULL, // allow escaping these
+ kCFStringEncodingUTF8
+ )
+ );
+
+ // we may have a URL with more than one '#' now - which iOS doesn't allow, so escape all but the first one
+ NSArray *parts = [result componentsSeparatedByString:@"#"];
+ NSString *finalResult = parts[0];
+ for (int i=1; i<parts.count; i++) {
+ NSString *part = [parts objectAtIndex:i];
+ if (i==1) {
+ finalResult = [finalResult stringByAppendingString:@"#"];
+ } else {
+ finalResult = [finalResult stringByAppendingString:@"%23"];
+ }
+ finalResult = [finalResult stringByAppendingString:part];
+ }
+ return finalResult;
+}
+@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h
new file mode 100644
index 000000000..0c7314505
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h
@@ -0,0 +1,28 @@
+#import <Cordova/CDV.h>
+#import <MessageUI/MFMailComposeViewController.h>
+
+@interface SocialSharing : CDVPlugin <UIPopoverControllerDelegate, MFMailComposeViewControllerDelegate, UIDocumentInteractionControllerDelegate>
+
+@property (nonatomic, strong) MFMailComposeViewController *globalMailComposer;
+@property (nonatomic, strong) UIDocumentInteractionController * documentInteractionController;
+@property (retain) NSString * tempStoredFile;
+@property (retain) CDVInvokedUrlCommand * command;
+
+- (void)available:(CDVInvokedUrlCommand*)command;
+- (void)setIPadPopupCoordinates:(CDVInvokedUrlCommand*)command;
+- (void)share:(CDVInvokedUrlCommand*)command;
+- (void)shareWithOptions:(CDVInvokedUrlCommand*)command;
+- (void)canShareVia:(CDVInvokedUrlCommand*)command;
+- (void)canShareViaEmail:(CDVInvokedUrlCommand*)command;
+- (void)shareVia:(CDVInvokedUrlCommand*)command;
+- (void)shareViaTwitter:(CDVInvokedUrlCommand*)command;
+- (void)shareViaFacebook:(CDVInvokedUrlCommand*)command;
+- (void)shareViaFacebookWithPasteMessageHint:(CDVInvokedUrlCommand*)command;
+- (void)shareViaWhatsApp:(CDVInvokedUrlCommand*)command;
+- (void)shareViaSMS:(CDVInvokedUrlCommand*)command;
+- (void)shareViaEmail:(CDVInvokedUrlCommand*)command;
+- (void)shareViaInstagram:(CDVInvokedUrlCommand*)command;
+
+- (void)saveToPhotoAlbum:(CDVInvokedUrlCommand*)command;
+
+@end
diff --git a/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m
new file mode 100644
index 000000000..75c8b41bb
--- /dev/null
+++ b/cordova/platforms/ios/App/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m
@@ -0,0 +1,868 @@
+#import "SocialSharing.h"
+#import "NSString+SSURLEncoding.h"
+#import <Cordova/CDV.h>
+#import <Social/Social.h>
+#import <Foundation/NSException.h>
+#import <MessageUI/MFMessageComposeViewController.h>
+#import <MessageUI/MFMailComposeViewController.h>
+#import <MobileCoreServices/MobileCoreServices.h>
+
+static NSString *const kShareOptionMessage = @"message";
+static NSString *const kShareOptionSubject = @"subject";
+static NSString *const kShareOptionFiles = @"files";
+static NSString *const kShareOptionUrl = @"url";
+static NSString *const kShareOptionIPadCoordinates = @"iPadCoordinates";
+
+@implementation SocialSharing {
+ UIPopoverController *_popover;
+ NSString *_popupCoordinates;
+}
+
+- (void)pluginInitialize {
+}
+
+- (void)available:(CDVInvokedUrlCommand*)command {
+ BOOL avail = NO;
+ if (NSClassFromString(@"UIActivityViewController")) {
+ avail = YES;
+ }
+ CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:avail];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+}
+
+- (NSString*)getIPadPopupCoordinates {
+ // see https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/1052
+ return nil;
+ /*
+ if (_popupCoordinates != nil) {
+ return _popupCoordinates;
+ }
+ if ([self.webView respondsToSelector:@selector(stringByEvaluatingJavaScriptFromString:)]) {
+ return [(UIWebView*)self.webView stringByEvaluatingJavaScriptFromString:@"window.plugins.socialsharing.iPadPopupCoordinates();"];
+ } else {
+ // prolly a wkwebview, ignoring for now
+ return nil;
+ }
+ */
+}
+
+- (void)setIPadPopupCoordinates:(CDVInvokedUrlCommand*)command {
+ _popupCoordinates = [command.arguments objectAtIndex:0];
+}
+
+- (CGRect)getPopupRectFromIPadPopupCoordinates:(NSArray*)comps {
+ CGRect rect = CGRectZero;
+ if ([comps count] == 4) {
+ rect = CGRectMake([[comps objectAtIndex:0] integerValue], [[comps objectAtIndex:1] integerValue], [[comps objectAtIndex:2] integerValue], [[comps objectAtIndex:3] integerValue]);
+ }
+ return rect;
+}
+
+- (void)share:(CDVInvokedUrlCommand*)command {
+ [self shareInternal:command
+ withOptions:@{
+ kShareOptionMessage: [command.arguments objectAtIndex:0],
+ kShareOptionSubject: [command.arguments objectAtIndex:1],
+ kShareOptionFiles: [command.arguments objectAtIndex:2],
+ kShareOptionUrl: [command.arguments objectAtIndex:3],
+ kShareOptionIPadCoordinates: [command.arguments objectAtIndex:4]
+ }
+ isBooleanResponse:YES
+];
+}
+
+- (void)shareWithOptions:(CDVInvokedUrlCommand*)command {
+ NSDictionary* options = [command.arguments objectAtIndex:0];
+ [self shareInternal:command
+ withOptions:options
+ isBooleanResponse:NO
+ ];
+}
+
+- (void)shareInternal:(CDVInvokedUrlCommand*)command withOptions:(NSDictionary*)options isBooleanResponse:(BOOL)boolResponse {
+ [self.commandDelegate runInBackground:^{ //avoid main thread block especially if sharing big files from url
+ if (!NSClassFromString(@"UIActivityViewController")) {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ return;
+ }
+
+ NSString *message = options[kShareOptionMessage];
+ NSString *subject = options[kShareOptionSubject];
+ NSArray *filenames = options[kShareOptionFiles];
+ NSString *urlString = options[kShareOptionUrl];
+ NSString *iPadCoordString = options[kShareOptionIPadCoordinates];
+ NSArray *iPadCoordinates;
+
+ if (iPadCoordString != nil && iPadCoordString != [NSNull null]) {
+ iPadCoordinates = [iPadCoordString componentsSeparatedByString:@","];
+ } else {
+ iPadCoordinates = @[];
+ }
+
+
+ NSMutableArray *activityItems = [[NSMutableArray alloc] init];
+
+ if (message != (id)[NSNull null] && message != nil) {
+ [activityItems addObject:message];
+ }
+
+ if (filenames != (id)[NSNull null] && filenames != nil && filenames.count > 0) {
+ NSMutableArray *files = [[NSMutableArray alloc] init];
+ for (NSString* filename in filenames) {
+ NSObject *file = [self getImage:filename];
+ if (file == nil) {
+ file = [self getFile:filename];
+ }
+ if (file != nil) {
+ [files addObject:file];
+ }
+ }
+ [activityItems addObjectsFromArray:files];
+ }
+
+ if (urlString != (id)[NSNull null] && urlString != nil) {
+ [activityItems addObject:[NSURL URLWithString:[urlString SSURLEncodedString]]];
+ }
+
+ UIActivity *activity = [[UIActivity alloc] init];
+ NSArray *applicationActivities = [[NSArray alloc] initWithObjects:activity, nil];
+ UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities];
+ if (subject != (id)[NSNull null] && subject != nil) {
+ [activityVC setValue:subject forKey:@"subject"];
+ }
+
+ if ([activityVC respondsToSelector:(@selector(setCompletionWithItemsHandler:))]) {
+ [activityVC setCompletionWithItemsHandler:^(NSString *activityType, BOOL completed, NSArray * returnedItems, NSError * activityError) {
+ [self cleanupStoredFiles];
+ if (boolResponse) {
+ [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:completed]
+ callbackId:command.callbackId];
+ } else {
+ NSDictionary * result = @{@"completed":@(completed), @"app":activityType == nil ? @"" : activityType};
+ [self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:result]
+ callbackId:command.callbackId];
+ }
+ }];
+ } else {
+ // let's suppress this warning otherwise folks will start opening issues while it's not relevant
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ [activityVC setCompletionHandler:^(NSString *activityType, BOOL completed) {
+ [self cleanupStoredFiles];
+ NSDictionary * result = @{@"completed":@(completed), @"app":activityType == nil ? @"" : activityType};
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:result];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }];
+#pragma GCC diagnostic warning "-Wdeprecated-declarations"
+ }
+
+ NSArray * socialSharingExcludeActivities = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"SocialSharingExcludeActivities"];
+ if (socialSharingExcludeActivities!=nil && [socialSharingExcludeActivities count] > 0) {
+ activityVC.excludedActivityTypes = socialSharingExcludeActivities;
+ }
+
+ dispatch_async(dispatch_get_main_queue(), ^(void){
+ // iPad on iOS >= 8 needs a different approach
+ if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
+ NSString* iPadCoords = [self getIPadPopupCoordinates];
+ if (iPadCoords != nil && ![iPadCoords isEqual:@"-1,-1,-1,-1"]) {
+ CGRect rect;
+ if ([iPadCoordinates count] == 4) {
+
+ rect = CGRectMake((int) [[iPadCoordinates objectAtIndex:0] integerValue], (int) [[iPadCoordinates objectAtIndex:1] integerValue], (int) [[iPadCoordinates objectAtIndex:2] integerValue], (int) [[iPadCoordinates objectAtIndex:3] integerValue]);
+ } else {
+ NSArray *comps = [iPadCoords componentsSeparatedByString:@","];
+ rect = [self getPopupRectFromIPadPopupCoordinates:comps];
+ }
+ if ([activityVC respondsToSelector:@selector(popoverPresentationController)]) {
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 // iOS 8.0 supported
+ activityVC.popoverPresentationController.sourceView = self.webView;
+ activityVC.popoverPresentationController.sourceRect = rect;
+#endif
+ } else {
+ _popover = [[UIPopoverController alloc] initWithContentViewController:activityVC];
+ _popover.delegate = self;
+ [_popover presentPopoverFromRect:rect inView:self.webView permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
+ }
+ } else if ([activityVC respondsToSelector:@selector(popoverPresentationController)]) {
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 // iOS 8.0 supported
+ activityVC.popoverPresentationController.sourceView = self.webView;
+ // position the popup at the bottom, just like iOS < 8 did (and iPhone still does on iOS 8)
+ CGRect rect;
+ if ([iPadCoordinates count] == 4) {
+ NSLog([[NSString alloc] initWithFormat:@"test %d", [[iPadCoordinates objectAtIndex:0] integerValue]]);
+ rect = CGRectMake((int) [[iPadCoordinates objectAtIndex:0] integerValue], (int) [[iPadCoordinates objectAtIndex:1] integerValue], (int) [[iPadCoordinates objectAtIndex:2] integerValue], (int) [[iPadCoordinates objectAtIndex:3] integerValue]);
+ } else {
+ NSArray *comps = [NSArray arrayWithObjects:
+ [NSNumber numberWithInt:(self.viewController.view.frame.size.width/2)-200],
+ [NSNumber numberWithInt:self.viewController.view.frame.size.height],
+ [NSNumber numberWithInt:400],
+ [NSNumber numberWithInt:400],
+ nil];
+ rect = [self getPopupRectFromIPadPopupCoordinates:comps];
+ }
+ activityVC.popoverPresentationController.sourceRect = rect;
+#endif
+ }
+ }
+ [[self getTopMostViewController] presentViewController:activityVC animated:YES completion:nil];
+ });
+ }];
+}
+
+- (void)shareViaTwitter:(CDVInvokedUrlCommand*)command {
+ [self shareViaInternal:command type:SLServiceTypeTwitter];
+}
+
+- (void)shareViaFacebook:(CDVInvokedUrlCommand*)command {
+ [self shareViaInternal:command type:SLServiceTypeFacebook];
+}
+
+- (void)shareViaFacebookWithPasteMessageHint:(CDVInvokedUrlCommand*)command {
+ // If Fb app is installed a message is not prefilled.
+ // When shared through the default iOS widget (iOS Settings > Facebook) the message is prefilled already.
+ NSString *message = [command.arguments objectAtIndex:0];
+ if (message != (id)[NSNull null]) {
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1000 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
+ BOOL fbAppInstalled = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]]; // requires whitelisting on iOS9
+ if (fbAppInstalled) {
+ UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
+ [pasteboard setValue:message forPasteboardType:@"public.utf8-plain-text"];
+ NSString *hint = [command.arguments objectAtIndex:4];
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:hint delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
+ [alert show];
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2800 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
+ [alert dismissWithClickedButtonIndex:-1 animated:YES];
+ });
+ }
+ });
+ }
+ [self shareViaInternal:command type:SLServiceTypeFacebook];
+}
+
+- (void)shareVia:(CDVInvokedUrlCommand*)command {
+ [self shareViaInternal:command type:[command.arguments objectAtIndex:4]];
+}
+
+- (void)canShareVia:(CDVInvokedUrlCommand*)command {
+ NSString *via = [command.arguments objectAtIndex:4];
+ CDVPluginResult * pluginResult;
+ if ([@"sms" caseInsensitiveCompare:via] == NSOrderedSame && [self canShareViaSMS]) {
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ } else if ([@"email" caseInsensitiveCompare:via] == NSOrderedSame && [self isEmailAvailable]) {
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ } else if ([@"whatsapp" caseInsensitiveCompare:via] == NSOrderedSame && [self canShareViaWhatsApp]) {
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ } else if ([@"instagram" caseInsensitiveCompare:via] == NSOrderedSame && [self canShareViaInstagram]) {
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ } else if ([@"com.apple.social.facebook" caseInsensitiveCompare:via] == NSOrderedSame && [self canShareViaFacebook]) {
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ } else if ([@"com.apple.social.twitter" caseInsensitiveCompare:via] == NSOrderedSame && [self canShareViaTwitter]) {
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ } else if ([self isAvailableForSharing:command type:via]) {
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ } else {
+ pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
+ }
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+}
+
+- (void)canShareViaEmail:(CDVInvokedUrlCommand*)command {
+ if ([self isEmailAvailable]) {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ } else {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }
+}
+
+- (bool)isEmailAvailable {
+ Class messageClass = (NSClassFromString(@"MFMailComposeViewController"));
+ return messageClass != nil && [messageClass canSendMail];
+}
+
+- (bool)isAvailableForSharing:(CDVInvokedUrlCommand*)command
+ type:(NSString *) type {
+
+ // isAvailableForServiceType returns true if you pass it a type that is not
+ // in the defined constants, this is probably a bug on apples part
+ if(!([type isEqualToString:SLServiceTypeFacebook]
+ || [type isEqualToString:SLServiceTypeTwitter]
+ || [type isEqualToString:SLServiceTypeTencentWeibo]
+ || [type isEqualToString:SLServiceTypeSinaWeibo])) {
+ return false;
+ }
+ // wrapped in try-catch, because isAvailableForServiceType may crash if an invalid type is passed
+ @try {
+ return [SLComposeViewController isAvailableForServiceType:type];
+ }
+ @catch (NSException* exception) {
+ return false;
+ }
+}
+
+- (void)shareViaInternal:(CDVInvokedUrlCommand*)command
+ type:(NSString *) type {
+
+ NSString *message = [command.arguments objectAtIndex:0];
+ // subject is not supported by the SLComposeViewController
+ NSArray *filenames = [command.arguments objectAtIndex:2];
+ NSString *urlString = [command.arguments objectAtIndex:3];
+
+ // boldly invoke the target app, because the phone will display a nice message asking to configure the app
+ SLComposeViewController *composeViewController = [SLComposeViewController composeViewControllerForServiceType:type];
+ if (message != (id)[NSNull null]) {
+ [composeViewController setInitialText:message];
+ }
+
+ for (NSString* filename in filenames) {
+ UIImage* image = [self getImage:filename];
+ if (image != nil) {
+ [composeViewController addImage:image];
+ }
+ }
+
+ if (urlString != (id)[NSNull null]) {
+ [composeViewController addURL:[NSURL URLWithString:[urlString SSURLEncodedString]]];
+ }
+
+ [composeViewController setCompletionHandler:^(SLComposeViewControllerResult result) {
+ if (SLComposeViewControllerResultCancelled == result) {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"cancelled"];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ } else if (SLComposeViewControllerResultDone == result || [self isAvailableForSharing:command type:type]) {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:true];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ } else {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }
+ // required for iOS6 (issues #162 and #167)
+ [self.viewController dismissViewControllerAnimated:YES completion:nil];
+ }];
+ [[self getTopMostViewController] presentViewController:composeViewController animated:YES completion:nil];
+}
+
+- (void)shareViaEmail:(CDVInvokedUrlCommand*)command {
+ if ([self isEmailAvailable]) {
+
+ if (TARGET_IPHONE_SIMULATOR && IsAtLeastiOSVersion(@"8.0")) {
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"SocialSharing plugin"
+ message:@"Sharing via email is not supported on the iOS 8 simulator."
+ delegate:nil
+ cancelButtonTitle:@"OK"
+ otherButtonTitles:nil];
+ [alert show];
+ return;
+ }
+
+ [self cycleTheGlobalMailComposer];
+
+ self.globalMailComposer.mailComposeDelegate = self;
+
+ if ([command.arguments objectAtIndex:0] != (id)[NSNull null]) {
+ NSString *message = [command.arguments objectAtIndex:0];
+ BOOL isHTML = [message rangeOfString:@"<[^>]+>" options:NSRegularExpressionSearch].location != NSNotFound;
+ [self.globalMailComposer setMessageBody:message isHTML:isHTML];
+ }
+
+ if ([command.arguments objectAtIndex:1] != (id)[NSNull null]) {
+ [self.globalMailComposer setSubject: [command.arguments objectAtIndex:1]];
+ }
+
+ if ([command.arguments objectAtIndex:2] != (id)[NSNull null]) {
+ [self.globalMailComposer setToRecipients:[command.arguments objectAtIndex:2]];
+ }
+
+ if ([command.arguments objectAtIndex:3] != (id)[NSNull null]) {
+ [self.globalMailComposer setCcRecipients:[command.arguments objectAtIndex:3]];
+ }
+
+ if ([command.arguments objectAtIndex:4] != (id)[NSNull null]) {
+ [self.globalMailComposer setBccRecipients:[command.arguments objectAtIndex:4]];
+ }
+
+ if ([command.arguments objectAtIndex:5] != (id)[NSNull null]) {
+ NSArray* attachments = [command.arguments objectAtIndex:5];
+ NSFileManager* fileManager = [NSFileManager defaultManager];
+ for (NSString* path in attachments) {
+ NSURL *file = [self getFile:path];
+ NSData* data = [fileManager contentsAtPath:file.path];
+
+ if (!data) {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"invalid attachment"];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ return;
+ }
+
+ NSString* fileName;
+ NSString* mimeType;
+ NSString* basename = [self getBasenameFromAttachmentPath:path];
+
+ //Find data anywhere in string
+ NSRange rangeData = [basename rangeOfString:@"data:"];
+ if (rangeData.location == NSNotFound)
+ {
+ fileName = [basename pathComponents].lastObject;
+ mimeType = [self getMimeTypeFromFileExtension:[basename pathExtension]];
+ }
+ else
+ {
+ mimeType = (NSString*)[[[basename substringFromIndex:rangeData.location+rangeData.length] componentsSeparatedByString: @";"] objectAtIndex:0];
+
+ //Find df anywhere in string
+ NSRange rangeDF = [basename rangeOfString:@"df:"];
+ //If not found fallback to default name
+ if (rangeDF.location == NSNotFound) {
+ fileName = @"attachment.";
+ fileName = [fileName stringByAppendingString:(NSString*)[[mimeType componentsSeparatedByString: @"/"] lastObject]];
+ } else {
+ //Found, apply name
+ fileName = (NSString*)[[[basename substringFromIndex:rangeDF.location+rangeDF.length] componentsSeparatedByString: @";"] objectAtIndex:0];
+ }
+
+
+ NSString *base64content = (NSString*)[[basename componentsSeparatedByString: @","] lastObject];
+ data = [SocialSharing dataFromBase64String:base64content];
+ }
+ [self.globalMailComposer addAttachmentData:data mimeType:mimeType fileName:fileName];
+ }
+ }
+
+ // remember the command, because we need it in the didFinishWithResult method
+ _command = command;
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [[self getTopMostViewController] presentViewController:self.globalMailComposer animated:YES completion:nil];
+ });
+ } else {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }
+}
+
+- (UIViewController*) getTopMostViewController {
+ UIViewController *presentingViewController = [[UIApplication sharedApplication] keyWindow].rootViewController;
+ while (presentingViewController.presentedViewController != nil) {
+ presentingViewController = presentingViewController.presentedViewController;
+ }
+ return presentingViewController;
+}
+
+- (NSString*) getBasenameFromAttachmentPath:(NSString*)path {
+ if ([path hasPrefix:@"base64:"]) {
+ NSString* pathWithoutPrefix = [path stringByReplacingOccurrencesOfString:@"base64:" withString:@""];
+ return [pathWithoutPrefix substringToIndex:[pathWithoutPrefix rangeOfString:@"//"].location];
+ }
+ return [path componentsSeparatedByString: @"?"][0];
+}
+
+- (NSString*) getMimeTypeFromFileExtension:(NSString*)extension {
+ if (!extension) {
+ return nil;
+ }
+ // Get the UTI from the file's extension
+ CFStringRef ext = (CFStringRef)CFBridgingRetain(extension);
+ CFStringRef type = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, ext, NULL);
+ // Converting UTI to a mime type
+ NSString *result = (NSString*)CFBridgingRelease(UTTypeCopyPreferredTagWithClass(type, kUTTagClassMIMEType));
+ CFRelease(ext);
+ CFRelease(type);
+ if (result == nil) {
+ result = @"application/octet-stream";
+ }
+
+ return result;
+}
+
+/**
+ * Delegate will be called after the mail composer did finish an action
+ * to dismiss the view.
+ */
+- (void) mailComposeController:(MFMailComposeViewController*)controller
+ didFinishWithResult:(MFMailComposeResult)result
+ error:(NSError*)error {
+ bool ok = result == MFMailComposeResultSent;
+ [self.globalMailComposer dismissViewControllerAnimated:YES completion:nil];
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:ok];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:_command.callbackId];
+}
+
+-(void)cycleTheGlobalMailComposer {
+ // we are cycling the damned GlobalMailComposer: http://stackoverflow.com/questions/25604552/i-have-real-misunderstanding-with-mfmailcomposeviewcontroller-in-swift-ios8-in/25604976#25604976
+ self.globalMailComposer = nil;
+ self.globalMailComposer = [[MFMailComposeViewController alloc] init];
+}
+
+- (bool)canShareViaSMS {
+ Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));
+ return messageClass != nil && [messageClass canSendText];
+}
+
+- (void)shareViaSMS:(CDVInvokedUrlCommand*)command {
+ if ([self canShareViaSMS]) {
+ NSDictionary* options = [command.arguments objectAtIndex:0];
+ NSString *phonenumbers = [command.arguments objectAtIndex:1];
+ NSString *message = [options objectForKey:@"message"];
+ NSString *subject = [options objectForKey:@"subject"];
+ NSString *image = [options objectForKey:@"image"];
+
+ MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
+ picker.messageComposeDelegate = (id) self;
+ if (message != (id)[NSNull null]) {
+ picker.body = message;
+ }
+ if (subject != (id)[NSNull null]) {
+ [picker setSubject:subject];
+ }
+ if (image != nil && image != (id)[NSNull null]) {
+ BOOL canSendAttachments = [[MFMessageComposeViewController class] respondsToSelector:@selector(canSendAttachments)];
+ if (canSendAttachments) {
+ NSURL *file = [self getFile:image];
+ if (file != nil) {
+ [picker addAttachmentURL:file withAlternateFilename:nil];
+ }
+ }
+ }
+
+ if (phonenumbers != (id)[NSNull null]) {
+ [picker setRecipients:[phonenumbers componentsSeparatedByString:@","]];
+ }
+ // remember the command, because we need it in the didFinishWithResult method
+ _command = command;
+ dispatch_async(dispatch_get_main_queue(), ^{
+ picker.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
+ [[self getTopMostViewController] presentViewController:picker animated:NO completion:nil];
+ });
+ } else {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }
+}
+
+// Dismisses the SMS composition interface when users taps Cancel or Send
+- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {
+ bool ok = result == MessageComposeResultSent;
+ [[self getTopMostViewController] dismissViewControllerAnimated:YES completion:nil];
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:ok];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:_command.callbackId];
+}
+
+- (bool)canShareViaInstagram {
+ return [[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"instagram://app"]]; // requires whitelisting on iOS9
+}
+
+- (bool)canShareViaWhatsApp {
+ return [[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"whatsapp://app"]]; // requires whitelisting on iOS9
+}
+
+- (bool)canShareViaFacebook {
+ return [[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"fb://"]]; // requires whitelisting on iOS9
+}
+
+- (bool)canShareViaTwitter {
+ return [[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"twitter://"]]; // requires whitelisting on iOS9
+}
+
+// this is only an internal test method for now, can be used to open a share sheet with 'Open in xx' links for tumblr, drive, dropbox, ..
+- (void)openImage:(NSString *)imageName {
+ UIImage* image =[self getImage:imageName];
+ if (image != nil) {
+ NSString * savePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/myTempImage.jpg"];
+ [UIImageJPEGRepresentation(image, 1.0) writeToFile:savePath atomically:YES];
+ _documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:savePath]];
+ _documentInteractionController.UTI = @""; // TODO find the scheme for google drive and create a shareViaGoogleDrive function
+ [_documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.viewController.view animated: YES];
+ }
+}
+
+- (void)shareViaInstagram:(CDVInvokedUrlCommand*)command {
+
+ // on iOS9 canShareVia('instagram'..) will only work if instagram:// is whitelisted.
+ // If it's not, this method will ask permission to the user on iOS9 for opening the app,
+ // which is of course better than Instagram sharing not working at all because you forgot to whitelist it.
+ // Tradeoff: on iOS9 this method will always return true, so make sure to whitelist it and call canShareVia('instagram'..)
+ if (!IsAtLeastiOSVersion(@"9.0")) {
+ if (![self canShareViaInstagram]) {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ return;
+ }
+ }
+
+ NSString *message = [command.arguments objectAtIndex:0];
+ // subject is not supported by the SLComposeViewController
+ NSArray *filenames = [command.arguments objectAtIndex:2];
+
+ // only use the first image (for now.. maybe we can share in a loop?)
+ UIImage* image = nil;
+ for (NSString* filename in filenames) {
+ image = [self getImage:filename];
+ break;
+ }
+
+// NSData *imageObj = [NSData dataFromBase64String:objectAtIndex0];
+ NSString *tmpDir = NSTemporaryDirectory();
+ NSString *path = [tmpDir stringByAppendingPathComponent:@"instagram.igo"];
+ [UIImageJPEGRepresentation(image, 1.0) writeToFile:path atomically:YES];
+
+ _documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:path]];
+ _documentInteractionController.delegate = self;
+ _documentInteractionController.UTI = @"com.instagram.exclusivegram";
+
+ if (message != (id)[NSNull null]) {
+ // no longer working, so ..
+ _documentInteractionController.annotation = @{@"InstagramCaption" : message};
+
+ // .. we put the message on the clipboard (you app can prompt the user to paste it)
+ UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
+ [pasteboard setValue:message forPasteboardType:@"public.utf8-plain-text"];
+ }
+
+ // remember the command for the delegate method
+ _command = command;
+
+ // test for #513
+ dispatch_async(dispatch_get_main_queue(), ^(void){
+ [_documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.webView animated:YES];
+ });
+}
+
+- (void)shareViaWhatsApp:(CDVInvokedUrlCommand*)command {
+
+ // on iOS9 canShareVia('whatsapp'..) will only work if whatsapp:// is whitelisted.
+ // If it's not, this method will ask permission to the user on iOS9 for opening the app,
+ // which is of course better than WhatsApp sharing not working at all because you forgot to whitelist it.
+ // Tradeoff: on iOS9 this method will always return true, so make sure to whitelist it and call canShareVia('whatsapp'..)
+ if (!IsAtLeastiOSVersion(@"9.0")) {
+ if (![self canShareViaWhatsApp]) {
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"not available"];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ return;
+ }
+ }
+
+ NSString *message = [command.arguments objectAtIndex:0];
+ // subject is not supported by the SLComposeViewController
+ NSArray *filenames = [command.arguments objectAtIndex:2];
+ NSString *urlString = [command.arguments objectAtIndex:3];
+ NSString *abid = [command.arguments objectAtIndex:4];
+ NSString *phone = [command.arguments objectAtIndex:5];
+
+ // only use the first image (for now.. maybe we can share in a loop?)
+ UIImage *image = nil;
+ for (NSString *filename in filenames) {
+ image = [self getImage:filename];
+ break;
+ }
+
+ // with WhatsApp, we can share an image OR text+url.. image wins if set
+ if (image != nil) {
+ NSString *savePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/whatsAppTmp.jpg"];
+ [UIImageJPEGRepresentation(image, 1.0) writeToFile:savePath atomically:YES];
+ _documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:savePath]];
+ _documentInteractionController.UTI = @"net.whatsapp.image";
+ _documentInteractionController.delegate = self;
+ _command = command;
+ [_documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.viewController.view animated: YES];
+ } else {
+ // append an url to a message, if both are passed
+ NSString *shareString = @"";
+ if (message != (id)[NSNull null]) {
+ shareString = message;
+ }
+ if (urlString != (id)[NSNull null]) {
+ if ([shareString isEqual: @""]) {
+ shareString = urlString;
+ } else {
+ shareString = [NSString stringWithFormat:@"%@ %@", shareString, [urlString SSURLEncodedString]];
+ }
+ }
+ NSString *encodedShareString = [shareString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+ // also encode the '=' character
+ encodedShareString = [encodedShareString stringByReplacingOccurrencesOfString:@"=" withString:@"%3D"];
+ encodedShareString = [encodedShareString stringByReplacingOccurrencesOfString:@"&" withString:@"%26"];
+ NSString *abidString = @"";
+ if (abid != (id)[NSNull null]) {
+ abidString = [NSString stringWithFormat:@"abid=%@&", abid];
+ }
+ NSString *phoneString = @"";
+ if (phone != (id)[NSNull null]) {
+ phoneString = [NSString stringWithFormat:@"phone=%@&", phone];
+ }
+ NSString *encodedShareStringForWhatsApp = [NSString stringWithFormat:@"whatsapp://send?%@%@text=%@", abidString, phoneString, encodedShareString];
+
+ NSURL *whatsappURL = [NSURL URLWithString:encodedShareStringForWhatsApp];
+ [[UIApplication sharedApplication] openURL: whatsappURL];
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+ }
+}
+
+- (void)saveToPhotoAlbum:(CDVInvokedUrlCommand*)command {
+ self.command = command;
+ NSArray *filenames = [command.arguments objectAtIndex:0];
+ [self.commandDelegate runInBackground:^{
+ bool shared = false;
+ for (NSString* filename in filenames) {
+ UIImage* image = [self getImage:filename];
+ if (image != nil) {
+ shared = true;
+ UIImageWriteToSavedPhotosAlbum(image, self, @selector(thisImage:wasSavedToPhotoAlbumWithError:contextInfo:), nil);
+ }
+ }
+ if (!shared) {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"no valid image was passed"];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:self.command.callbackId];
+ }
+ }];
+}
+
+// called from saveToPhotoAlbum, note that we only send feedback for the first image that's being saved (not keeping the callback)
+// but since the UIImageWriteToSavedPhotosAlbum function is only called with valid images that should not be a problem
+- (void)thisImage:(UIImage *)image wasSavedToPhotoAlbumWithError:(NSError *)error contextInfo:(void*)ctxInfo {
+ if (error) {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:error.localizedDescription];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:self.command.callbackId];
+ } else {
+ CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:self.command.callbackId];
+ }
+}
+
+-(UIImage*)getImage: (NSString *)imageName {
+ UIImage *image = nil;
+ if (imageName != (id)[NSNull null]) {
+ if ([imageName hasPrefix:@"http"]) {
+ image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imageName]]];
+ } else if ([imageName hasPrefix:@"www/"]) {
+ image = [UIImage imageNamed:imageName];
+ } else if ([imageName hasPrefix:@"file://"]) {
+ image = [UIImage imageWithData:[NSData dataWithContentsOfFile:[[NSURL URLWithString:imageName] path]]];
+ } else if ([imageName hasPrefix:@"data:"]) {
+ // using a base64 encoded string
+ NSURL *imageURL = [NSURL URLWithString:imageName];
+ NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
+ image = [UIImage imageWithData:imageData];
+ } else if ([imageName hasPrefix:@"assets-library://"]) {
+ // use assets-library
+ NSURL *imageURL = [NSURL URLWithString:imageName];
+ NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
+ image = [UIImage imageWithData:imageData];
+ } else {
+ // assume anywhere else, on the local filesystem
+ image = [UIImage imageWithData:[NSData dataWithContentsOfFile:imageName]];
+ }
+ }
+ return image;
+}
+
+-(NSURL*)getFile: (NSString *)fileName {
+ NSURL *file = nil;
+ if (fileName != (id)[NSNull null]) {
+ NSRange rangeData = [fileName rangeOfString:@"data:"];
+ if ([fileName hasPrefix:@"http"]) {
+ NSURL *url = [NSURL URLWithString:fileName];
+ NSData *fileData = [NSData dataWithContentsOfURL:url];
+ NSURLRequest *request = [NSURLRequest requestWithURL: url];
+ NSHTTPURLResponse *response;
+ [NSURLConnection sendSynchronousRequest: request returningResponse: &response error: nil];
+ if ([response respondsToSelector:@selector(allHeaderFields)]) {
+ NSDictionary *dictionary = [response allHeaderFields];
+ NSLog([dictionary description]);
+ NSString *name = dictionary[@"Content-Disposition"];
+ if (name == nil){
+ NSString *name = (NSString*)[[fileName componentsSeparatedByString: @"/"] lastObject];
+ file = [NSURL fileURLWithPath:[self storeInFile:[name componentsSeparatedByString: @"?"][0] fileData:fileData]];
+ } else {
+ file = [NSURL fileURLWithPath:[self storeInFile:[[name componentsSeparatedByString:@"="] lastObject] fileData:fileData]];
+ }
+ } else {
+ NSString *name = (NSString*)[[fileName componentsSeparatedByString: @"/"] lastObject];
+ file = [NSURL fileURLWithPath:[self storeInFile:[name componentsSeparatedByString: @"?"][0] fileData:fileData]];
+ }
+ } else if ([fileName hasPrefix:@"www/"]) {
+ NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
+ NSString *fullPath = [NSString stringWithFormat:@"%@/%@", bundlePath, fileName];
+ file = [NSURL fileURLWithPath:fullPath];
+ } else if ([fileName hasPrefix:@"file://"]) {
+ // stripping the first 6 chars, because the path should start with / instead of file://
+ file = [NSURL fileURLWithPath:[fileName substringFromIndex:6]];
+ } else if (rangeData.location != NSNotFound ){
+ //If found "data:"
+ NSString *fileType = (NSString*)[[[fileName substringFromIndex:rangeData.location+rangeData.length] componentsSeparatedByString: @";"] objectAtIndex:0];
+
+ NSString* attachmentName;
+ //Find df anywhere in string
+ NSRange rangeDF = [fileName rangeOfString:@"df:"];
+ //If not found fallback to default name
+ if (rangeDF.location == NSNotFound) {
+ attachmentName = @"attachment.";
+ attachmentName = [attachmentName stringByAppendingString:(NSString*)[[fileType componentsSeparatedByString: @"/"] lastObject]];
+ } else {
+ //Found, apply name
+ attachmentName = (NSString*)[[[fileName substringFromIndex:rangeDF.location+rangeDF.length] componentsSeparatedByString: @";"] objectAtIndex:0];
+ }
+
+
+ NSString *base64content = (NSString*)[[fileName componentsSeparatedByString: @","] lastObject];
+ NSData* data = [SocialSharing dataFromBase64String:base64content];
+ file = [NSURL fileURLWithPath:[self storeInFile:attachmentName fileData:data]];
+
+ } else {
+ // assume anywhere else, on the local filesystem
+ file = [NSURL fileURLWithPath:fileName];
+ }
+ }
+ return file;
+}
+
+-(NSString*) storeInFile: (NSString*) fileName
+ fileData: (NSData*) fileData {
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ NSString *documentsDirectory = [paths objectAtIndex:0];
+ NSString *filePath = [documentsDirectory stringByAppendingPathComponent:fileName];
+ [fileData writeToFile:filePath atomically:YES];
+ _tempStoredFile = filePath;
+ return filePath;
+}
+
+- (void) cleanupStoredFiles {
+ if (_tempStoredFile != nil) {
+ NSError *error;
+ [[NSFileManager defaultManager]removeItemAtPath:_tempStoredFile error:&error];
+ }
+}
+
++ (NSData*) dataFromBase64String:(NSString*)aString {
+ return [[NSData alloc] initWithBase64EncodedString:aString options:0];
+}
+
+#pragma mark - UIPopoverControllerDelegate methods
+
+- (void)popoverController:(UIPopoverController *)popoverController willRepositionPopoverToRect:(inout CGRect *)rect inView:(inout UIView **)view {
+ NSArray *comps = [[self getIPadPopupCoordinates] componentsSeparatedByString:@","];
+ CGRect newRect = [self getPopupRectFromIPadPopupCoordinates:comps];
+ rect->origin = newRect.origin;
+}
+
+- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController {
+ _popover = nil;
+}
+
+#pragma mark - UIDocumentInteractionControllerDelegate methods
+
+- (void) documentInteractionController: (UIDocumentInteractionController *) controller willBeginSendingToApplication: (NSString *) application {
+ // note that the application actually contains the app bundle id which was picked (for whatsapp and instagram only)
+ NSLog(@"SocialSharing app selected: %@", application);
+}
+
+- (void) documentInteractionControllerDidDismissOpenInMenu: (UIDocumentInteractionController *) controller {
+ if (self.command != nil) {
+ CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+ [self.commandDelegate sendPluginResult:result callbackId: self.command.callbackId];
+ }
+}
+
+@end
diff --git a/cordova/platforms/ios/App/PrivacyInfo.xcprivacy b/cordova/platforms/ios/App/PrivacyInfo.xcprivacy
new file mode 100644
index 000000000..4b2e70fdd
--- /dev/null
+++ b/cordova/platforms/ios/App/PrivacyInfo.xcprivacy
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>NSPrivacyTracking</key>
+ <false/>
+ <key>NSPrivacyCollectedDataTypes</key>
+ <array/>
+ <key>NSPrivacyAccessedAPITypes</key>
+ <array/>
+ <key>NSPrivacyTrackingDomains</key>
+ <array/>
+</dict>
+</plist>
diff --git a/cordova/platforms/ios/cordova/log b/cordova/platforms/ios/App/Resources/README
old mode 100755
new mode 100644
similarity index 88%
rename from cordova/platforms/ios/cordova/log
rename to cordova/platforms/ios/App/Resources/README
index b235b09fd..1872c8e99
--- a/cordova/platforms/ios/cordova/log
+++ b/cordova/platforms/ios/App/Resources/README
@@ -1,4 +1,3 @@
-#! /bin/sh
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@@ -18,6 +17,4 @@
# under the License.
#
-CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd -P)
-
-tail -f "$CORDOVA_PATH/console.log"
+Put resource files to embed in the app bundle here.
diff --git a/cordova/platforms/ios/App/Resources/appbeep.wav b/cordova/platforms/ios/App/Resources/appbeep.wav
new file mode 100755
index 000000000..24a13d40e
Binary files /dev/null and b/cordova/platforms/ios/App/Resources/appbeep.wav differ
diff --git a/cordova/platforms/ios/CordovaLib/CordovaLib_Prefix.pch b/cordova/platforms/ios/App/SceneDelegate.swift
similarity index 91%
rename from cordova/platforms/ios/CordovaLib/CordovaLib_Prefix.pch
rename to cordova/platforms/ios/App/SceneDelegate.swift
index 954558070..82b592e75 100644
--- a/cordova/platforms/ios/CordovaLib/CordovaLib_Prefix.pch
+++ b/cordova/platforms/ios/App/SceneDelegate.swift
@@ -6,17 +6,19 @@
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
- */
+*/
+
+import Cordova
+
+class SceneDelegate: CDVSceneDelegate {
+}
-#ifdef __OBJC__
- #import <Foundation/Foundation.h>
-#endif
diff --git a/cordova/platforms/ios/App/ViewController.swift b/cordova/platforms/ios/App/ViewController.swift
new file mode 100644
index 000000000..0f29fed29
--- /dev/null
+++ b/cordova/platforms/ios/App/ViewController.swift
@@ -0,0 +1,31 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+import Cordova
+
+#if compiler(>=6.1)
+@objc @implementation
+#else
+@_objcImplementation
+#endif
+extension MainViewController {
+}
+
+class ViewController: MainViewController {
+}
diff --git a/cordova/platforms/ios/TagSpaces/config.xml b/cordova/platforms/ios/App/config.xml
similarity index 75%
rename from cordova/platforms/ios/TagSpaces/config.xml
rename to cordova/platforms/ios/App/config.xml
index cb7d4de05..0934a87b7 100644
--- a/cordova/platforms/ios/TagSpaces/config.xml
+++ b/cordova/platforms/ios/App/config.xml
@@ -25,13 +25,34 @@
<param name="ios-package" value="CDVGestureHandler" />
<param name="onload" value="true" />
</feature>
+ <feature name="StatusBarInternal">
+ <param name="ios-package" value="CDVStatusBarInternal" />
+ <param name="onload" value="true" />
+ </feature>
<feature name="Downloader">
<param name="ios-package" value="Downloader" />
</feature>
+ <feature name="Device">
+ <param name="ios-package" value="CDVDevice" />
+ </feature>
+ <feature name="BackgroundMode">
+ <param name="ios-package" onload="true" value="APPBackgroundMode" />
+ <param name="onload" value="true" />
+ </feature>
<feature name="File">
<param name="ios-package" value="CDVFile" />
<param name="onload" value="true" />
</feature>
+ <feature name="FileOpener2">
+ <param name="ios-package" value="FileOpener2" />
+ </feature>
+ <feature name="SocialSharing">
+ <param name="ios-package" value="SocialSharing" />
+ <param name="onload" value="true" />
+ </feature>
+ <feature name="Camera">
+ <param name="ios-package" value="CDVCamera" />
+ </feature>
<name>TagSpaces</name>
<description>
Offline file organizer and browser with tagging support.
@@ -50,18 +71,14 @@
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<preference name="AllowInlineMediaPlayback" value="false" />
- <preference name="BackupWebStorage" value="cloud" />
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
- <preference name="KeyboardDisplayRequiresUserAction" value="true" />
+ <preference name="MediaPermissionGrantType" value="grantIfSameHostElsePrompt" />
<preference name="MediaTypesRequiringUserActionForPlayback" value="none" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="SuppressesLongPressGesture" value="false" />
<preference name="Suppresses3DTouchGesture" value="false" />
- <preference name="GapBetweenPages" value="0" />
- <preference name="PageLength" value="0" />
- <preference name="PaginationBreakingMode" value="page" />
- <preference name="PaginationMode" value="unpaginated" />
+ <preference name="CameraUsesGeolocation" value="false" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" />
<preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root" />
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDV.h b/cordova/platforms/ios/CordovaLib/Classes/Public/CDV.h
deleted file mode 100644
index 8706ef4aa..000000000
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDV.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVAvailability.h"
-#import "CDVAvailabilityDeprecated.h"
-#import "CDVAppDelegate.h"
-#import "CDVPlugin.h"
-#import "CDVPluginResult.h"
-#import "CDVViewController.h"
-#import "CDVCommandDelegate.h"
-#import "CDVInvokedUrlCommand.h"
-#import "CDVWhitelist.h"
-#import "CDVScreenOrientationDelegate.h"
-#import "CDVTimer.h"
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m
deleted file mode 100644
index 9188be79e..000000000
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVAppDelegate.h"
-
-@implementation CDVAppDelegate
-
-@synthesize window, viewController;
-
-- (id)init
-{
- self = [super init];
- return self;
-}
-
-#pragma mark UIApplicationDelegate implementation
-
-/**
- * This is main kick off after the app inits, the views and Settings are setup here. (preferred - iOS4 and up)
- */
-- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
-{
- CGRect screenBounds = [[UIScreen mainScreen] bounds];
-
- self.window = [[UIWindow alloc] initWithFrame:screenBounds];
- self.window.autoresizesSubviews = YES;
-
- // only set if not already set in subclass
- if (self.viewController == nil) {
- self.viewController = [[CDVViewController alloc] init];
- }
-
- // Set your app's start page by setting the <content src='foo.html' /> tag in config.xml.
- // If necessary, uncomment the line below to override it.
- // self.viewController.startPage = @"index.html";
-
- // NOTE: To customize the view's frame size (which defaults to full screen), override
- // [self.viewController viewWillAppear:] in your view controller.
-
- self.window.rootViewController = self.viewController;
- [self.window makeKeyAndVisible];
-
- return YES;
-}
-
-// this happens while we are running ( in the background, or from within our own app )
-// only valid if 40x-Info.plist specifies a protocol to handle
-- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
-{
- if (!url) {
- return NO;
- }
-
- NSMutableDictionary * openURLData = [[NSMutableDictionary alloc] init];
-
- [openURLData setValue:url forKey:@"url"];
-
- if (options[UIApplicationOpenURLOptionsSourceApplicationKey]) {
- [openURLData setValue:options[UIApplicationOpenURLOptionsSourceApplicationKey] forKey:@"sourceApplication"];
- }
-
- if (options[UIApplicationOpenURLOptionsAnnotationKey]) {
- [openURLData setValue:options[UIApplicationOpenURLOptionsAnnotationKey] forKey:@"annotation"];
- }
-
- // all plugins will get the notification, and their handlers will be called
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification object:openURLData]];
-
- return YES;
-}
-
-- (UIInterfaceOrientationMask)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
-{
- // iPhone doesn't support upside down by default, while the iPad does. Override to allow all orientations always, and let the root view controller decide what's allowed (the supported orientations mask gets intersected).
- NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown);
-
- return supportedInterfaceOrientations;
-}
-
-@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegate.h b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegate.h
deleted file mode 100644
index ac82727a9..000000000
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegate.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import "CDVAvailability.h"
-#import "CDVInvokedUrlCommand.h"
-
-@class CDVPlugin;
-@class CDVPluginResult;
-@class CDVWhitelist;
-
-typedef NSURL* (^ UrlTransformerBlock)(NSURL*);
-
-@protocol CDVCommandDelegate <NSObject>
-
-@property (nonatomic, readonly) NSDictionary* settings;
-@property (nonatomic, copy) UrlTransformerBlock urlTransformer;
-
-- (NSString*)pathForResource:(NSString*)resourcepath;
-- (id)getCommandInstance:(NSString*)pluginName;
-
-// Sends a plugin result to the JS. This is thread-safe.
-- (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId;
-// Evaluates the given JS. This is thread-safe.
-- (void)evalJs:(NSString*)js;
-// Can be used to evaluate JS right away instead of scheduling it on the run-loop.
-// This is required for dispatch resign and pause events, but should not be used
-// without reason. Without the run-loop delay, alerts used in JS callbacks may result
-// in dead-lock. This method must be called from the UI thread.
-- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop;
-// Runs the given block on a background thread using a shared thread-pool.
-- (void)runInBackground:(void (^)(void))block;
-
-@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin+Resources.h b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin+Resources.h
deleted file mode 100644
index cc43b16b7..000000000
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin+Resources.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <UIKit/UIKit.h>
-#import "CDVPlugin.h"
-
-@interface CDVPlugin (CDVPluginResources)
-
-/*
- This will return the localized string for a key in a .bundle that is named the same as your class
- For example, if your plugin class was called Foo, and you have a Spanish localized strings file, it will
- try to load the desired key from Foo.bundle/es.lproj/Localizable.strings
- */
-- (NSString*)pluginLocalizedString:(NSString*)key;
-
-/*
- This will return the image for a name in a .bundle that is named the same as your class
- For example, if your plugin class was called Foo, and you have an image called "bar",
- it will try to load the image from Foo.bundle/bar.png (and appropriately named retina versions)
- */
-- (UIImage*)pluginImageResource:(NSString*)name;
-
-@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.h b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.h
deleted file mode 100644
index 0bdbbabbb..000000000
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-#import "CDVPluginResult.h"
-#import "NSMutableArray+QueueAdditions.h"
-#import "CDVCommandDelegate.h"
-#import "CDVWebViewEngineProtocol.h"
-
-@interface UIView (org_apache_cordova_UIView_Extension)
-
-@property (nonatomic, weak) UIScrollView* scrollView;
-
-@end
-
-extern NSString* const CDVPageDidLoadNotification;
-extern NSString* const CDVPluginHandleOpenURLNotification;
-extern NSString* const CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification;
-extern NSString* const CDVPluginResetNotification;
-extern NSString* const CDVViewWillAppearNotification;
-extern NSString* const CDVViewDidAppearNotification;
-extern NSString* const CDVViewWillDisappearNotification;
-extern NSString* const CDVViewDidDisappearNotification;
-extern NSString* const CDVViewWillLayoutSubviewsNotification;
-extern NSString* const CDVViewDidLayoutSubviewsNotification;
-extern NSString* const CDVViewWillTransitionToSizeNotification;
-
-@interface CDVPlugin : NSObject {}
-
-@property (nonatomic, readonly, weak) UIView* webView;
-@property (nonatomic, readonly, weak) id <CDVWebViewEngineProtocol> webViewEngine;
-
-@property (nonatomic, weak) UIViewController* viewController;
-@property (nonatomic, weak) id <CDVCommandDelegate> commandDelegate;
-
-@property (readonly, assign) BOOL hasPendingOperation;
-
-- (void)pluginInitialize;
-
-- (void)handleOpenURL:(NSNotification*)notification;
-- (void)handleOpenURLWithApplicationSourceAndAnnotation:(NSNotification*)notification;
-- (void)onAppTerminate;
-- (void)onMemoryWarning;
-- (void)onReset;
-- (void)dispose;
-
-/*
- // see initWithWebView implementation
- - (void) onPause {}
- - (void) onResume {}
- - (void) onOrientationWillChange {}
- - (void) onOrientationDidChange {}
- */
-
-- (id)appDelegate;
-
-@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.h b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.h
deleted file mode 100644
index 2f62d77b4..000000000
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "CDVAvailability.h"
-
-typedef NS_ENUM(NSUInteger, CDVCommandStatus) {
- CDVCommandStatus_NO_RESULT NS_SWIFT_NAME(noResult) = 0,
- CDVCommandStatus_OK NS_SWIFT_NAME(ok),
- CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION NS_SWIFT_NAME(classNotFoundException),
- CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION NS_SWIFT_NAME(illegalAccessException),
- CDVCommandStatus_INSTANTIATION_EXCEPTION NS_SWIFT_NAME(instantiationException),
- CDVCommandStatus_MALFORMED_URL_EXCEPTION NS_SWIFT_NAME(malformedUrlException),
- CDVCommandStatus_IO_EXCEPTION NS_SWIFT_NAME(ioException),
- CDVCommandStatus_INVALID_ACTION NS_SWIFT_NAME(invalidAction),
- CDVCommandStatus_JSON_EXCEPTION NS_SWIFT_NAME(jsonException),
- CDVCommandStatus_ERROR NS_SWIFT_NAME(error)
-};
-
-// This exists to preserve compatibility with early Swift plugins, who are
-// using CDVCommandStatus as ObjC-style constants rather than as Swift enum
-// values.
-// This declares extern'ed constants (implemented in CDVPluginResult.m)
-#define SWIFT_ENUM_COMPAT_HACK(enumVal) extern const CDVCommandStatus SWIFT_##enumVal NS_SWIFT_NAME(enumVal)
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_NO_RESULT);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_OK);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INSTANTIATION_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_MALFORMED_URL_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_IO_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INVALID_ACTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_JSON_EXCEPTION);
-SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ERROR);
-#undef SWIFT_ENUM_COMPAT_HACK
-
-@interface CDVPluginResult : NSObject {}
-
-@property (nonatomic, strong, readonly) NSNumber* status;
-@property (nonatomic, strong, readonly) id message;
-@property (nonatomic, strong) NSNumber* keepCallback;
-// This property can be used to scope the lifetime of another object. For example,
-// Use it to store the associated NSData when `message` is created using initWithBytesNoCopy.
-@property (nonatomic, strong) id associatedObject;
-
-- (CDVPluginResult*)init;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsString:(NSString*)theMessage;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArray:(NSArray*)theMessage;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsInt:(int)theMessage;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSInteger:(NSInteger)theMessage;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSUInteger:(NSUInteger)theMessage;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDouble:(double)theMessage;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsBool:(BOOL)theMessage;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary*)theMessage;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArrayBuffer:(NSData*)theMessage;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsMultipart:(NSArray*)theMessages;
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageToErrorObject:(int)errorCode;
-
-+ (void)setVerbose:(BOOL)verbose;
-+ (BOOL)isVerbose;
-
-- (void)setKeepCallbackAsBool:(BOOL)bKeepCallback;
-
-- (NSString*)argumentsAsJSON;
-
-@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m
deleted file mode 100644
index 333124c2a..000000000
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-
-#import "CDVURLSchemeHandler.h"
-#import <MobileCoreServices/MobileCoreServices.h>
-
-#import <objc/message.h>
-
-@implementation CDVURLSchemeHandler
-
-
-- (instancetype)initWithVC:(CDVViewController *)controller
-{
- self = [super init];
- if (self) {
- _viewController = controller;
- }
- return self;
-}
-
-- (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask
-{
- NSString * startPath = [[NSBundle mainBundle] pathForResource:self.viewController.wwwFolderName ofType: nil];
- NSURL * url = urlSchemeTask.request.URL;
- NSString * stringToLoad = url.path;
- NSString * scheme = url.scheme;
-
- CDVViewController* vc = (CDVViewController*)self.viewController;
-
- /*
- * Give plugins the chance to handle the url
- */
- BOOL anyPluginsResponded = NO;
- BOOL handledRequest = NO;
-
- NSDictionary *pluginObjects = [[vc pluginObjects] copy];
- for (NSString* pluginName in pluginObjects) {
- self.schemePlugin = [vc.pluginObjects objectForKey:pluginName];
- SEL selector = NSSelectorFromString(@"overrideSchemeTask:");
- if ([self.schemePlugin respondsToSelector:selector]) {
- handledRequest = (((BOOL (*)(id, SEL, id <WKURLSchemeTask>))objc_msgSend)(self.schemePlugin, selector, urlSchemeTask));
- if (handledRequest) {
- anyPluginsResponded = YES;
- break;
- }
- }
- }
-
- if (!anyPluginsResponded) {
- if ([scheme isEqualToString:self.viewController.appScheme]) {
- if ([stringToLoad hasPrefix:@"/_app_file_"]) {
- startPath = [stringToLoad stringByReplacingOccurrencesOfString:@"/_app_file_" withString:@""];
- } else {
- if ([stringToLoad isEqualToString:@""] || [url.pathExtension isEqualToString:@""]) {
- startPath = [startPath stringByAppendingPathComponent:self.viewController.startPage];
- } else {
- startPath = [startPath stringByAppendingPathComponent:stringToLoad];
- }
- }
- }
-
- NSError * fileError = nil;
- NSData * data = nil;
- if ([self isMediaExtension:url.pathExtension]) {
- data = [NSData dataWithContentsOfFile:startPath options:NSDataReadingMappedIfSafe error:&fileError];
- }
- if (!data || fileError) {
- data = [[NSData alloc] initWithContentsOfFile:startPath];
- }
- NSInteger statusCode = 200;
- if (!data) {
- statusCode = 404;
- }
- NSURL * localUrl = [NSURL URLWithString:url.absoluteString];
- NSString * mimeType = [self getMimeType:url.pathExtension];
- id response = nil;
- if (data && [self isMediaExtension:url.pathExtension]) {
- response = [[NSURLResponse alloc] initWithURL:localUrl MIMEType:mimeType expectedContentLength:data.length textEncodingName:nil];
- } else {
- NSDictionary * headers = @{ @"Content-Type" : mimeType, @"Cache-Control": @"no-cache"};
- response = [[NSHTTPURLResponse alloc] initWithURL:localUrl statusCode:statusCode HTTPVersion:nil headerFields:headers];
- }
-
- [urlSchemeTask didReceiveResponse:response];
- if (data) {
- [urlSchemeTask didReceiveData:data];
- }
- [urlSchemeTask didFinish];
- }
-}
-
-- (void)webView:(nonnull WKWebView *)webView stopURLSchemeTask:(nonnull id<WKURLSchemeTask>)urlSchemeTask
-{
- SEL selector = NSSelectorFromString(@"stopSchemeTask:");
- if (self.schemePlugin != nil && [self.schemePlugin respondsToSelector:selector]) {
- (((void (*)(id, SEL, id <WKURLSchemeTask>))objc_msgSend)(self.schemePlugin, selector, urlSchemeTask));
- }
-}
-
--(NSString *) getMimeType:(NSString *)fileExtension {
- if (fileExtension && ![fileExtension isEqualToString:@""]) {
- NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)fileExtension, NULL);
- NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType);
- return contentType ? contentType : @"application/octet-stream";
- } else {
- return @"text/html";
- }
-}
-
--(BOOL) isMediaExtension:(NSString *) pathExtension {
- NSArray * mediaExtensions = @[@"m4v", @"mov", @"mp4",
- @"aac", @"ac3", @"aiff", @"au", @"flac", @"m4a", @"mp3", @"wav"];
- if ([mediaExtensions containsObject:pathExtension.lowercaseString]) {
- return YES;
- }
- return NO;
-}
-
-
-@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h
deleted file mode 100644
index 81c7128f1..000000000
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <UIKit/UIKit.h>
-#import <Foundation/NSJSONSerialization.h>
-#import "CDVAvailability.h"
-#import "CDVInvokedUrlCommand.h"
-#import "CDVCommandDelegate.h"
-#import "CDVCommandQueue.h"
-#import "CDVScreenOrientationDelegate.h"
-#import "CDVPlugin.h"
-#import "CDVWebViewEngineProtocol.h"
-
-@interface CDVViewController : UIViewController <CDVScreenOrientationDelegate>{
- @protected
- id <CDVWebViewEngineProtocol> _webViewEngine;
- @protected
- id <CDVCommandDelegate> _commandDelegate;
- @protected
- CDVCommandQueue* _commandQueue;
-}
-
-@property (nonatomic, readonly, weak) IBOutlet UIView* webView;
-@property (nonatomic, readonly, strong) UIView* launchView;
-
-@property (nonatomic, readonly, strong) NSMutableDictionary* pluginObjects;
-@property (nonatomic, readonly, strong) NSDictionary* pluginsMap;
-@property (nonatomic, readonly, strong) NSMutableDictionary* settings;
-@property (nonatomic, readonly, strong) NSXMLParser* configParser;
-
-@property (nonatomic, readwrite, copy) NSString* appScheme;
-@property (nonatomic, readwrite, copy) NSString* configFile;
-@property (nonatomic, readwrite, copy) NSString* wwwFolderName;
-@property (nonatomic, readwrite, copy) NSString* startPage;
-@property (nonatomic, readonly, strong) CDVCommandQueue* commandQueue;
-@property (nonatomic, readonly, strong) id <CDVWebViewEngineProtocol> webViewEngine;
-@property (nonatomic, readonly, strong) id <CDVCommandDelegate> commandDelegate;
-
-/**
- Takes/Gives an array of UIInterfaceOrientation (int) objects
- ex. UIInterfaceOrientationPortrait
-*/
-@property (nonatomic, readwrite, strong) NSArray* supportedOrientations;
-
-- (UIView*)newCordovaViewWithFrame:(CGRect)bounds;
-
-- (NSString*)appURLScheme;
-- (NSURL*)errorURL;
-
-- (UIColor*)colorFromColorString:(NSString*)colorString CDV_DEPRECATED(7.0.0, "Use BackgroundColor in xcassets");
-- (NSArray*)parseInterfaceOrientations:(NSArray*)orientations;
-- (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation;
-
-- (id)getCommandInstance:(NSString*)pluginName;
-- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className;
-- (void)registerPlugin:(CDVPlugin*)plugin withPluginName:(NSString*)pluginName;
-
-- (void)parseSettingsWithParser:(NSObject <NSXMLParserDelegate>*)delegate;
-
-- (void)showLaunchScreen:(BOOL)visible;
-
-@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m b/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m
deleted file mode 100644
index dcec9589e..000000000
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m
+++ /dev/null
@@ -1,819 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <objc/message.h>
-#import "CDV.h"
-#import "CDVPlugin+Private.h"
-#import "CDVWebViewUIDelegate.h"
-#import "CDVConfigParser.h"
-#import <AVFoundation/AVFoundation.h>
-#import "NSDictionary+CordovaPreferences.h"
-#import "CDVCommandDelegateImpl.h"
-#import <Foundation/NSCharacterSet.h>
-
-@interface CDVViewController () { }
-
-@property (nonatomic, readwrite, strong) NSXMLParser* configParser;
-@property (nonatomic, readwrite, strong) NSMutableDictionary* settings;
-@property (nonatomic, readwrite, strong) NSMutableDictionary* pluginObjects;
-@property (nonatomic, readwrite, strong) NSMutableArray* startupPluginNames;
-@property (nonatomic, readwrite, strong) NSDictionary* pluginsMap;
-@property (nonatomic, readwrite, strong) id <CDVWebViewEngineProtocol> webViewEngine;
-@property (nonatomic, readwrite, strong) UIView* launchView;
-
-@property (readwrite, assign) BOOL initialized;
-
-@property (atomic, strong) NSURL* openURL;
-
-@end
-
-@implementation CDVViewController
-
-@synthesize supportedOrientations;
-@synthesize pluginObjects, pluginsMap, startupPluginNames;
-@synthesize configParser, settings;
-@synthesize wwwFolderName, startPage, initialized, openURL;
-@synthesize commandDelegate = _commandDelegate;
-@synthesize commandQueue = _commandQueue;
-@synthesize webViewEngine = _webViewEngine;
-@dynamic webView;
-
-- (void)__init
-{
- if ((self != nil) && !self.initialized) {
- _commandQueue = [[CDVCommandQueue alloc] initWithViewController:self];
- _commandDelegate = [[CDVCommandDelegateImpl alloc] initWithViewController:self];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillTerminate:)
- name:UIApplicationWillTerminateNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillResignActive:)
- name:UIApplicationWillResignActiveNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidBecomeActive:)
- name:UIApplicationDidBecomeActiveNotification object:nil];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillEnterForeground:)
- name:UIApplicationWillEnterForegroundNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidEnterBackground:)
- name:UIApplicationDidEnterBackgroundNotification object:nil];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onWebViewPageDidLoad:)
- name:CDVPageDidLoadNotification object:nil];
-
- // read from UISupportedInterfaceOrientations (or UISupportedInterfaceOrientations~iPad, if its iPad) from -Info.plist
- self.supportedOrientations = [self parseInterfaceOrientations:
- [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"]];
-
- [self printVersion];
- [self printMultitaskingInfo];
- [self printPlatformVersionWarning];
- self.initialized = YES;
- }
-}
-
-- (id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
-{
- self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
- [self __init];
- return self;
-}
-
-- (id)initWithCoder:(NSCoder*)aDecoder
-{
- self = [super initWithCoder:aDecoder];
- [self __init];
- return self;
-}
-
-- (id)init
-{
- self = [super init];
- [self __init];
- return self;
-}
-
-- (void)printVersion
-{
- NSLog(@"Apache Cordova native platform version %@ is starting.", CDV_VERSION);
-}
-
-- (void)printPlatformVersionWarning
-{
- if (!IsAtLeastiOSVersion(@"8.0")) {
- NSLog(@"CRITICAL: For Cordova 4.0.0 and above, you will need to upgrade to at least iOS 8.0 or greater. Your current version of iOS is %@.",
- [[UIDevice currentDevice] systemVersion]
- );
- }
-}
-
-- (void)printMultitaskingInfo
-{
- UIDevice* device = [UIDevice currentDevice];
- BOOL backgroundSupported = NO;
-
- if ([device respondsToSelector:@selector(isMultitaskingSupported)]) {
- backgroundSupported = device.multitaskingSupported;
- }
-
- NSNumber* exitsOnSuspend = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIApplicationExitsOnSuspend"];
- if (exitsOnSuspend == nil) { // if it's missing, it should be NO (i.e. multi-tasking on by default)
- exitsOnSuspend = [NSNumber numberWithBool:NO];
- }
-
- NSLog(@"Multi-tasking -> Device: %@, App: %@", (backgroundSupported ? @"YES" : @"NO"), (![exitsOnSuspend intValue]) ? @"YES" : @"NO");
-}
-
--(NSString*)configFilePath{
- NSString* path = self.configFile ?: @"config.xml";
-
- // if path is relative, resolve it against the main bundle
- if(![path isAbsolutePath]){
- NSString* absolutePath = [[NSBundle mainBundle] pathForResource:path ofType:nil];
- if(!absolutePath){
- NSAssert(NO, @"ERROR: %@ not found in the main bundle!", path);
- }
- path = absolutePath;
- }
-
- // Assert file exists
- if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
- NSAssert(NO, @"ERROR: %@ does not exist. Please run cordova-ios/bin/cordova_plist_to_config_xml path/to/project.", path);
- return nil;
- }
-
- return path;
-}
-
-- (void)parseSettingsWithParser:(NSObject <NSXMLParserDelegate>*)delegate
-{
- // read from config.xml in the app bundle
- NSString* path = [self configFilePath];
-
- NSURL* url = [NSURL fileURLWithPath:path];
-
- self.configParser = [[NSXMLParser alloc] initWithContentsOfURL:url];
- if (self.configParser == nil) {
- NSLog(@"Failed to initialize XML parser.");
- return;
- }
- [self.configParser setDelegate:((id < NSXMLParserDelegate >)delegate)];
- [self.configParser parse];
-}
-
-- (void)loadSettings
-{
- CDVConfigParser* delegate = [[CDVConfigParser alloc] init];
-
- [self parseSettingsWithParser:delegate];
-
- // Get the plugin dictionary, whitelist and settings from the delegate.
- self.pluginsMap = delegate.pluginsDict;
- self.startupPluginNames = delegate.startupPluginNames;
- self.settings = delegate.settings;
-
- // And the start folder/page.
- if(self.wwwFolderName == nil){
- self.wwwFolderName = @"www";
- }
- if(delegate.startPage && self.startPage == nil){
- self.startPage = delegate.startPage;
- }
- if (self.startPage == nil) {
- self.startPage = @"index.html";
- }
-
- // Initialize the plugin objects dict.
- self.pluginObjects = [[NSMutableDictionary alloc] initWithCapacity:20];
-}
-
-- (NSURL*)appUrl
-{
- NSURL* appURL = nil;
-
- if ([self.startPage rangeOfString:@"://"].location != NSNotFound) {
- appURL = [NSURL URLWithString:self.startPage];
- } else if ([self.wwwFolderName rangeOfString:@"://"].location != NSNotFound) {
- appURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", self.wwwFolderName, self.startPage]];
- } else if([self.wwwFolderName rangeOfString:@".bundle"].location != NSNotFound){
- // www folder is actually a bundle
- NSBundle* bundle = [NSBundle bundleWithPath:self.wwwFolderName];
- appURL = [bundle URLForResource:self.startPage withExtension:nil];
- } else if([self.wwwFolderName rangeOfString:@".framework"].location != NSNotFound){
- // www folder is actually a framework
- NSBundle* bundle = [NSBundle bundleWithPath:self.wwwFolderName];
- appURL = [bundle URLForResource:self.startPage withExtension:nil];
- } else {
- // CB-3005 strip parameters from start page to check if page exists in resources
- NSURL* startURL = [NSURL URLWithString:self.startPage];
- NSString* startFilePath = [self.commandDelegate pathForResource:[startURL path]];
-
- if (startFilePath == nil) {
- appURL = nil;
- } else {
- appURL = [NSURL fileURLWithPath:startFilePath];
- // CB-3005 Add on the query params or fragment.
- NSString* startPageNoParentDirs = self.startPage;
- NSRange r = [startPageNoParentDirs rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"?#"] options:0];
- if (r.location != NSNotFound) {
- NSString* queryAndOrFragment = [self.startPage substringFromIndex:r.location];
- appURL = [NSURL URLWithString:queryAndOrFragment relativeToURL:appURL];
- }
- }
- }
-
- return appURL;
-}
-
-- (NSURL*)errorURL
-{
- NSURL* errorUrl = nil;
-
- id setting = [self.settings cordovaSettingForKey:@"ErrorUrl"];
-
- if (setting) {
- NSString* errorUrlString = (NSString*)setting;
- if ([errorUrlString rangeOfString:@"://"].location != NSNotFound) {
- errorUrl = [NSURL URLWithString:errorUrlString];
- } else {
- NSURL* url = [NSURL URLWithString:(NSString*)setting];
- NSString* errorFilePath = [self.commandDelegate pathForResource:[url path]];
- if (errorFilePath) {
- errorUrl = [NSURL fileURLWithPath:errorFilePath];
- }
- }
- }
-
- return errorUrl;
-}
-
-- (UIView*)webView
-{
- if (self.webViewEngine != nil) {
- return self.webViewEngine.engineWebView;
- }
-
- return nil;
-}
-
-// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
-- (void)viewDidLoad
-{
- [super viewDidLoad];
-
- // Load settings
- [self loadSettings];
-
- NSString* backupWebStorageType = @"cloud"; // default value
-
- id backupWebStorage = [self.settings cordovaSettingForKey:@"BackupWebStorage"];
- if ([backupWebStorage isKindOfClass:[NSString class]]) {
- backupWebStorageType = backupWebStorage;
- }
- [self.settings setCordovaSetting:backupWebStorageType forKey:@"BackupWebStorage"];
-
- // // Instantiate the Launch screen /////////
-
- if (!self.launchView) {
- [self createLaunchView];
- }
-
- // // Instantiate the WebView ///////////////
-
- if (!self.webView) {
- [self createGapView];
- }
-
- // /////////////////
-
- if ([self.startupPluginNames count] > 0) {
- [CDVTimer start:@"TotalPluginStartup"];
-
- for (NSString* pluginName in self.startupPluginNames) {
- [CDVTimer start:pluginName];
- [self getCommandInstance:pluginName];
- [CDVTimer stop:pluginName];
- }
-
- [CDVTimer stop:@"TotalPluginStartup"];
- }
-
- // /////////////////
- NSURL* appURL = [self appUrl];
-
- if (appURL) {
- NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
- [self.webViewEngine loadRequest:appReq];
- } else {
- NSString* loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.wwwFolderName, self.startPage];
- NSLog(@"%@", loadErr);
-
- NSURL* errorUrl = [self errorURL];
- if (errorUrl) {
- errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [loadErr stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl];
- NSLog(@"%@", [errorUrl absoluteString]);
- [self.webViewEngine loadRequest:[NSURLRequest requestWithURL:errorUrl]];
- } else {
- NSString* html = [NSString stringWithFormat:@"<html><body> %@ </body></html>", loadErr];
- [self.webViewEngine loadHTMLString:html baseURL:nil];
- }
- }
- // /////////////////
-
- UIColor* bgColor = [UIColor colorNamed:@"BackgroundColor"] ?: UIColor.whiteColor;
- [self.launchView setBackgroundColor:bgColor];
- [self.webView setBackgroundColor:bgColor];
-}
-
--(void)viewWillAppear:(BOOL)animated
-{
- [super viewWillAppear:animated];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillAppearNotification object:nil]];
-}
-
--(void)viewDidAppear:(BOOL)animated
-{
- [super viewDidAppear:animated];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidAppearNotification object:nil]];
-}
-
--(void)viewWillDisappear:(BOOL)animated
-{
- [super viewWillDisappear:animated];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillDisappearNotification object:nil]];
-}
-
--(void)viewDidDisappear:(BOOL)animated
-{
- [super viewDidDisappear:animated];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidDisappearNotification object:nil]];
-}
-
--(void)viewWillLayoutSubviews
-{
- [super viewWillLayoutSubviews];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillLayoutSubviewsNotification object:nil]];
-}
-
--(void)viewDidLayoutSubviews
-{
- [super viewDidLayoutSubviews];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidLayoutSubviewsNotification object:nil]];
-}
-
--(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
-{
- [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillTransitionToSizeNotification object:[NSValue valueWithCGSize:size]]];
-}
-
-- (UIColor*)colorFromColorString:(NSString*)colorString
-{
- // No value, nothing to do
- if (!colorString) {
- return nil;
- }
-
- // Validate format
- NSError* error = NULL;
- NSRegularExpression* regex = [NSRegularExpression regularExpressionWithPattern:@"^(#[0-9A-F]{3}|(0x|#)([0-9A-F]{2})?[0-9A-F]{6})$" options:NSRegularExpressionCaseInsensitive error:&error];
- NSUInteger countMatches = [regex numberOfMatchesInString:colorString options:0 range:NSMakeRange(0, [colorString length])];
-
- if (!countMatches) {
- return nil;
- }
-
- // #FAB to #FFAABB
- if ([colorString hasPrefix:@"#"] && [colorString length] == 4) {
- NSString* r = [colorString substringWithRange:NSMakeRange(1, 1)];
- NSString* g = [colorString substringWithRange:NSMakeRange(2, 1)];
- NSString* b = [colorString substringWithRange:NSMakeRange(3, 1)];
- colorString = [NSString stringWithFormat:@"#%@%@%@%@%@%@", r, r, g, g, b, b];
- }
-
- // #RRGGBB to 0xRRGGBB
- colorString = [colorString stringByReplacingOccurrencesOfString:@"#" withString:@"0x"];
-
- // 0xRRGGBB to 0xAARRGGBB
- if ([colorString hasPrefix:@"0x"] && [colorString length] == 8) {
- colorString = [@"0xFF" stringByAppendingString:[colorString substringFromIndex:2]];
- }
-
- // 0xAARRGGBB to int
- unsigned colorValue = 0;
- NSScanner *scanner = [NSScanner scannerWithString:colorString];
- if (![scanner scanHexInt:&colorValue]) {
- return nil;
- }
-
- // int to UIColor
- return [UIColor colorWithRed:((float)((colorValue & 0x00FF0000) >> 16))/255.0
- green:((float)((colorValue & 0x0000FF00) >> 8))/255.0
- blue:((float)((colorValue & 0x000000FF) >> 0))/255.0
- alpha:((float)((colorValue & 0xFF000000) >> 24))/255.0];
-}
-
-- (NSArray*)parseInterfaceOrientations:(NSArray*)orientations
-{
- NSMutableArray* result = [[NSMutableArray alloc] init];
-
- if (orientations != nil) {
- NSEnumerator* enumerator = [orientations objectEnumerator];
- NSString* orientationString;
-
- while (orientationString = [enumerator nextObject]) {
- if ([orientationString isEqualToString:@"UIInterfaceOrientationPortrait"]) {
- [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationPortrait]];
- } else if ([orientationString isEqualToString:@"UIInterfaceOrientationPortraitUpsideDown"]) {
- [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationPortraitUpsideDown]];
- } else if ([orientationString isEqualToString:@"UIInterfaceOrientationLandscapeLeft"]) {
- [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft]];
- } else if ([orientationString isEqualToString:@"UIInterfaceOrientationLandscapeRight"]) {
- [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight]];
- }
- }
- }
-
- // default
- if ([result count] == 0) {
- [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationPortrait]];
- }
-
- return result;
-}
-
-- (BOOL)shouldAutorotate
-{
- return YES;
-}
-
-- (UIInterfaceOrientationMask)supportedInterfaceOrientations
-{
- NSUInteger ret = 0;
-
- if ([self supportsOrientation:UIInterfaceOrientationPortrait]) {
- ret = ret | (1 << UIInterfaceOrientationPortrait);
- }
- if ([self supportsOrientation:UIInterfaceOrientationPortraitUpsideDown]) {
- ret = ret | (1 << UIInterfaceOrientationPortraitUpsideDown);
- }
- if ([self supportsOrientation:UIInterfaceOrientationLandscapeRight]) {
- ret = ret | (1 << UIInterfaceOrientationLandscapeRight);
- }
- if ([self supportsOrientation:UIInterfaceOrientationLandscapeLeft]) {
- ret = ret | (1 << UIInterfaceOrientationLandscapeLeft);
- }
-
- return ret;
-}
-
-- (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation
-{
- return [self.supportedOrientations containsObject:@(orientation)];
-}
-
-- (UIView*)newCordovaViewWithFrame:(CGRect)bounds
-{
- NSString* defaultWebViewEngineClass = [self.settings cordovaSettingForKey:@"CordovaDefaultWebViewEngine"];
- NSString* webViewEngineClass = [self.settings cordovaSettingForKey:@"CordovaWebViewEngine"];
-
- if (!defaultWebViewEngineClass) {
- defaultWebViewEngineClass = @"CDVWebViewEngine";
- }
- if (!webViewEngineClass) {
- webViewEngineClass = defaultWebViewEngineClass;
- }
-
- // Find webViewEngine
- if (NSClassFromString(webViewEngineClass)) {
- self.webViewEngine = [[NSClassFromString(webViewEngineClass) alloc] initWithFrame:bounds];
- // if a webView engine returns nil (not supported by the current iOS version) or doesn't conform to the protocol, or can't load the request, we use WKWebView
- if (!self.webViewEngine || ![self.webViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)] || ![self.webViewEngine canLoadRequest:[NSURLRequest requestWithURL:self.appUrl]]) {
- self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds];
- }
- } else {
- self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds];
- }
-
- if ([self.webViewEngine isKindOfClass:[CDVPlugin class]]) {
- [self registerPlugin:(CDVPlugin*)self.webViewEngine withClassName:webViewEngineClass];
- }
-
- return self.webViewEngine.engineWebView;
-}
-
-- (void)createLaunchView
-{
- CGRect webViewBounds = self.view.bounds;
- webViewBounds.origin = self.view.bounds.origin;
-
- UIView* view = [[UIView alloc] initWithFrame:webViewBounds];
- [view setAlpha:0];
-
- NSString* launchStoryboardName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
- if (launchStoryboardName != nil) {
- UIStoryboard* storyboard = [UIStoryboard storyboardWithName:launchStoryboardName bundle:[NSBundle mainBundle]];
- UIViewController* vc = [storyboard instantiateInitialViewController];
-
- [view addSubview:vc.view];
- }
-
- self.launchView = view;
- [self.view addSubview:view];
-}
-
-- (void)createGapView
-{
- CGRect webViewBounds = self.view.bounds;
- webViewBounds.origin = self.view.bounds.origin;
-
- UIView* view = [self newCordovaViewWithFrame:webViewBounds];
- view.hidden = YES;
- view.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
-
- [self.view addSubview:view];
- [self.view sendSubviewToBack:view];
-}
-
-- (void)didReceiveMemoryWarning
-{
- // iterate through all the plugin objects, and call hasPendingOperation
- // if at least one has a pending operation, we don't call [super didReceiveMemoryWarning]
-
- NSEnumerator* enumerator = [self.pluginObjects objectEnumerator];
- CDVPlugin* plugin;
-
- BOOL doPurge = YES;
-
- while ((plugin = [enumerator nextObject])) {
- if (plugin.hasPendingOperation) {
- NSLog(@"Plugin '%@' has a pending operation, memory purge is delayed for didReceiveMemoryWarning.", NSStringFromClass([plugin class]));
- doPurge = NO;
- }
- }
-
- if (doPurge) {
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
- }
-
- // Release any cached data, images, etc. that aren't in use.
-}
-
-#pragma mark CordovaCommands
-
-- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className
-{
- if ([plugin respondsToSelector:@selector(setViewController:)]) {
- [plugin setViewController:self];
- }
-
- if ([plugin respondsToSelector:@selector(setCommandDelegate:)]) {
- [plugin setCommandDelegate:_commandDelegate];
- }
-
- [self.pluginObjects setObject:plugin forKey:className];
- [plugin pluginInitialize];
-}
-
-- (void)registerPlugin:(CDVPlugin*)plugin withPluginName:(NSString*)pluginName
-{
- if ([plugin respondsToSelector:@selector(setViewController:)]) {
- [plugin setViewController:self];
- }
-
- if ([plugin respondsToSelector:@selector(setCommandDelegate:)]) {
- [plugin setCommandDelegate:_commandDelegate];
- }
-
- NSString* className = NSStringFromClass([plugin class]);
- [self.pluginObjects setObject:plugin forKey:className];
- [self.pluginsMap setValue:className forKey:[pluginName lowercaseString]];
- [plugin pluginInitialize];
-}
-
-/**
- Returns an instance of a CordovaCommand object, based on its name. If one exists already, it is returned.
- */
-- (id)getCommandInstance:(NSString*)pluginName
-{
- // first, we try to find the pluginName in the pluginsMap
- // (acts as a whitelist as well) if it does not exist, we return nil
- // NOTE: plugin names are matched as lowercase to avoid problems - however, a
- // possible issue is there can be duplicates possible if you had:
- // "org.apache.cordova.Foo" and "org.apache.cordova.foo" - only the lower-cased entry will match
- NSString* className = [self.pluginsMap objectForKey:[pluginName lowercaseString]];
-
- if (className == nil) {
- return nil;
- }
-
- id obj = [self.pluginObjects objectForKey:className];
- if (!obj) {
- obj = [[NSClassFromString(className)alloc] initWithWebViewEngine:_webViewEngine];
- if (!obj) {
- NSString* fullClassName = [NSString stringWithFormat:@"%@.%@",
- NSBundle.mainBundle.infoDictionary[@"CFBundleExecutable"],
- className];
- obj = [[NSClassFromString(fullClassName)alloc] initWithWebViewEngine:_webViewEngine];
- }
-
- if (obj != nil) {
- [self registerPlugin:obj withClassName:className];
- } else {
- NSLog(@"CDVPlugin class %@ (pluginName: %@) does not exist.", className, pluginName);
- }
- }
- return obj;
-}
-
-#pragma mark -
-
-- (NSString*)appURLScheme
-{
- NSString* URLScheme = nil;
-
- NSArray* URLTypes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleURLTypes"];
-
- if (URLTypes != nil) {
- NSDictionary* dict = [URLTypes objectAtIndex:0];
- if (dict != nil) {
- NSArray* URLSchemes = [dict objectForKey:@"CFBundleURLSchemes"];
- if (URLSchemes != nil) {
- URLScheme = [URLSchemes objectAtIndex:0];
- }
- }
- }
-
- return URLScheme;
-}
-
-#pragma mark -
-#pragma mark UIApplicationDelegate impl
-
-/*
- This method lets your application know that it is about to be terminated and purged from memory entirely
- */
-- (void)onAppWillTerminate:(NSNotification*)notification
-{
- // empty the tmp directory
- NSFileManager* fileMgr = [[NSFileManager alloc] init];
- NSError* __autoreleasing err = nil;
-
- // clear contents of NSTemporaryDirectory
- NSString* tempDirectoryPath = NSTemporaryDirectory();
- NSDirectoryEnumerator* directoryEnumerator = [fileMgr enumeratorAtPath:tempDirectoryPath];
- NSString* fileName = nil;
- BOOL result;
-
- while ((fileName = [directoryEnumerator nextObject])) {
- NSString* filePath = [tempDirectoryPath stringByAppendingPathComponent:fileName];
- result = [fileMgr removeItemAtPath:filePath error:&err];
- if (!result && err) {
- NSLog(@"Failed to delete: %@ (error: %@)", filePath, err);
- }
- }
-}
-
-- (bool)isUrlEmpty:(NSURL *)url
-{
- if (!url || (url == (id) [NSNull null])) {
- return true;
- }
- NSString *urlAsString = [url absoluteString];
- return (urlAsString == (id) [NSNull null] || [urlAsString length]==0 || [urlAsString isEqualToString:@"about:blank"]);
-}
-
-- (bool)checkAndReinitViewUrl
-{
- NSURL* appURL = [self appUrl];
- if ([self isUrlEmpty: [self.webViewEngine URL]] && ![self isUrlEmpty: appURL]) {
- NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
- [self.webViewEngine loadRequest:appReq];
- return true;
- }
- return false;
-}
-
-/*
- This method is called to let your application know that it is about to move from the active to inactive state.
- You should use this method to pause ongoing tasks, disable timer, ...
- */
-- (void)onAppWillResignActive:(NSNotification*)notification
-{
- [self checkAndReinitViewUrl];
- // NSLog(@"%@",@"applicationWillResignActive");
- [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('resign');" scheduledOnRunLoop:NO];
-}
-
-/*
- In iOS 4.0 and later, this method is called as part of the transition from the background to the inactive state.
- You can use this method to undo many of the changes you made to your application upon entering the background.
- invariably followed by applicationDidBecomeActive
- */
-- (void)onAppWillEnterForeground:(NSNotification*)notification
-{
- [self checkAndReinitViewUrl];
- // NSLog(@"%@",@"applicationWillEnterForeground");
- [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('resume');"];
-
- if (!IsAtLeastiOSVersion(@"11.0")) {
- /** Clipboard fix **/
- UIPasteboard* pasteboard = [UIPasteboard generalPasteboard];
- NSString* string = pasteboard.string;
- if (string) {
- [pasteboard setValue:string forPasteboardType:@"public.text"];
- }
- }
-}
-
-// This method is called to let your application know that it moved from the inactive to active state.
-- (void)onAppDidBecomeActive:(NSNotification*)notification
-{
- [self checkAndReinitViewUrl];
- // NSLog(@"%@",@"applicationDidBecomeActive");
- [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('active');"];
-}
-
-/*
- In iOS 4.0 and later, this method is called instead of the applicationWillTerminate: method
- when the user quits an application that supports background execution.
- */
-- (void)onAppDidEnterBackground:(NSNotification*)notification
-{
- [self checkAndReinitViewUrl];
- // NSLog(@"%@",@"applicationDidEnterBackground");
- [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('pause', null, true);" scheduledOnRunLoop:NO];
-}
-
-/**
- Show the webview and fade out the intermediary view
- This is to prevent the flashing of the mainViewController
- */
-- (void)onWebViewPageDidLoad:(NSNotification*)notification
-{
- self.webView.hidden = NO;
-
- if ([self.settings cordovaBoolSettingForKey:@"AutoHideSplashScreen" defaultValue:YES]) {
- CGFloat splashScreenDelaySetting = [self.settings cordovaFloatSettingForKey:@"SplashScreenDelay" defaultValue:0];
-
- if (splashScreenDelaySetting == 0) {
- [self showLaunchScreen:NO];
- } else {
- // Divide by 1000 because config returns milliseconds and NSTimer takes seconds
- CGFloat splashScreenDelay = splashScreenDelaySetting / 1000;
-
- [NSTimer scheduledTimerWithTimeInterval:splashScreenDelay repeats:NO block:^(NSTimer * _Nonnull timer) {
- [self showLaunchScreen:NO];
- }];
- }
- }
-}
-
-/**
- Method to be called from the plugin JavaScript to show or hide the launch screen.
- */
-- (void)showLaunchScreen:(BOOL)visible
-{
- CGFloat fadeSplashScreenDuration = [self.settings cordovaFloatSettingForKey:@"FadeSplashScreenDuration" defaultValue:250];
-
- // Setting minimum value for fade to 0.25 seconds
- fadeSplashScreenDuration = fadeSplashScreenDuration < 250 ? 250 : fadeSplashScreenDuration;
-
- // AnimateWithDuration takes seconds but cordova documentation specifies milliseconds
- CGFloat fadeDuration = fadeSplashScreenDuration/1000;
-
- [UIView animateWithDuration:fadeDuration animations:^{
- [self.launchView setAlpha:(visible ? 1 : 0)];
- }];
-}
-
-// ///////////////////////
-
-- (void)dealloc
-{
- [[NSNotificationCenter defaultCenter] removeObserver:self];
-
- [_commandQueue dispose];
- [[self.pluginObjects allValues] makeObjectsPerformSelector:@selector(dispose)];
-
- [self.webViewEngine loadHTMLString:@"about:blank" baseURL:nil];
- [self.pluginObjects removeAllObjects];
- [self.webView removeFromSuperview];
- self.webViewEngine = nil;
-}
-
-@end
diff --git a/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist b/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist
deleted file mode 100644
index e3071f032..000000000
--- a/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/sytolk.xcuserdatad/xcschemes/xcschememanagement.plist
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>SchemeUserState</key>
- <dict>
- <key>Cordova.xcscheme_^#shared#^_</key>
- <dict>
- <key>orderHint</key>
- <integer>1</integer>
- </dict>
- <key>CordovaLib.xcscheme_^#shared#^_</key>
- <dict>
- <key>orderHint</key>
- <integer>2</integer>
- </dict>
- </dict>
-</dict>
-</plist>
diff --git a/cordova/platforms/ios/CordovaLib/VERSION b/cordova/platforms/ios/CordovaLib/VERSION
deleted file mode 100644
index 6abaeb2f9..000000000
--- a/cordova/platforms/ios/CordovaLib/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-6.2.0
diff --git a/cordova/platforms/ios/CordovaLib/cordova.js b/cordova/platforms/ios/CordovaLib/cordova.js
deleted file mode 100644
index 37f329f54..000000000
--- a/cordova/platforms/ios/CordovaLib/cordova.js
+++ /dev/null
@@ -1,2104 +0,0 @@
-// Platform: ios
-// cordova-js rel/6.0.0-10-g07379820
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '6.2.0';
-// file: src/scripts/require.js
-var require;
-var define;
-
-(function () {
- var modules = {};
- // Stack of moduleIds currently being built.
- var requireStack = [];
- // Map of module ID -> index into requireStack of modules currently being built.
- var inProgressModules = {};
- var SEPARATOR = '.';
-
- function build (module) {
- var factory = module.factory;
- var localRequire = function (id) {
- var resultantId = id;
- // Its a relative path, so lop off the last portion and add the id (minus "./")
- if (id.charAt(0) === '.') {
- resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2);
- }
- return require(resultantId);
- };
- module.exports = {};
- delete module.factory;
- factory(localRequire, module.exports, module);
- return module.exports;
- }
-
- require = function (id) {
- if (!modules[id]) {
- throw new Error('module ' + id + ' not found');
- } else if (id in inProgressModules) {
- var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id;
- throw new Error('Cycle in require graph: ' + cycle);
- }
- if (modules[id].factory) {
- try {
- inProgressModules[id] = requireStack.length;
- requireStack.push(id);
- return build(modules[id]);
- } finally {
- delete inProgressModules[id];
- requireStack.pop();
- }
- }
- return modules[id].exports;
- };
-
- define = function (id, factory) {
- if (Object.prototype.hasOwnProperty.call(modules, id)) {
- throw new Error('module ' + id + ' already defined');
- }
-
- modules[id] = {
- id: id,
- factory: factory
- };
- };
-
- define.remove = function (id) {
- delete modules[id];
- };
-
- define.moduleMap = modules;
-})();
-
-// Export for use in node
-if (typeof module === 'object' && typeof require === 'function') {
- module.exports.require = require;
- module.exports.define = define;
-}
-
-// file: src/cordova.js
-define("cordova", function(require, exports, module) {
-
-// Workaround for Windows 10 in hosted environment case
-// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object
-if (window.cordova && !(window.cordova instanceof HTMLElement)) {
- throw new Error('cordova already defined');
-}
-
-var channel = require('cordova/channel');
-var platform = require('cordova/platform');
-
-/**
- * Intercept calls to addEventListener + removeEventListener and handle deviceready,
- * resume, and pause events.
- */
-var m_document_addEventListener = document.addEventListener;
-var m_document_removeEventListener = document.removeEventListener;
-var m_window_addEventListener = window.addEventListener;
-var m_window_removeEventListener = window.removeEventListener;
-
-/**
- * Houses custom event handlers to intercept on document + window event listeners.
- */
-var documentEventHandlers = {};
-var windowEventHandlers = {};
-
-document.addEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- if (typeof documentEventHandlers[e] !== 'undefined') {
- documentEventHandlers[e].subscribe(handler);
- } else {
- m_document_addEventListener.call(document, evt, handler, capture);
- }
-};
-
-window.addEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- if (typeof windowEventHandlers[e] !== 'undefined') {
- windowEventHandlers[e].subscribe(handler);
- } else {
- m_window_addEventListener.call(window, evt, handler, capture);
- }
-};
-
-document.removeEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- // If unsubscribing from an event that is handled by a plugin
- if (typeof documentEventHandlers[e] !== 'undefined') {
- documentEventHandlers[e].unsubscribe(handler);
- } else {
- m_document_removeEventListener.call(document, evt, handler, capture);
- }
-};
-
-window.removeEventListener = function (evt, handler, capture) {
- var e = evt.toLowerCase();
- // If unsubscribing from an event that is handled by a plugin
- if (typeof windowEventHandlers[e] !== 'undefined') {
- windowEventHandlers[e].unsubscribe(handler);
- } else {
- m_window_removeEventListener.call(window, evt, handler, capture);
- }
-};
-
-function createEvent (type, data) {
- var event = document.createEvent('Events');
- event.initEvent(type, false, false);
- if (data) {
- for (var i in data) {
- if (Object.prototype.hasOwnProperty.call(data, i)) {
- event[i] = data[i];
- }
- }
- }
- return event;
-}
-
-var cordova = {
- define: define,
- require: require,
- version: PLATFORM_VERSION_BUILD_LABEL,
- platformVersion: PLATFORM_VERSION_BUILD_LABEL,
- platformId: platform.id,
-
- /**
- * Methods to add/remove your own addEventListener hijacking on document + window.
- */
- addWindowEventHandler: function (event) {
- return (windowEventHandlers[event] = channel.create(event));
- },
- addStickyDocumentEventHandler: function (event) {
- return (documentEventHandlers[event] = channel.createSticky(event));
- },
- addDocumentEventHandler: function (event) {
- return (documentEventHandlers[event] = channel.create(event));
- },
- removeWindowEventHandler: function (event) {
- delete windowEventHandlers[event];
- },
- removeDocumentEventHandler: function (event) {
- delete documentEventHandlers[event];
- },
-
- /**
- * Retrieve original event handlers that were replaced by Cordova
- *
- * @return object
- */
- getOriginalHandlers: function () {
- return {
- document: {
- addEventListener: m_document_addEventListener,
- removeEventListener: m_document_removeEventListener
- },
- window: {
- addEventListener: m_window_addEventListener,
- removeEventListener: m_window_removeEventListener
- }
- };
- },
-
- /**
- * Method to fire event from native code
- * bNoDetach is required for events which cause an exception which needs to be caught in native code
- */
- fireDocumentEvent: function (type, data, bNoDetach) {
- var evt = createEvent(type, data);
- if (typeof documentEventHandlers[type] !== 'undefined') {
- if (bNoDetach) {
- documentEventHandlers[type].fire(evt);
- } else {
- setTimeout(function () {
- // Fire deviceready on listeners that were registered before cordova.js was loaded.
- if (type === 'deviceready') {
- document.dispatchEvent(evt);
- }
- documentEventHandlers[type].fire(evt);
- }, 0);
- }
- } else {
- document.dispatchEvent(evt);
- }
- },
-
- fireWindowEvent: function (type, data) {
- var evt = createEvent(type, data);
- if (typeof windowEventHandlers[type] !== 'undefined') {
- setTimeout(function () {
- windowEventHandlers[type].fire(evt);
- }, 0);
- } else {
- window.dispatchEvent(evt);
- }
- },
-
- /**
- * Plugin callback mechanism.
- */
- // Randomize the starting callbackId to avoid collisions after refreshing or navigating.
- // This way, it's very unlikely that any new callback would get the same callbackId as an old callback.
- callbackId: Math.floor(Math.random() * 2000000000),
- callbacks: {},
- callbackStatus: {
- NO_RESULT: 0,
- OK: 1,
- CLASS_NOT_FOUND_EXCEPTION: 2,
- ILLEGAL_ACCESS_EXCEPTION: 3,
- INSTANTIATION_EXCEPTION: 4,
- MALFORMED_URL_EXCEPTION: 5,
- IO_EXCEPTION: 6,
- INVALID_ACTION: 7,
- JSON_EXCEPTION: 8,
- ERROR: 9
- },
-
- /**
- * Called by native code when returning successful result from an action.
- */
- callbackSuccess: function (callbackId, args) {
- cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback);
- },
-
- /**
- * Called by native code when returning error result from an action.
- */
- callbackError: function (callbackId, args) {
- // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative.
- // Derive success from status.
- cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback);
- },
-
- /**
- * Called by native code when returning the result from an action.
- */
- callbackFromNative: function (callbackId, isSuccess, status, args, keepCallback) {
- try {
- var callback = cordova.callbacks[callbackId];
- if (callback) {
- if (isSuccess && status === cordova.callbackStatus.OK) {
- callback.success && callback.success.apply(null, args);
- } else if (!isSuccess) {
- callback.fail && callback.fail.apply(null, args);
- }
- /*
- else
- Note, this case is intentionally not caught.
- this can happen if isSuccess is true, but callbackStatus is NO_RESULT
- which is used to remove a callback from the list without calling the callbacks
- typically keepCallback is false in this case
- */
- // Clear callback if not expecting any more results
- if (!keepCallback) {
- delete cordova.callbacks[callbackId];
- }
- }
- } catch (err) {
- var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err;
- cordova.fireWindowEvent('cordovacallbackerror', { message: msg, error: err });
- throw err;
- }
- },
-
- addConstructor: function (func) {
- channel.onCordovaReady.subscribe(function () {
- try {
- func();
- } catch (e) {
- console.log('Failed to run constructor: ' + e);
- }
- });
- }
-};
-
-module.exports = cordova;
-
-});
-
-// file: src/common/argscheck.js
-define("cordova/argscheck", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-
-var moduleExports = module.exports;
-
-var typeMap = {
- A: 'Array',
- D: 'Date',
- N: 'Number',
- S: 'String',
- F: 'Function',
- O: 'Object'
-};
-
-function extractParamName (callee, argIndex) {
- return (/\(\s*([^)]*?)\s*\)/).exec(callee)[1].split(/\s*,\s*/)[argIndex];
-}
-
-/**
- * Checks the given arguments' types and throws if they are not as expected.
- *
- * `spec` is a string where each character stands for the required type of the
- * argument at the same position. In other words: the character at `spec[i]`
- * specifies the required type for `args[i]`. The characters in `spec` are the
- * first letter of the required type's name. The supported types are:
- *
- * Array, Date, Number, String, Function, Object
- *
- * Lowercase characters specify arguments that must not be `null` or `undefined`
- * while uppercase characters allow those values to be passed.
- *
- * Finally, `*` can be used to allow any type at the corresponding position.
- *
- * @example
- * function foo (arr, opts) {
- * // require `arr` to be an Array and `opts` an Object, null or undefined
- * checkArgs('aO', 'my.package.foo', arguments);
- * // ...
- * }
- * @param {String} spec - the type specification for `args` as described above
- * @param {String} functionName - full name of the callee.
- * Used in the error message
- * @param {Array|arguments} args - the arguments to be checked against `spec`
- * @param {Function} [opt_callee=args.callee] - the recipient of `args`.
- * Used to extract parameter names for the error message
- * @throws {TypeError} if args do not satisfy spec
- */
-function checkArgs (spec, functionName, args, opt_callee) {
- if (!moduleExports.enableChecks) {
- return;
- }
- var errMsg = null;
- var typeName;
- for (var i = 0; i < spec.length; ++i) {
- var c = spec.charAt(i);
- var cUpper = c.toUpperCase();
- var arg = args[i];
- // Asterix means allow anything.
- if (c === '*') {
- continue;
- }
- typeName = utils.typeName(arg);
- if ((arg === null || arg === undefined) && c === cUpper) {
- continue;
- }
- if (typeName !== typeMap[cUpper]) {
- errMsg = 'Expected ' + typeMap[cUpper];
- break;
- }
- }
- if (errMsg) {
- errMsg += ', but got ' + typeName + '.';
- errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg;
- // Don't log when running unit tests.
- if (typeof jasmine === 'undefined') {
- console.error(errMsg);
- }
- throw TypeError(errMsg);
- }
-}
-
-function getValue (value, defaultValue) {
- return value === undefined ? defaultValue : value;
-}
-
-moduleExports.checkArgs = checkArgs;
-moduleExports.getValue = getValue;
-moduleExports.enableChecks = true;
-
-});
-
-// file: src/common/base64.js
-define("cordova/base64", function(require, exports, module) {
-
-var base64 = exports;
-
-base64.fromArrayBuffer = function (arrayBuffer) {
- var array = new Uint8Array(arrayBuffer);
- return uint8ToBase64(array);
-};
-
-base64.toArrayBuffer = function (str) {
- var decodedStr = atob(str);
- var arrayBuffer = new ArrayBuffer(decodedStr.length);
- var array = new Uint8Array(arrayBuffer);
- for (var i = 0, len = decodedStr.length; i < len; i++) {
- array[i] = decodedStr.charCodeAt(i);
- }
- return arrayBuffer;
-};
-
-// ------------------------------------------------------------------------------
-
-/* This code is based on the performance tests at http://jsperf.com/b64tests
- * This 12-bit-at-a-time algorithm was the best performing version on all
- * platforms tested.
- */
-
-var b64_6bit = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
-var b64_12bit;
-
-var b64_12bitTable = function () {
- b64_12bit = [];
- for (var i = 0; i < 64; i++) {
- for (var j = 0; j < 64; j++) {
- b64_12bit[i * 64 + j] = b64_6bit[i] + b64_6bit[j];
- }
- }
- b64_12bitTable = function () { return b64_12bit; };
- return b64_12bit;
-};
-
-function uint8ToBase64 (rawData) {
- var numBytes = rawData.byteLength;
- var output = '';
- var segment;
- var table = b64_12bitTable();
- for (var i = 0; i < numBytes - 2; i += 3) {
- segment = (rawData[i] << 16) + (rawData[i + 1] << 8) + rawData[i + 2];
- output += table[segment >> 12];
- output += table[segment & 0xfff];
- }
- if (numBytes - i === 2) {
- segment = (rawData[i] << 16) + (rawData[i + 1] << 8);
- output += table[segment >> 12];
- output += b64_6bit[(segment & 0xfff) >> 6];
- output += '=';
- } else if (numBytes - i === 1) {
- segment = (rawData[i] << 16);
- output += table[segment >> 12];
- output += '==';
- }
- return output;
-}
-
-});
-
-// file: src/common/builder.js
-define("cordova/builder", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-
-function each (objects, func, context) {
- for (var prop in objects) {
- if (Object.prototype.hasOwnProperty.call(objects, prop)) {
- func.apply(context, [objects[prop], prop]);
- }
- }
-}
-
-function clobber (obj, key, value) {
- var needsProperty = false;
- try {
- obj[key] = value;
- } catch (e) {
- needsProperty = true;
- }
- // Getters can only be overridden by getters.
- if (needsProperty || obj[key] !== value) {
- utils.defineGetter(obj, key, function () {
- return value;
- });
- }
-}
-
-function assignOrWrapInDeprecateGetter (obj, key, value, message) {
- if (message) {
- utils.defineGetter(obj, key, function () {
- console.log(message);
- delete obj[key];
- clobber(obj, key, value);
- return value;
- });
- } else {
- clobber(obj, key, value);
- }
-}
-
-function include (parent, objects, clobber, merge) {
- each(objects, function (obj, key) {
- try {
- var result = obj.path ? require(obj.path) : {};
-
- if (clobber) {
- // Clobber if it doesn't exist.
- if (typeof parent[key] === 'undefined') {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else if (typeof obj.path !== 'undefined') {
- // If merging, merge properties onto parent, otherwise, clobber.
- if (merge) {
- recursiveMerge(parent[key], result);
- } else {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- }
- }
- result = parent[key];
- } else {
- // Overwrite if not currently defined.
- if (typeof parent[key] === 'undefined') {
- assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated);
- } else {
- // Set result to what already exists, so we can build children into it if they exist.
- result = parent[key];
- }
- }
-
- if (obj.children) {
- include(result, obj.children, clobber, merge);
- }
- } catch (e) {
- utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"');
- }
- });
-}
-
-/**
- * Merge properties from one object onto another recursively. Properties from
- * the src object will overwrite existing target property.
- *
- * @param target Object to merge properties into.
- * @param src Object to merge properties from.
- */
-function recursiveMerge (target, src) {
- for (var prop in src) {
- if (Object.prototype.hasOwnProperty.call(src, prop)) {
- if (target.prototype && target.prototype.constructor === target) {
- // If the target object is a constructor override off prototype.
- clobber(target.prototype, prop, src[prop]);
- } else {
- if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
- recursiveMerge(target[prop], src[prop]);
- } else {
- clobber(target, prop, src[prop]);
- }
- }
- }
- }
-}
-
-exports.buildIntoButDoNotClobber = function (objects, target) {
- include(target, objects, false, false);
-};
-exports.buildIntoAndClobber = function (objects, target) {
- include(target, objects, true, false);
-};
-exports.buildIntoAndMerge = function (objects, target) {
- include(target, objects, true, true);
-};
-exports.recursiveMerge = recursiveMerge;
-exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter;
-
-});
-
-// file: src/common/channel.js
-define("cordova/channel", function(require, exports, module) {
-
-var utils = require('cordova/utils');
-var nextGuid = 1;
-
-/**
- * Custom pub-sub "channel" that can have functions subscribed to it
- * This object is used to define and control firing of events for
- * cordova initialization, as well as for custom events thereafter.
- *
- * The order of events during page load and Cordova startup is as follows:
- *
- * onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed.
- * onNativeReady* Internal event that indicates the Cordova native side is ready.
- * onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created.
- * onDeviceReady* User event fired to indicate that Cordova is ready
- * onResume User event fired to indicate a start/resume lifecycle event
- * onPause User event fired to indicate a pause lifecycle event
- *
- * The events marked with an * are sticky. Once they have fired, they will stay in the fired state.
- * All listeners that subscribe after the event is fired will be executed right away.
- *
- * The only Cordova events that user code should register for are:
- * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript
- * pause App has moved to background
- * resume App has returned to foreground
- *
- * Listeners can be registered as:
- * document.addEventListener("deviceready", myDeviceReadyListener, false);
- * document.addEventListener("resume", myResumeListener, false);
- * document.addEventListener("pause", myPauseListener, false);
- *
- * The DOM lifecycle events should be used for saving and restoring state
- * window.onload
- * window.onunload
- *
- */
-
-/**
- * Channel
- * @constructor
- * @param type String the channel name
- */
-var Channel = function (type, sticky) {
- this.type = type;
- // Map of guid -> function.
- this.handlers = {};
- // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired.
- this.state = sticky ? 1 : 0;
- // Used in sticky mode to remember args passed to fire().
- this.fireArgs = null;
- // Used by onHasSubscribersChange to know if there are any listeners.
- this.numHandlers = 0;
- // Function that is called when the first listener is subscribed, or when
- // the last listener is unsubscribed.
- this.onHasSubscribersChange = null;
-};
-var channel = {
- /**
- * Calls the provided function only after all of the channels specified
- * have been fired. All channels must be sticky channels.
- */
- join: function (h, c) {
- var len = c.length;
- var i = len;
- var f = function () {
- if (!(--i)) h();
- };
- for (var j = 0; j < len; j++) {
- if (c[j].state === 0) {
- throw Error('Can only use join with sticky channels.');
- }
- c[j].subscribe(f);
- }
- if (!len) h();
- },
-
- create: function (type) {
- return (channel[type] = new Channel(type, false));
- },
- createSticky: function (type) {
- return (channel[type] = new Channel(type, true));
- },
-
- /**
- * cordova Channels that must fire before "deviceready" is fired.
- */
- deviceReadyChannelsArray: [],
- deviceReadyChannelsMap: {},
-
- /**
- * Indicate that a feature needs to be initialized before it is ready to be used.
- * This holds up Cordova's "deviceready" event until the feature has been initialized
- * and Cordova.initComplete(feature) is called.
- *
- * @param feature {String} The unique feature name
- */
- waitForInitialization: function (feature) {
- if (feature) {
- var c = channel[feature] || this.createSticky(feature);
- this.deviceReadyChannelsMap[feature] = c;
- this.deviceReadyChannelsArray.push(c);
- }
- },
-
- /**
- * Indicate that initialization code has completed and the feature is ready to be used.
- *
- * @param feature {String} The unique feature name
- */
- initializationComplete: function (feature) {
- var c = this.deviceReadyChannelsMap[feature];
- if (c) {
- c.fire();
- }
- }
-};
-
-function checkSubscriptionArgument (argument) {
- if (typeof argument !== 'function' && typeof argument.handleEvent !== 'function') {
- throw new Error(
- 'Must provide a function or an EventListener object ' +
- 'implementing the handleEvent interface.'
- );
- }
-}
-
-/**
- * Subscribes the given function to the channel. Any time that
- * Channel.fire is called so too will the function.
- * Optionally specify an execution context for the function
- * and a guid that can be used to stop subscribing to the channel.
- * Returns the guid.
- */
-Channel.prototype.subscribe = function (eventListenerOrFunction, eventListener) {
- checkSubscriptionArgument(eventListenerOrFunction);
- var handleEvent, guid;
-
- if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') {
- // Received an EventListener object implementing the handleEvent interface
- handleEvent = eventListenerOrFunction.handleEvent;
- eventListener = eventListenerOrFunction;
- } else {
- // Received a function to handle event
- handleEvent = eventListenerOrFunction;
- }
-
- if (this.state === 2) {
- handleEvent.apply(eventListener || this, this.fireArgs);
- return;
- }
-
- guid = eventListenerOrFunction.observer_guid;
- if (typeof eventListener === 'object') {
- handleEvent = utils.close(eventListener, handleEvent);
- }
-
- if (!guid) {
- // First time any channel has seen this subscriber
- guid = '' + nextGuid++;
- }
- handleEvent.observer_guid = guid;
- eventListenerOrFunction.observer_guid = guid;
-
- // Don't add the same handler more than once.
- if (!this.handlers[guid]) {
- this.handlers[guid] = handleEvent;
- this.numHandlers++;
- if (this.numHandlers === 1) {
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-/**
- * Unsubscribes the function with the given guid from the channel.
- */
-Channel.prototype.unsubscribe = function (eventListenerOrFunction) {
- checkSubscriptionArgument(eventListenerOrFunction);
- var handleEvent, guid, handler;
-
- if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') {
- // Received an EventListener object implementing the handleEvent interface
- handleEvent = eventListenerOrFunction.handleEvent;
- } else {
- // Received a function to handle event
- handleEvent = eventListenerOrFunction;
- }
-
- guid = handleEvent.observer_guid;
- handler = this.handlers[guid];
- if (handler) {
- delete this.handlers[guid];
- this.numHandlers--;
- if (this.numHandlers === 0) {
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-/**
- * Calls all functions subscribed to this channel.
- */
-Channel.prototype.fire = function (e) {
- var fireArgs = Array.prototype.slice.call(arguments);
- // Apply stickiness.
- if (this.state === 1) {
- this.state = 2;
- this.fireArgs = fireArgs;
- }
- if (this.numHandlers) {
- // Copy the values first so that it is safe to modify it from within
- // callbacks.
- var toCall = [];
- for (var item in this.handlers) {
- toCall.push(this.handlers[item]);
- }
- for (var i = 0; i < toCall.length; ++i) {
- toCall[i].apply(this, fireArgs);
- }
- if (this.state === 2 && this.numHandlers) {
- this.numHandlers = 0;
- this.handlers = {};
- this.onHasSubscribersChange && this.onHasSubscribersChange();
- }
- }
-};
-
-// defining them here so they are ready super fast!
-// DOM event that is received when the web page is loaded and parsed.
-channel.createSticky('onDOMContentLoaded');
-
-// Event to indicate the Cordova native side is ready.
-channel.createSticky('onNativeReady');
-
-// Event to indicate that all Cordova JavaScript objects have been created
-// and it's time to run plugin constructors.
-channel.createSticky('onCordovaReady');
-
-// Event to indicate that all automatically loaded JS plugins are loaded and ready.
-// FIXME remove this
-channel.createSticky('onPluginsReady');
-
-// Event to indicate that Cordova is ready
-channel.createSticky('onDeviceReady');
-
-// Event to indicate a resume lifecycle event
-channel.create('onResume');
-
-// Event to indicate a pause lifecycle event
-channel.create('onPause');
-
-// Channels that must fire before "deviceready" is fired.
-channel.waitForInitialization('onCordovaReady');
-channel.waitForInitialization('onDOMContentLoaded');
-
-module.exports = channel;
-
-});
-
-// file: ../cordova-ios/cordova-js-src/exec.js
-define("cordova/exec", function(require, exports, module) {
-
-/**
- * Creates the exec bridge used to notify the native code of
- * commands.
- */
-var cordova = require('cordova');
-var utils = require('cordova/utils');
-var base64 = require('cordova/base64');
-
-function massageArgsJsToNative (args) {
- if (!args || utils.typeName(args) !== 'Array') {
- return args;
- }
- var ret = [];
- args.forEach(function (arg, i) {
- if (utils.typeName(arg) === 'ArrayBuffer') {
- ret.push({
- CDVType: 'ArrayBuffer',
- data: base64.fromArrayBuffer(arg)
- });
- } else {
- ret.push(arg);
- }
- });
- return ret;
-}
-
-function massageMessageNativeToJs (message) {
- if (message.CDVType === 'ArrayBuffer') {
- var stringToArrayBuffer = function (str) {
- var ret = new Uint8Array(str.length);
- for (var i = 0; i < str.length; i++) {
- ret[i] = str.charCodeAt(i);
- }
- return ret.buffer;
- };
- var base64ToArrayBuffer = function (b64) {
- return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef
- };
- message = base64ToArrayBuffer(message.data);
- }
- return message;
-}
-
-function convertMessageToArgsNativeToJs (message) {
- var args = [];
- if (!message || !Object.prototype.hasOwnProperty.call(message, 'CDVType')) {
- args.push(message);
- } else if (message.CDVType === 'MultiPart') {
- message.messages.forEach(function (e) {
- args.push(massageMessageNativeToJs(e));
- });
- } else {
- args.push(massageMessageNativeToJs(message));
- }
- return args;
-}
-
-var iOSExec = function () {
- var successCallback, failCallback, service, action, actionArgs;
- var callbackId = null;
- if (typeof arguments[0] !== 'string') {
- // FORMAT ONE
- successCallback = arguments[0];
- failCallback = arguments[1];
- service = arguments[2];
- action = arguments[3];
- actionArgs = arguments[4];
-
- // Since we need to maintain backwards compatibility, we have to pass
- // an invalid callbackId even if no callback was provided since plugins
- // will be expecting it. The Cordova.exec() implementation allocates
- // an invalid callbackId and passes it even if no callbacks were given.
- callbackId = 'INVALID';
- } else {
- throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line
- 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);');
- }
-
- // If actionArgs is not provided, default to an empty array
- actionArgs = actionArgs || [];
-
- // Register the callbacks and add the callbackId to the positional
- // arguments if given.
- if (successCallback || failCallback) {
- callbackId = service + cordova.callbackId++;
- cordova.callbacks[callbackId] =
- { success: successCallback, fail: failCallback };
- }
-
- actionArgs = massageArgsJsToNative(actionArgs);
-
- // CB-10133 DataClone DOM Exception 25 guard (fast function remover)
- var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))];
- window.webkit.messageHandlers.cordova.postMessage(command);
-};
-
-iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
- var success = status === 0 || status === 1;
- var args = convertMessageToArgsNativeToJs(message);
- Promise.resolve().then(function () {
- cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line
- });
-};
-
-// for backwards compatibility
-iOSExec.nativeEvalAndFetch = function (func) {
- try {
- func();
- } catch (e) {
- console.log(e);
- }
-};
-
-// Proxy the exec for bridge changes. See CB-10106
-
-function cordovaExec () {
- var cexec = require('cordova/exec');
- var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function');
- return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec;
-}
-
-function execProxy () {
- cordovaExec().apply(null, arguments);
-}
-
-execProxy.nativeFetchMessages = function () {
- return cordovaExec().nativeFetchMessages.apply(null, arguments);
-};
-
-execProxy.nativeEvalAndFetch = function () {
- return cordovaExec().nativeEvalAndFetch.apply(null, arguments);
-};
-
-execProxy.nativeCallback = function () {
- return cordovaExec().nativeCallback.apply(null, arguments);
-};
-
-module.exports = execProxy;
-
-});
-
-// file: src/common/exec/proxy.js
-define("cordova/exec/proxy", function(require, exports, module) {
-
-// internal map of proxy function
-var CommandProxyMap = {};
-
-module.exports = {
-
- // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...);
- add: function (id, proxyObj) {
- console.log('adding proxy for ' + id);
- CommandProxyMap[id] = proxyObj;
- return proxyObj;
- },
-
- // cordova.commandProxy.remove("Accelerometer");
- remove: function (id) {
- var proxy = CommandProxyMap[id];
- delete CommandProxyMap[id];
- CommandProxyMap[id] = null;
- return proxy;
- },
-
- get: function (service, action) {
- return (CommandProxyMap[service] ? CommandProxyMap[service][action] : null);
- }
-};
-
-});
-
-// file: src/common/init.js
-define("cordova/init", function(require, exports, module) {
-
-var channel = require('cordova/channel');
-var cordova = require('cordova');
-var modulemapper = require('cordova/modulemapper');
-var platform = require('cordova/platform');
-var pluginloader = require('cordova/pluginloader');
-
-var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
-
-function logUnfiredChannels (arr) {
- for (var i = 0; i < arr.length; ++i) {
- if (arr[i].state !== 2) {
- console.log('Channel not fired: ' + arr[i].type);
- }
- }
-}
-
-window.setTimeout(function () {
- if (channel.onDeviceReady.state !== 2) {
- console.log('deviceready has not fired after 5 seconds.');
- logUnfiredChannels(platformInitChannelsArray);
- logUnfiredChannels(channel.deviceReadyChannelsArray);
- }
-}, 5000);
-
-if (!window.console) {
- window.console = {
- log: function () {}
- };
-}
-if (!window.console.warn) {
- window.console.warn = function (msg) {
- this.log('warn: ' + msg);
- };
-}
-
-// Register pause, resume and deviceready channels as events on document.
-channel.onPause = cordova.addDocumentEventHandler('pause');
-channel.onResume = cordova.addDocumentEventHandler('resume');
-channel.onActivated = cordova.addDocumentEventHandler('activated');
-channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');
-
-// Listen for DOMContentLoaded and notify our channel subscribers.
-if (document.readyState === 'complete' || document.readyState === 'interactive') {
- channel.onDOMContentLoaded.fire();
-} else {
- document.addEventListener('DOMContentLoaded', function () {
- channel.onDOMContentLoaded.fire();
- }, false);
-}
-
-// _nativeReady is global variable that the native side can set
-// to signify that the native code is ready. It is a global since
-// it may be called before any cordova JS is ready.
-if (window._nativeReady) {
- channel.onNativeReady.fire();
-}
-
-modulemapper.clobbers('cordova', 'cordova');
-modulemapper.clobbers('cordova/exec', 'cordova.exec');
-modulemapper.clobbers('cordova/exec', 'Cordova.exec');
-
-// Call the platform-specific initialization.
-platform.bootstrap && platform.bootstrap();
-
-// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js.
-// The delay allows the attached modules to be defined before the plugin loader looks for them.
-setTimeout(function () {
- pluginloader.load(function () {
- channel.onPluginsReady.fire();
- });
-}, 0);
-
-/**
- * Create all cordova objects once native side is ready.
- */
-channel.join(function () {
- modulemapper.mapModules(window);
-
- platform.initialize && platform.initialize();
-
- // Fire event to notify that all objects are created
- channel.onCordovaReady.fire();
-
- // Fire onDeviceReady event once page has fully loaded, all
- // constructors have run and cordova info has been received from native
- // side.
- channel.join(function () {
- require('cordova').fireDocumentEvent('deviceready');
- }, channel.deviceReadyChannelsArray);
-}, platformInitChannelsArray);
-
-});
-
-// file: src/common/modulemapper.js
-define("cordova/modulemapper", function(require, exports, module) {
-
-var builder = require('cordova/builder');
-var moduleMap = define.moduleMap;
-var symbolList;
-var deprecationMap;
-
-exports.reset = function () {
- symbolList = [];
- deprecationMap = {};
-};
-
-function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) {
- if (!(moduleName in moduleMap)) {
- throw new Error('Module ' + moduleName + ' does not exist.');
- }
- symbolList.push(strategy, moduleName, symbolPath);
- if (opt_deprecationMessage) {
- deprecationMap[symbolPath] = opt_deprecationMessage;
- }
-}
-
-// Note: Android 2.3 does have Function.bind().
-exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('c', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('m', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) {
- addEntry('d', moduleName, symbolPath, opt_deprecationMessage);
-};
-
-exports.runs = function (moduleName) {
- addEntry('r', moduleName, null);
-};
-
-function prepareNamespace (symbolPath, context) {
- if (!symbolPath) {
- return context;
- }
- return symbolPath.split('.').reduce(function (cur, part) {
- return (cur[part] = cur[part] || {});
- }, context);
-}
-
-exports.mapModules = function (context) {
- var origSymbols = {};
- context.CDV_origSymbols = origSymbols;
- for (var i = 0, len = symbolList.length; i < len; i += 3) {
- var strategy = symbolList[i];
- var moduleName = symbolList[i + 1];
- var module = require(moduleName);
- // <runs/>
- if (strategy === 'r') {
- continue;
- }
- var symbolPath = symbolList[i + 2];
- var lastDot = symbolPath.lastIndexOf('.');
- var namespace = symbolPath.substr(0, lastDot);
- var lastName = symbolPath.substr(lastDot + 1);
-
- var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null;
- var parentObj = prepareNamespace(namespace, context);
- var target = parentObj[lastName];
-
- if (strategy === 'm' && target) {
- builder.recursiveMerge(target, module);
- } else if ((strategy === 'd' && !target) || (strategy !== 'd')) {
- if (!(symbolPath in origSymbols)) {
- origSymbols[symbolPath] = target;
- }
- builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg);
- }
- }
-};
-
-exports.getOriginalSymbol = function (context, symbolPath) {
- var origSymbols = context.CDV_origSymbols;
- if (origSymbols && (symbolPath in origSymbols)) {
- return origSymbols[symbolPath];
- }
- var parts = symbolPath.split('.');
- var obj = context;
- for (var i = 0; i < parts.length; ++i) {
- obj = obj && obj[parts[i]];
- }
- return obj;
-};
-
-exports.reset();
-
-});
-
-// file: ../cordova-ios/cordova-js-src/platform.js
-define("cordova/platform", function(require, exports, module) {
-
-module.exports = {
- id: 'ios',
- bootstrap: function () {
- // Attach the console polyfill that is iOS-only to window.console
- // see the file under plugin/ios/console.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console');
-
- // Attach the wkwebkit utility to window.WkWebView
- // see the file under plugin/ios/wkwebkit.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/wkwebkit', 'window.WkWebView');
-
- // Attach the splashscreen utility to window.navigator.splashscreen
- // see the file under plugin/ios/launchscreen.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/launchscreen', 'navigator.splashscreen');
-
- require('cordova/channel').onNativeReady.fire();
- }
-};
-
-});
-
-// file: ../cordova-ios/cordova-js-src/plugin/ios/console.js
-define("cordova/plugin/ios/console", function(require, exports, module) {
-
-// ------------------------------------------------------------------------------
-
-var logger = require('cordova/plugin/ios/logger');
-
-// ------------------------------------------------------------------------------
-// object that we're exporting
-// ------------------------------------------------------------------------------
-var console = module.exports;
-
-// ------------------------------------------------------------------------------
-// copy of the original console object
-// ------------------------------------------------------------------------------
-var WinConsole = window.console;
-
-// ------------------------------------------------------------------------------
-// whether to use the logger
-// ------------------------------------------------------------------------------
-var UseLogger = false;
-
-// ------------------------------------------------------------------------------
-// Timers
-// ------------------------------------------------------------------------------
-var Timers = {};
-
-// ------------------------------------------------------------------------------
-// used for unimplemented methods
-// ------------------------------------------------------------------------------
-function noop () {}
-
-// ------------------------------------------------------------------------------
-// used for unimplemented methods
-// ------------------------------------------------------------------------------
-console.useLogger = function (value) {
- if (arguments.length) UseLogger = !!value;
-
- if (UseLogger) {
- if (logger.useConsole()) {
- throw new Error('console and logger are too intertwingly');
- }
- }
-
- return UseLogger;
-};
-
-// ------------------------------------------------------------------------------
-console.log = function () {
- if (logger.useConsole()) return;
- logger.log.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.error = function () {
- if (logger.useConsole()) return;
- logger.error.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.warn = function () {
- if (logger.useConsole()) return;
- logger.warn.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.info = function () {
- if (logger.useConsole()) return;
- logger.info.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.debug = function () {
- if (logger.useConsole()) return;
- logger.debug.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.assert = function (expression) {
- if (expression) return;
-
- var message = logger.format.apply(logger.format, [].slice.call(arguments, 1));
- console.log('ASSERT: ' + message);
-};
-
-// ------------------------------------------------------------------------------
-console.clear = function () {};
-
-// ------------------------------------------------------------------------------
-console.dir = function (object) {
- console.log('%o', object);
-};
-
-// ------------------------------------------------------------------------------
-console.dirxml = function (node) {
- console.log(node.innerHTML);
-};
-
-// ------------------------------------------------------------------------------
-console.trace = noop;
-
-// ------------------------------------------------------------------------------
-console.group = console.log;
-
-// ------------------------------------------------------------------------------
-console.groupCollapsed = console.log;
-
-// ------------------------------------------------------------------------------
-console.groupEnd = noop;
-
-// ------------------------------------------------------------------------------
-console.time = function (name) {
- Timers[name] = new Date().valueOf();
-};
-
-// ------------------------------------------------------------------------------
-console.timeEnd = function (name) {
- var timeStart = Timers[name];
- if (!timeStart) {
- console.warn('unknown timer: ' + name);
- return;
- }
-
- var timeElapsed = new Date().valueOf() - timeStart;
- console.log(name + ': ' + timeElapsed + 'ms');
-};
-
-// ------------------------------------------------------------------------------
-console.timeStamp = noop;
-
-// ------------------------------------------------------------------------------
-console.profile = noop;
-
-// ------------------------------------------------------------------------------
-console.profileEnd = noop;
-
-// ------------------------------------------------------------------------------
-console.count = noop;
-
-// ------------------------------------------------------------------------------
-console.exception = console.log;
-
-// ------------------------------------------------------------------------------
-console.table = function (data, columns) {
- console.log('%o', data);
-};
-
-// ------------------------------------------------------------------------------
-// return a new function that calls both functions passed as args
-// ------------------------------------------------------------------------------
-function wrappedOrigCall (orgFunc, newFunc) {
- return function () {
- var args = [].slice.call(arguments);
- try { orgFunc.apply(WinConsole, args); } catch (e) {}
- try { newFunc.apply(console, args); } catch (e) {}
- };
-}
-
-// ------------------------------------------------------------------------------
-// For every function that exists in the original console object, that
-// also exists in the new console object, wrap the new console method
-// with one that calls both
-// ------------------------------------------------------------------------------
-for (var key in console) {
- if (typeof WinConsole[key] === 'function') {
- console[key] = wrappedOrigCall(WinConsole[key], console[key]);
- }
-}
-
-});
-
-// file: ../cordova-ios/cordova-js-src/plugin/ios/launchscreen.js
-define("cordova/plugin/ios/launchscreen", function(require, exports, module) {
-
-var exec = require('cordova/exec');
-
-var launchscreen = {
- show: function () {
- exec(null, null, 'LaunchScreen', 'show', []);
- },
- hide: function () {
- exec(null, null, 'LaunchScreen', 'hide', []);
- }
-};
-
-module.exports = launchscreen;
-
-});
-
-// file: ../cordova-ios/cordova-js-src/plugin/ios/logger.js
-define("cordova/plugin/ios/logger", function(require, exports, module) {
-
-// ------------------------------------------------------------------------------
-// The logger module exports the following properties/functions:
-//
-// LOG - constant for the level LOG
-// ERROR - constant for the level ERROR
-// WARN - constant for the level WARN
-// INFO - constant for the level INFO
-// DEBUG - constant for the level DEBUG
-// logLevel() - returns current log level
-// logLevel(value) - sets and returns a new log level
-// useConsole() - returns whether logger is using console
-// useConsole(value) - sets and returns whether logger is using console
-// log(message,...) - logs a message at level LOG
-// error(message,...) - logs a message at level ERROR
-// warn(message,...) - logs a message at level WARN
-// info(message,...) - logs a message at level INFO
-// debug(message,...) - logs a message at level DEBUG
-// logLevel(level,message,...) - logs a message specified level
-//
-// ------------------------------------------------------------------------------
-
-var logger = exports;
-
-var exec = require('cordova/exec');
-
-var UseConsole = false;
-var UseLogger = true;
-var Queued = [];
-var DeviceReady = false;
-var CurrentLevel;
-
-var originalConsole = console;
-
-/**
- * Logging levels
- */
-
-var Levels = [
- 'LOG',
- 'ERROR',
- 'WARN',
- 'INFO',
- 'DEBUG'
-];
-
-/*
- * add the logging levels to the logger object and
- * to a separate levelsMap object for testing
- */
-
-var LevelsMap = {};
-for (var i = 0; i < Levels.length; i++) {
- var level = Levels[i];
- LevelsMap[level] = i;
- logger[level] = level;
-}
-
-CurrentLevel = LevelsMap.WARN;
-
-/**
- * Getter/Setter for the logging level
- *
- * Returns the current logging level.
- *
- * When a value is passed, sets the logging level to that value.
- * The values should be one of the following constants:
- * logger.LOG
- * logger.ERROR
- * logger.WARN
- * logger.INFO
- * logger.DEBUG
- *
- * The value used determines which messages get printed. The logging
- * values above are in order, and only messages logged at the logging
- * level or above will actually be displayed to the user. E.g., the
- * default level is WARN, so only messages logged with LOG, ERROR, or
- * WARN will be displayed; INFO and DEBUG messages will be ignored.
- */
-logger.level = function (value) {
- if (arguments.length) {
- if (LevelsMap[value] === null) {
- throw new Error('invalid logging level: ' + value);
- }
- CurrentLevel = LevelsMap[value];
- }
-
- return Levels[CurrentLevel];
-};
-
-/**
- * Getter/Setter for the useConsole functionality
- *
- * When useConsole is true, the logger will log via the
- * browser 'console' object.
- */
-logger.useConsole = function (value) {
- if (arguments.length) UseConsole = !!value;
-
- if (UseConsole) {
- if (typeof console === 'undefined') {
- throw new Error('global console object is not defined');
- }
-
- if (typeof console.log !== 'function') {
- throw new Error('global console object does not have a log function');
- }
-
- if (typeof console.useLogger === 'function') {
- if (console.useLogger()) {
- throw new Error('console and logger are too intertwingly');
- }
- }
- }
-
- return UseConsole;
-};
-
-/**
- * Getter/Setter for the useLogger functionality
- *
- * When useLogger is true, the logger will log via the
- * native Logger plugin.
- */
-logger.useLogger = function (value) {
- // Enforce boolean
- if (arguments.length) UseLogger = !!value;
- return UseLogger;
-};
-
-/**
- * Logs a message at the LOG level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.log = function (message) { logWithArgs('LOG', arguments); };
-
-/**
- * Logs a message at the ERROR level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.error = function (message) { logWithArgs('ERROR', arguments); };
-
-/**
- * Logs a message at the WARN level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.warn = function (message) { logWithArgs('WARN', arguments); };
-
-/**
- * Logs a message at the INFO level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.info = function (message) { logWithArgs('INFO', arguments); };
-
-/**
- * Logs a message at the DEBUG level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.debug = function (message) { logWithArgs('DEBUG', arguments); };
-
-// log at the specified level with args
-function logWithArgs (level, args) {
- args = [level].concat([].slice.call(args));
- logger.logLevel.apply(logger, args);
-}
-
-// return the correct formatString for an object
-function formatStringForMessage (message) {
- return (typeof message === 'string') ? '' : '%o';
-}
-
-/**
- * Logs a message at the specified level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.logLevel = function (level /* , ... */) {
- // format the message with the parameters
- var formatArgs = [].slice.call(arguments, 1);
- var fmtString = formatStringForMessage(formatArgs[0]);
- if (fmtString.length > 0) {
- formatArgs.unshift(fmtString); // add formatString
- }
-
- var message = logger.format.apply(logger.format, formatArgs);
-
- if (LevelsMap[level] === null) {
- throw new Error('invalid logging level: ' + level);
- }
-
- if (LevelsMap[level] > CurrentLevel) return;
-
- // queue the message if not yet at deviceready
- if (!DeviceReady && !UseConsole) {
- Queued.push([level, message]);
- return;
- }
-
- // Log using the native logger if that is enabled
- if (UseLogger) {
- exec(null, null, 'Console', 'logLevel', [level, message]);
- }
-
- // Log using the console if that is enabled
- if (UseConsole) {
- // make sure console is not using logger
- if (console.useLogger()) {
- throw new Error('console and logger are too intertwingly');
- }
-
- // log to the console
- switch (level) {
- case logger.LOG: originalConsole.log(message); break;
- case logger.ERROR: originalConsole.log('ERROR: ' + message); break;
- case logger.WARN: originalConsole.log('WARN: ' + message); break;
- case logger.INFO: originalConsole.log('INFO: ' + message); break;
- case logger.DEBUG: originalConsole.log('DEBUG: ' + message); break;
- }
- }
-};
-
-/**
- * Formats a string and arguments following it ala console.log()
- *
- * Any remaining arguments will be appended to the formatted string.
- *
- * for rationale, see FireBug's Console API:
- * http://getfirebug.com/wiki/index.php/Console_API
- */
-logger.format = function (formatString, args) {
- return __format(arguments[0], [].slice.call(arguments, 1)).join(' ');
-};
-
-// ------------------------------------------------------------------------------
-/**
- * Formats a string and arguments following it ala vsprintf()
- *
- * format chars:
- * %j - format arg as JSON
- * %o - format arg as JSON
- * %c - format arg as ''
- * %% - replace with '%'
- * any other char following % will format it's
- * arg via toString().
- *
- * Returns an array containing the formatted string and any remaining
- * arguments.
- */
-function __format (formatString, args) {
- if (formatString === null || formatString === undefined) return [''];
- if (arguments.length === 1) return [formatString.toString()];
-
- if (typeof formatString !== 'string') { formatString = formatString.toString(); }
-
- var pattern = /(.*?)%(.)(.*)/;
- var rest = formatString;
- var result = [];
-
- while (args.length) {
- var match = pattern.exec(rest);
- if (!match) break;
-
- var arg = args.shift();
- rest = match[3];
- result.push(match[1]);
-
- if (match[2] === '%') {
- result.push('%');
- args.unshift(arg);
- continue;
- }
-
- result.push(__formatted(arg, match[2]));
- }
-
- result.push(rest);
-
- var remainingArgs = [].slice.call(args);
- remainingArgs.unshift(result.join(''));
- return remainingArgs;
-}
-
-function __formatted (object, formatChar) {
- try {
- switch (formatChar) {
- case 'j':
- case 'o': return JSON.stringify(object);
- case 'c': return '';
- }
- } catch (e) {
- return 'error JSON.stringify()ing argument: ' + e;
- }
-
- if ((object === null) || (object === undefined)) {
- return Object.prototype.toString.call(object);
- }
-
- return object.toString();
-}
-
-// ------------------------------------------------------------------------------
-// when deviceready fires, log queued messages
-logger.__onDeviceReady = function () {
- if (DeviceReady) return;
-
- DeviceReady = true;
-
- for (var i = 0; i < Queued.length; i++) {
- var messageArgs = Queued[i];
- logger.logLevel(messageArgs[0], messageArgs[1]);
- }
-
- Queued = null;
-};
-
-// add a deviceready event to log queued messages
-document.addEventListener('deviceready', logger.__onDeviceReady, false);
-
-});
-
-// file: ../cordova-ios/cordova-js-src/plugin/ios/wkwebkit.js
-define("cordova/plugin/ios/wkwebkit", function(require, exports, module) {
-
-var exec = require('cordova/exec');
-
-var WkWebKit = {
- allowsBackForwardNavigationGestures: function (allow) {
- exec(null, null, 'CDVWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]);
- },
- convertFilePath: function (path) {
- if (!path || !window.CDV_ASSETS_URL) {
- return path;
- }
- if (path.startsWith('/')) {
- return window.CDV_ASSETS_URL + '/_app_file_' + path;
- }
- if (path.startsWith('file://')) {
- return window.CDV_ASSETS_URL + path.replace('file://', '/_app_file_');
- }
- return path;
- }
-};
-
-module.exports = WkWebKit;
-
-});
-
-// file: src/common/pluginloader.js
-define("cordova/pluginloader", function(require, exports, module) {
-
-var modulemapper = require('cordova/modulemapper');
-
-// Helper function to inject a <script> tag.
-// Exported for testing.
-exports.injectScript = function (url, onload, onerror) {
- var script = document.createElement('script');
- // onload fires even when script fails loads with an error.
- script.onload = onload;
- // onerror fires for malformed URLs.
- script.onerror = onerror;
- script.src = url;
- document.head.appendChild(script);
-};
-
-function injectIfNecessary (id, url, onload, onerror) {
- onerror = onerror || onload;
- if (id in define.moduleMap) {
- onload();
- } else {
- exports.injectScript(url, function () {
- if (id in define.moduleMap) {
- onload();
- } else {
- onerror();
- }
- }, onerror);
- }
-}
-
-function onScriptLoadingComplete (moduleList, finishPluginLoading) {
- // Loop through all the plugins and then through their clobbers and merges.
- for (var i = 0, module; (module = moduleList[i]); i++) {
- if (module.clobbers && module.clobbers.length) {
- for (var j = 0; j < module.clobbers.length; j++) {
- modulemapper.clobbers(module.id, module.clobbers[j]);
- }
- }
-
- if (module.merges && module.merges.length) {
- for (var k = 0; k < module.merges.length; k++) {
- modulemapper.merges(module.id, module.merges[k]);
- }
- }
-
- // Finally, if runs is truthy we want to simply require() the module.
- if (module.runs) {
- modulemapper.runs(module.id);
- }
- }
-
- finishPluginLoading();
-}
-
-// Handler for the cordova_plugins.js content.
-// See plugman's plugin_loader.js for the details of this object.
-// This function is only called if the really is a plugins array that isn't empty.
-// Otherwise the onerror response handler will just call finishPluginLoading().
-function handlePluginsObject (path, moduleList, finishPluginLoading) {
- // Now inject the scripts.
- var scriptCounter = moduleList.length;
-
- if (!scriptCounter) {
- finishPluginLoading();
- return;
- }
- function scriptLoadedCallback () {
- if (!--scriptCounter) {
- onScriptLoadingComplete(moduleList, finishPluginLoading);
- }
- }
-
- for (var i = 0; i < moduleList.length; i++) {
- injectIfNecessary(moduleList[i].id, path + moduleList[i].file, scriptLoadedCallback);
- }
-}
-
-function findCordovaPath () {
- var path = null;
- var scripts = document.getElementsByTagName('script');
- var term = '/cordova.js';
- for (var n = scripts.length - 1; n > -1; n--) {
- var src = scripts[n].src.replace(/\?.*$/, ''); // Strip any query param (CB-6007).
- if (src.indexOf(term) === (src.length - term.length)) {
- path = src.substring(0, src.length - term.length) + '/';
- break;
- }
- }
- return path;
-}
-
-// Tries to load all plugins' js-modules.
-// This is an async process, but onDeviceReady is blocked on onPluginsReady.
-// onPluginsReady is fired when there are no plugins to load, or they are all done.
-exports.load = function (callback) {
- var pathPrefix = findCordovaPath();
- if (pathPrefix === null) {
- console.log('Could not find cordova.js script tag. Plugin loading may fail.');
- pathPrefix = '';
- }
- injectIfNecessary('cordova/plugin_list', pathPrefix + 'cordova_plugins.js', function () {
- var moduleList = require('cordova/plugin_list');
- handlePluginsObject(pathPrefix, moduleList, callback);
- }, callback);
-};
-
-});
-
-// file: src/common/urlutil.js
-define("cordova/urlutil", function(require, exports, module) {
-
-/**
- * For already absolute URLs, returns what is passed in.
- * For relative URLs, converts them to absolute ones.
- */
-exports.makeAbsolute = function makeAbsolute (url) {
- var anchorEl = document.createElement('a');
- anchorEl.href = url;
- return anchorEl.href;
-};
-
-});
-
-// file: src/common/utils.js
-define("cordova/utils", function(require, exports, module) {
-
-var utils = exports;
-
-/**
- * Defines a property getter / setter for obj[key].
- */
-utils.defineGetterSetter = function (obj, key, getFunc, opt_setFunc) {
- if (Object.defineProperty) {
- var desc = {
- get: getFunc,
- configurable: true
- };
- if (opt_setFunc) {
- desc.set = opt_setFunc;
- }
- Object.defineProperty(obj, key, desc);
- } else {
- obj.__defineGetter__(key, getFunc);
- if (opt_setFunc) {
- obj.__defineSetter__(key, opt_setFunc);
- }
- }
-};
-
-/**
- * Defines a property getter for obj[key].
- */
-utils.defineGetter = utils.defineGetterSetter;
-
-utils.arrayIndexOf = function (a, item) {
- if (a.indexOf) {
- return a.indexOf(item);
- }
- var len = a.length;
- for (var i = 0; i < len; ++i) {
- if (a[i] === item) {
- return i;
- }
- }
- return -1;
-};
-
-/**
- * Returns whether the item was found in the array.
- */
-utils.arrayRemove = function (a, item) {
- var index = utils.arrayIndexOf(a, item);
- if (index !== -1) {
- a.splice(index, 1);
- }
- return index !== -1;
-};
-
-utils.typeName = function (val) {
- return Object.prototype.toString.call(val).slice(8, -1);
-};
-
-/**
- * Returns an indication of whether the argument is an array or not
- */
-utils.isArray = Array.isArray ||
- function (a) { return utils.typeName(a) === 'Array'; };
-
-/**
- * Returns an indication of whether the argument is a Date or not
- */
-utils.isDate = function (d) {
- return (d instanceof Date);
-};
-
-/**
- * Does a deep clone of the object.
- */
-utils.clone = function (obj) {
- if (!obj || typeof obj === 'function' || utils.isDate(obj) || typeof obj !== 'object') {
- return obj;
- }
-
- var retVal, i;
-
- if (utils.isArray(obj)) {
- retVal = [];
- for (i = 0; i < obj.length; ++i) {
- retVal.push(utils.clone(obj[i]));
- }
- return retVal;
- }
-
- retVal = {};
- for (i in obj) {
- // 'unknown' type may be returned in custom protocol activation case on
- // Windows Phone 8.1 causing "No such interface supported" exception on
- // cloning (https://issues.apache.org/jira/browse/CB-11522)
- // eslint-disable-next-line valid-typeof
- if ((!(i in retVal) || retVal[i] !== obj[i]) && typeof obj[i] !== 'undefined' && typeof obj[i] !== 'unknown') {
- retVal[i] = utils.clone(obj[i]);
- }
- }
- return retVal;
-};
-
-/**
- * Returns a wrapped version of the function
- */
-utils.close = function (context, func, params) {
- return function () {
- var args = params || arguments;
- return func.apply(context, args);
- };
-};
-
-// ------------------------------------------------------------------------------
-function UUIDcreatePart (length) {
- var uuidpart = '';
- for (var i = 0; i < length; i++) {
- var uuidchar = parseInt((Math.random() * 256), 10).toString(16);
- if (uuidchar.length === 1) {
- uuidchar = '0' + uuidchar;
- }
- uuidpart += uuidchar;
- }
- return uuidpart;
-}
-
-/**
- * Create a UUID
- */
-utils.createUUID = function () {
- return UUIDcreatePart(4) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(2) + '-' +
- UUIDcreatePart(6);
-};
-
-/**
- * Extends a child object from a parent object using classical inheritance
- * pattern.
- */
-utils.extend = (function () {
- // proxy used to establish prototype chain
- var F = function () {};
- // extend Child from Parent
- return function (Child, Parent) {
- F.prototype = Parent.prototype;
- Child.prototype = new F();
- Child.__super__ = Parent.prototype;
- Child.prototype.constructor = Child;
- };
-}());
-
-/**
- * Alerts a message in any available way: alert or console.log.
- */
-utils.alert = function (msg) {
- if (window.alert) {
- window.alert(msg);
- } else if (console && console.log) {
- console.log(msg);
- }
-};
-
-});
-
-window.cordova = require('cordova');
-// file: src/scripts/bootstrap.js
-require('cordova/init');
-
-})();
diff --git a/cordova/platforms/ios/Podfile b/cordova/platforms/ios/Podfile
index 75aecd5de..aad427dc9 100644
--- a/cordova/platforms/ios/Podfile
+++ b/cordova/platforms/ios/Podfile
@@ -1,8 +1,8 @@
# DO NOT MODIFY -- auto-generated by Apache Cordova
-platform :ios, '11.0'
+platform :ios, '13.0'
-target 'TagSpaces' do
- project 'TagSpaces.xcodeproj'
+target 'App' do
+ project 'App.xcodeproj'
end
diff --git a/cordova/platforms/ios/TagSpaces.xcodeproj/project.pbxproj b/cordova/platforms/ios/TagSpaces.xcodeproj/project.pbxproj
deleted file mode 100755
index 82a162df1..000000000
--- a/cordova/platforms/ios/TagSpaces.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,504 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 52;
- objects = {
-
-/* Begin PBXBuildFile section */
- 0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0207DA571B56EA530066E2B4 /* Images.xcassets */; };
- 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; };
- 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
- 301BF552109A68D80062928A /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 301BF535109A57CC0062928A /* libCordova.a */; settings = {ATTRIBUTES = (Required, ); }; };
- 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; };
- 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; };
- 6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */; };
- F833DAD9664D4D998385F691 /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 092C2B0C2C7844CB9D043A41 /* Downloader.swift */; };
- C785352031594E4F9251FB09 /* CDVFile.m in Sources */ = {isa = PBXBuildFile; fileRef = E4530B4CA9C8414AA5889210 /* CDVFile.m */; };
- 345DF1403BE0418CB5433A2B /* CDVLocalFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DCE5A08D6304A29AE80946C /* CDVLocalFilesystem.m */; };
- 89D3404E8CDE4028B29F3A39 /* CDVAssetLibraryFilesystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 96C1850F8A964922BA4AC443 /* CDVAssetLibraryFilesystem.m */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 301BF534109A57CC0062928A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = D2AAC07E0554694100DB518D;
- remoteInfo = CordovaLib;
- };
- 301BF550109A68C00062928A /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = D2AAC07D0554694100DB518D;
- remoteInfo = CordovaLib;
- };
- 907D8123214C687600058A10 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = C0C01EB21E3911D50056E6CB;
- remoteInfo = Cordova;
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
- 0207DA571B56EA530066E2B4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "TagSpaces/Images.xcassets"; sourceTree = SOURCE_ROOT; };
- 1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
- 1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
- 1D6058910D05DD3D006BFB54 /* TagSpaces.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TagSpaces.app"; sourceTree = BUILT_PRODUCTS_DIR; };
- 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; };
- 301BF56E109A69640062928A /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; };
- 302D95EE14D2391D003F00A1 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; };
- 302D95EF14D2391D003F00A1 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; };
- 302D95F014D2391D003F00A1 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = "<group>"; };
- 3047A50F1AB8059700498E2A /* build-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-debug.xcconfig"; path = "cordova/build-debug.xcconfig"; sourceTree = SOURCE_ROOT; };
- 3047A5101AB8059700498E2A /* build-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-release.xcconfig"; path = "cordova/build-release.xcconfig"; sourceTree = SOURCE_ROOT; };
- 3047A5111AB8059700498E2A /* build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = build.xcconfig; path = cordova/build.xcconfig; sourceTree = SOURCE_ROOT; };
- 32CA4F630368D1EE00C91783 /* TagSpaces-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TagSpaces-Prefix.pch"; sourceTree = "<group>"; };
- 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = CDVLaunchScreen.storyboard; path = "TagSpaces/CDVLaunchScreen.storyboard"; sourceTree = SOURCE_ROOT; };
- 8D1107310486CEB800E47090 /* TagSpaces-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "TagSpaces-Info.plist"; path = "TagSpaces/TagSpaces-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = SOURCE_ROOT; };
- EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; };
- EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; };
- ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
- F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "TagSpaces/config.xml"; sourceTree = "<group>"; };
- 092C2B0C2C7844CB9D043A41 /* Downloader.swift */ = {isa = PBXFileReference; name = "Downloader.swift"; path = "com.whebcraft.cordova.plugin.downloader/Downloader.swift"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.swift; explicitFileType = undefined; includeInIndex = 0; };
- E4530B4CA9C8414AA5889210 /* CDVFile.m */ = {isa = PBXFileReference; name = "CDVFile.m"; path = "cordova-plugin-file/CDVFile.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- 4DCE5A08D6304A29AE80946C /* CDVLocalFilesystem.m */ = {isa = PBXFileReference; name = "CDVLocalFilesystem.m"; path = "cordova-plugin-file/CDVLocalFilesystem.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- 96C1850F8A964922BA4AC443 /* CDVAssetLibraryFilesystem.m */ = {isa = PBXFileReference; name = "CDVAssetLibraryFilesystem.m"; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
- CB882AF1B8AA440C871B5841 /* CDVFile.h */ = {isa = PBXFileReference; name = "CDVFile.h"; path = "cordova-plugin-file/CDVFile.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- F0B1357B1AC84CC79FFB7C50 /* CDVLocalFilesystem.h */ = {isa = PBXFileReference; name = "CDVLocalFilesystem.h"; path = "cordova-plugin-file/CDVLocalFilesystem.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
- BF1652E774F1400BA3AC52D3 /* CDVAssetLibraryFilesystem.h */ = {isa = PBXFileReference; name = "CDVAssetLibraryFilesystem.h"; path = "cordova-plugin-file/CDVAssetLibraryFilesystem.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 1D60588F0D05DD3D006BFB54 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 301BF552109A68D80062928A /* libCordova.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 080E96DDFE201D6D7F000001 /* Classes */ = {
- isa = PBXGroup;
- children = (
- 302D95EE14D2391D003F00A1 /* MainViewController.h */,
- 302D95EF14D2391D003F00A1 /* MainViewController.m */,
- 302D95F014D2391D003F00A1 /* MainViewController.xib */,
- 1D3623240D0F684500981E51 /* AppDelegate.h */,
- 1D3623250D0F684500981E51 /* AppDelegate.m */,
- );
- name = Classes;
- path = "TagSpaces/Classes";
- sourceTree = SOURCE_ROOT;
- };
- 19C28FACFE9D520D11CA2CBB /* Products */ = {
- isa = PBXGroup;
- children = (
- 1D6058910D05DD3D006BFB54 /* TagSpaces.app */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
- isa = PBXGroup;
- children = (
- EB87FDF41871DAF40020F90C /* config.xml */,
- EB87FDF31871DA8E0020F90C /* www */,
- EB87FDF11871DA420020F90C /* Staging */,
- 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */,
- 080E96DDFE201D6D7F000001 /* Classes */,
- 307C750510C5A3420062BCA9 /* Plugins */,
- 29B97315FDCFA39411CA2CEA /* Other Sources */,
- 29B97317FDCFA39411CA2CEA /* Resources */,
- 29B97323FDCFA39411CA2CEA /* Frameworks */,
- 19C28FACFE9D520D11CA2CBB /* Products */,
- );
- name = CustomTemplate;
- sourceTree = "<group>";
- };
- 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
- isa = PBXGroup;
- children = (
- 32CA4F630368D1EE00C91783 /* TagSpaces-Prefix.pch */,
- 29B97316FDCFA39411CA2CEA /* main.m */,
- ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */,
- );
- name = "Other Sources";
- path = "TagSpaces";
- sourceTree = "<group>";
- };
- 29B97317FDCFA39411CA2CEA /* Resources */ = {
- isa = PBXGroup;
- children = (
- 0207DA571B56EA530066E2B4 /* Images.xcassets */,
- 3047A50E1AB8057F00498E2A /* config */,
- 8D1107310486CEB800E47090 /* TagSpaces-Info.plist */,
- 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */,
- );
- name = Resources;
- path = "TagSpaces/Resources";
- sourceTree = "<group>";
- };
- 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- );
- name = Frameworks;
- sourceTree = "<group>";
- };
- 301BF52E109A57CC0062928A /* Products */ = {
- isa = PBXGroup;
- children = (
- 301BF535109A57CC0062928A /* libCordova.a */,
- 907D8124214C687600058A10 /* Cordova.framework */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 3047A50E1AB8057F00498E2A /* config */ = {
- isa = PBXGroup;
- children = (
- 3047A50F1AB8059700498E2A /* build-debug.xcconfig */,
- 3047A5101AB8059700498E2A /* build-release.xcconfig */,
- 3047A5111AB8059700498E2A /* build.xcconfig */,
- );
- name = config;
- sourceTree = "<group>";
- };
- 307C750510C5A3420062BCA9 /* Plugins */ = {
- isa = PBXGroup;
- children = (
- 092C2B0C2C7844CB9D043A41 /* Downloader.swift */,
- E4530B4CA9C8414AA5889210 /* CDVFile.m */,
- 4DCE5A08D6304A29AE80946C /* CDVLocalFilesystem.m */,
- 96C1850F8A964922BA4AC443 /* CDVAssetLibraryFilesystem.m */,
- CB882AF1B8AA440C871B5841 /* CDVFile.h */,
- F0B1357B1AC84CC79FFB7C50 /* CDVLocalFilesystem.h */,
- BF1652E774F1400BA3AC52D3 /* CDVAssetLibraryFilesystem.h */,
- );
- name = Plugins;
- path = "TagSpaces/Plugins";
- sourceTree = SOURCE_ROOT;
- };
- EB87FDF11871DA420020F90C /* Staging */ = {
- isa = PBXGroup;
- children = (
- F840E1F0165FE0F500CFE078 /* config.xml */,
- 301BF56E109A69640062928A /* www */,
- );
- name = Staging;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 1D6058900D05DD3D006BFB54 /* TagSpaces */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "TagSpaces" */;
- buildPhases = (
- 304B58A110DAC018002A0835 /* Copy www directory */,
- 1D60588D0D05DD3D006BFB54 /* Resources */,
- 1D60588E0D05DD3D006BFB54 /* Sources */,
- 1D60588F0D05DD3D006BFB54 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- 301BF551109A68C00062928A /* PBXTargetDependency */,
- );
- name = "TagSpaces";
- productName = "TagSpaces";
- productReference = 1D6058910D05DD3D006BFB54 /* TagSpaces.app */;
- productType = "com.apple.product-type.application";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 29B97313FDCFA39411CA2CEA /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 1130;
- TargetAttributes = {
- 1D6058900D05DD3D006BFB54 = {
- ProvisioningStyle = Automatic;
- };
- };
- };
- buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TagSpaces" */;
- compatibilityVersion = "Xcode 11.0";
- developmentRegion = en;
- hasScannedForEncodings = 1;
- knownRegions = (
- en,
- Base,
- );
- mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */;
- projectDirPath = "";
- projectReferences = (
- {
- ProductGroup = 301BF52E109A57CC0062928A /* Products */;
- ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */;
- },
- );
- projectRoot = "";
- targets = (
- 1D6058900D05DD3D006BFB54 /* TagSpaces */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXReferenceProxy section */
- 301BF535109A57CC0062928A /* libCordova.a */ = {
- isa = PBXReferenceProxy;
- fileType = archive.ar;
- path = libCordova.a;
- remoteRef = 301BF534109A57CC0062928A /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 907D8124214C687600058A10 /* Cordova.framework */ = {
- isa = PBXReferenceProxy;
- fileType = wrapper.framework;
- path = Cordova.framework;
- remoteRef = 907D8123214C687600058A10 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
-/* End PBXReferenceProxy section */
-
-/* Begin PBXResourcesBuildPhase section */
- 1D60588D0D05DD3D006BFB54 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */,
- 0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */,
- 6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- 304B58A110DAC018002A0835 /* Copy www directory */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Copy www directory";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"$SRCROOT/TagSpaces/Scripts/copy-www-build-step.sh\"";
- showEnvVarsInLog = 0;
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 1D60588E0D05DD3D006BFB54 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 1D60589B0D05DD56006BFB54 /* main.m in Sources */,
- 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */,
- 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */,
- F833DAD9664D4D998385F691 /* Downloader.swift in Sources */,
- C785352031594E4F9251FB09 /* CDVFile.m in Sources */,
- 345DF1403BE0418CB5433A2B /* CDVLocalFilesystem.m in Sources */,
- 89D3404E8CDE4028B29F3A39 /* CDVAssetLibraryFilesystem.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 301BF551109A68C00062928A /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = CordovaLib;
- targetProxy = 301BF550109A68C00062928A /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
- 1D6058940D05DD3E006BFB54 /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 3047A50F1AB8059700498E2A /* build-debug.xcconfig */;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "TagSpaces/TagSpaces-Prefix.pch";
- GCC_THUMB_SUPPORT = NO;
- GCC_VERSION = "";
- INFOPLIST_FILE = "TagSpaces/TagSpaces-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
- LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
- PRODUCT_BUNDLE_IDENTIFIER = org.tagspaces.mobileapp;
- PRODUCT_NAME = "$(TARGET_NAME)";
- TARGETED_DEVICE_FAMILY = "1,2";
- VALIDATE_WORKSPACE = NO;
- SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
- SWIFT_VERSION = 5;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- };
- name = Debug;
- };
- 1D6058950D05DD3E006BFB54 /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 3047A5101AB8059700498E2A /* build-release.xcconfig */;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- COPY_PHASE_STRIP = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "TagSpaces/TagSpaces-Prefix.pch";
- GCC_THUMB_SUPPORT = NO;
- GCC_VERSION = "";
- INFOPLIST_FILE = "TagSpaces/TagSpaces-Info.plist";
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
- LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
- PRODUCT_BUNDLE_IDENTIFIER = org.tagspaces.mobileapp;
- PRODUCT_NAME = "$(TARGET_NAME)";
- TARGETED_DEVICE_FAMILY = "1,2";
- VALIDATE_WORKSPACE = NO;
- SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
- SWIFT_VERSION = 5;
- };
- name = Release;
- };
- C01FCF4F08A954540054247B /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */;
- buildSettings = {
- CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_THUMB_SUPPORT = NO;
- GCC_VERSION = "";
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = iphoneos;
- SKIP_INSTALL = NO;
- WK_WEB_VIEW_ONLY = 1;
- SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
- SWIFT_VERSION = 5;
- SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- PRODUCT_BUNDLE_IDENTIFIER = org.tagspaces.mobileapp;
- };
- name = Debug;
- };
- C01FCF5008A954540054247B /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */;
- buildSettings = {
- CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_COMMA = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INFINITE_RECURSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
- CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
- CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
- CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
- CLANG_WARN_STRICT_PROTOTYPES = YES;
- CLANG_WARN_SUSPICIOUS_MOVE = YES;
- CLANG_WARN_UNREACHABLE_CODE = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- ENABLE_STRICT_OBJC_MSGSEND = YES;
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_NO_COMMON_BLOCKS = YES;
- GCC_THUMB_SUPPORT = NO;
- GCC_VERSION = "";
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- SDKROOT = iphoneos;
- SKIP_INSTALL = NO;
- WK_WEB_VIEW_ONLY = 1;
- SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h";
- ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
- SWIFT_VERSION = 5;
- PRODUCT_BUNDLE_IDENTIFIER = org.tagspaces.mobileapp;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "TagSpaces" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1D6058940D05DD3E006BFB54 /* Debug */,
- 1D6058950D05DD3E006BFB54 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TagSpaces" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- C01FCF4F08A954540054247B /* Debug */,
- C01FCF5008A954540054247B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
-}
diff --git a/cordova/platforms/ios/TagSpaces.xcworkspace/contents.xcworkspacedata b/cordova/platforms/ios/TagSpaces.xcworkspace/contents.xcworkspacedata
deleted file mode 100644
index a605415dd..000000000
--- a/cordova/platforms/ios/TagSpaces.xcworkspace/contents.xcworkspacedata
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
- version = "1.0">
- <FileRef
- location = "group:TagSpaces.xcodeproj">
- </FileRef>
-</Workspace>
diff --git a/cordova/platforms/ios/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/UserInterfaceState.xcuserstate b/cordova/platforms/ios/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/UserInterfaceState.xcuserstate
deleted file mode 100644
index a29bed694..000000000
Binary files a/cordova/platforms/ios/TagSpaces.xcworkspace/xcuserdata/sytolk.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Bridging-Header.h b/cordova/platforms/ios/TagSpaces/Bridging-Header.h
deleted file mode 100644
index 5d8abc988..000000000
--- a/cordova/platforms/ios/TagSpaces/Bridging-Header.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-//
-// Bridging-Header.h
-// __PROJECT_NAME__
-//
-// Created by ___FULLUSERNAME___ on ___DATE___.
-// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
-//
-// Use this file to import your target's public headers that you would like to expose to Swift.
-//
-
-#import <Cordova/CDV.h>
diff --git a/cordova/platforms/ios/TagSpaces/Classes/AppDelegate.m b/cordova/platforms/ios/TagSpaces/Classes/AppDelegate.m
deleted file mode 100644
index 6dcfd22cf..000000000
--- a/cordova/platforms/ios/TagSpaces/Classes/AppDelegate.m
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-//
-// AppDelegate.m
-// TagSpaces
-//
-// Created by ___FULLUSERNAME___ on ___DATE___.
-// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
-
-#import "AppDelegate.h"
-#import "MainViewController.h"
-
-@implementation AppDelegate
-
-- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
-{
- self.viewController = [[MainViewController alloc] init];
- return [super application:application didFinishLaunchingWithOptions:launchOptions];
-}
-
-@end
diff --git a/cordova/platforms/ios/TagSpaces/Classes/MainViewController.m b/cordova/platforms/ios/TagSpaces/Classes/MainViewController.m
deleted file mode 100644
index 312a297cd..000000000
--- a/cordova/platforms/ios/TagSpaces/Classes/MainViewController.m
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-//
-// MainViewController.h
-// TagSpaces
-//
-// Created by ___FULLUSERNAME___ on ___DATE___.
-// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
-
-#import "MainViewController.h"
-
-@implementation MainViewController
-
-- (id)initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)nibBundleOrNil
-{
- self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
- if (self) {
- // Uncomment to override the CDVCommandDelegateImpl used
- // _commandDelegate = [[MainCommandDelegate alloc] initWithViewController:self];
- // Uncomment to override the CDVCommandQueue used
- // _commandQueue = [[MainCommandQueue alloc] initWithViewController:self];
- }
- return self;
-}
-
-- (id)init
-{
- self = [super init];
- if (self) {
- // Uncomment to override the CDVCommandDelegateImpl used
- // _commandDelegate = [[MainCommandDelegate alloc] initWithViewController:self];
- // Uncomment to override the CDVCommandQueue used
- // _commandQueue = [[MainCommandQueue alloc] initWithViewController:self];
- }
- return self;
-}
-
-- (void)didReceiveMemoryWarning
-{
- // Releases the view if it doesn't have a superview.
- [super didReceiveMemoryWarning];
-
- // Release any cached data, images, etc that aren't in use.
-}
-
-#pragma mark View lifecycle
-
-- (void)viewWillAppear:(BOOL)animated
-{
- // View defaults to full size. If you want to customize the view's size, or its subviews (e.g. webView),
- // you can do so here.
-
- [super viewWillAppear:animated];
-}
-
-- (void)viewDidLoad
-{
- [super viewDidLoad];
- [self.launchView setAlpha:1];
-}
-
-@end
-
-@implementation MainCommandDelegate
-
-/* To override the methods, uncomment the line in the init function(s)
- in MainViewController.m
- */
-
-#pragma mark CDVCommandDelegate implementation
-
-- (id)getCommandInstance:(NSString*)className
-{
- return [super getCommandInstance:className];
-}
-
-- (NSString*)pathForResource:(NSString*)resourcepath
-{
- return [super pathForResource:resourcepath];
-}
-
-@end
-
-@implementation MainCommandQueue
-
-/* To override, uncomment the line in the init function(s)
- in MainViewController.m
- */
-- (BOOL)execute:(CDVInvokedUrlCommand*)command
-{
- return [super execute:command];
-}
-
-@end
diff --git a/cordova/platforms/ios/TagSpaces/Classes/MainViewController.xib b/cordova/platforms/ios/TagSpaces/Classes/MainViewController.xib
deleted file mode 100644
index e45d65c61..000000000
--- a/cordova/platforms/ios/TagSpaces/Classes/MainViewController.xib
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
--->
-<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
- <data>
- <int key="IBDocument.SystemTarget">1280</int>
- <string key="IBDocument.SystemVersion">11C25</string>
- <string key="IBDocument.InterfaceBuilderVersion">1919</string>
- <string key="IBDocument.AppKitVersion">1138.11</string>
- <string key="IBDocument.HIToolboxVersion">566.00</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
- <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">916</string>
- </object>
- <array key="IBDocument.IntegratedClassDependencies">
- <string>IBProxyObject</string>
- <string>IBUIView</string>
- </array>
- <array key="IBDocument.PluginDependencies">
- <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- </array>
- <object class="NSMutableDictionary" key="IBDocument.Metadata">
- <string key="NS.key.0">PluginDependencyRecalculationVersion</string>
- <integer value="1" key="NS.object.0"/>
- </object>
- <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
- <object class="IBProxyObject" id="372490531">
- <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
- <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- </object>
- <object class="IBProxyObject" id="975951072">
- <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
- <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- </object>
- <object class="IBUIView" id="191373211">
- <reference key="NSNextResponder"/>
- <int key="NSvFlags">274</int>
- <string key="NSFrame">{{0, 20}, {320, 460}}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
- <object class="NSColor" key="IBUIBackgroundColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MQA</bytes>
- <object class="NSColorSpace" key="NSCustomColorSpace">
- <int key="NSID">2</int>
- </object>
- </object>
- <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
- <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
- </object>
- </array>
- <object class="IBObjectContainer" key="IBDocument.Objects">
- <array class="NSMutableArray" key="connectionRecords">
- <object class="IBConnectionRecord">
- <object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">view</string>
- <reference key="source" ref="372490531"/>
- <reference key="destination" ref="191373211"/>
- </object>
- <int key="connectionID">3</int>
- </object>
- </array>
- <object class="IBMutableOrderedSet" key="objectRecords">
- <array key="orderedObjects">
- <object class="IBObjectRecord">
- <int key="objectID">0</int>
- <array key="object" id="0"/>
- <reference key="children" ref="1000"/>
- <nil key="parent"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">1</int>
- <reference key="object" ref="191373211"/>
- <reference key="parent" ref="0"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-1</int>
- <reference key="object" ref="372490531"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">File's Owner</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-2</int>
- <reference key="object" ref="975951072"/>
- <reference key="parent" ref="0"/>
- </object>
- </array>
- </object>
- <dictionary class="NSMutableDictionary" key="flattenedProperties">
- <string key="-1.CustomClassName">MainViewController</string>
- <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="-2.CustomClassName">UIResponder</string>
- <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- </dictionary>
- <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
- <nil key="activeLocalization"/>
- <dictionary class="NSMutableDictionary" key="localizations"/>
- <nil key="sourceID"/>
- <int key="maxID">3</int>
- </object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <array class="NSMutableArray" key="referencedPartialClassDescriptions">
- <object class="IBPartialClassDescription">
- <string key="className">MainViewController</string>
- <string key="superclassName">UIViewController</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">./Classes/MainViewController.h</string>
- </object>
- </object>
- </array>
- </object>
- <int key="IBDocument.localizationMode">0</int>
- <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
- <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
- <int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">916</string>
- </data>
-</archive>
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/Contents.json b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/Contents.json
deleted file mode 100644
index 2ce78c1b3..000000000
--- a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/Contents.json
+++ /dev/null
@@ -1,241 +0,0 @@
-{
- "images" : [
- {
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "[email protected]",
- "scale" : "3x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "icon-29.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "[email protected]",
- "scale" : "3x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "[email protected]",
- "scale" : "3x"
- },
- {
- "size" : "57x57",
- "idiom" : "iphone",
- "filename" : "icon.png",
- "scale" : "1x"
- },
- {
- "size" : "57x57",
- "idiom" : "iphone",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "[email protected]",
- "scale" : "3x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "icon-20.png",
- "scale" : "1x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "icon-29.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "icon-40.png",
- "scale" : "1x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "50x50",
- "idiom" : "ipad",
- "filename" : "icon-50.png",
- "scale" : "1x"
- },
- {
- "size" : "50x50",
- "idiom" : "ipad",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "72x72",
- "idiom" : "ipad",
- "filename" : "icon-72.png",
- "scale" : "1x"
- },
- {
- "size" : "72x72",
- "idiom" : "ipad",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "icon-76.png",
- "scale" : "1x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "83.5x83.5",
- "idiom" : "ipad",
- "filename" : "[email protected]",
- "scale" : "2x"
- },
- {
- "size" : "1024x1024",
- "idiom" : "ios-marketing",
- "filename" : "icon-1024.png",
- "scale" : "1x"
- },
- {
- "size" : "24x24",
- "idiom" : "watch",
- "filename" : "[email protected]",
- "scale" : "2x",
- "role" : "notificationCenter",
- "subtype" : "38mm"
- },
- {
- "size" : "27.5x27.5",
- "idiom" : "watch",
- "filename" : "[email protected]",
- "scale" : "2x",
- "role" : "notificationCenter",
- "subtype" : "42mm"
- },
- {
- "size" : "29x29",
- "idiom" : "watch",
- "filename" : "[email protected]",
- "role" : "companionSettings",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "watch",
- "filename" : "[email protected]",
- "role" : "companionSettings",
- "scale" : "3x"
- },
- {
- "size" : "40x40",
- "idiom" : "watch",
- "filename" : "[email protected]",
- "scale" : "2x",
- "role" : "appLauncher",
- "subtype" : "38mm"
- },
- {
- "size" : "44x44",
- "idiom" : "watch",
- "filename" : "[email protected]",
- "scale" : "2x",
- "role" : "appLauncher",
- "subtype" : "40mm"
- },
- {
- "size" : "50x50",
- "idiom" : "watch",
- "filename" : "[email protected]",
- "scale" : "2x",
- "role" : "appLauncher",
- "subtype" : "44mm"
- },
- {
- "size" : "86x86",
- "idiom" : "watch",
- "filename" : "[email protected]",
- "scale" : "2x",
- "role" : "quickLook",
- "subtype" : "38mm"
- },
- {
- "size" : "98x98",
- "idiom" : "watch",
- "filename" : "[email protected]",
- "scale" : "2x",
- "role" : "quickLook",
- "subtype" : "42mm"
- },
- {
- "size" : "108x108",
- "idiom" : "watch",
- "scale" : "2x",
- "role" : "quickLook",
- "subtype" : "44mm"
- },
- {
- "size" : "1024x1024",
- "idiom" : "watch-marketing",
- "filename" : "icon-1024.png",
- "scale" : "1x"
- }
- ],
- "info" : {
- "version" : 1,
- "author" : "xcode"
- }
-}
\ No newline at end of file
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-1024.png b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-1024.png
deleted file mode 100644
index 1b9cbb91e..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-1024.png and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-20.png b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-20.png
deleted file mode 100644
index 5788eed9f..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-20.png and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index 4feefdf8c..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index 69ce592c2..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index f0babf9d3..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index 78f21bb35..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-29.png b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-29.png
deleted file mode 100644
index 5dff98e93..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-29.png and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index 34b390857..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index c63fd7766..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-40.png b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-40.png
deleted file mode 100644
index 4feefdf8c..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-40.png and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index 328973636..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index 01c5af720..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-50.png b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-50.png
deleted file mode 100644
index 81f93f16c..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-50.png and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index a980efe1c..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index 1e794a481..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index db10c5532..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-72.png b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-72.png
deleted file mode 100644
index 097f5b40a..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-72.png and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index e3d49a2f1..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-76.png b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-76.png
deleted file mode 100644
index aa6810c37..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon-76.png and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index da3a050ff..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index 039a02aef..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index f32a034a0..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index 85ec9e369..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon.png b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon.png
deleted file mode 100644
index bbdba9ee0..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/icon.png and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] b/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected]
deleted file mode 100644
index 41e6be4a6..000000000
Binary files a/cordova/platforms/ios/TagSpaces/Images.xcassets/AppIcon.appiconset/[email protected] and /dev/null differ
diff --git a/cordova/platforms/ios/TagSpaces/Scripts/copy-www-build-step.sh b/cordova/platforms/ios/TagSpaces/Scripts/copy-www-build-step.sh
deleted file mode 100755
index ba0a1b47d..000000000
--- a/cordova/platforms/ios/TagSpaces/Scripts/copy-www-build-step.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-# This script copies the www directory into the Xcode project.
-#
-# This script should not be called directly.
-# It is called as a build step from Xcode.
-
-SRC_DIR="www"
-DST_DIR="$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME"
-DST_DIR_WWW="$DST_DIR/www"
-COPY_HIDDEN=
-ORIG_IFS=$IFS
-IFS=$(echo -en "\n\b")
-
-if [[ -z "$BUILT_PRODUCTS_DIR" ]]; then
- echo "The script is meant to be run as an Xcode build step and relies on env variables set by Xcode."
- exit 1
-fi
-
-if [[ ! -e "$SRC_DIR" ]]; then
- echo "error: Path does not exist: $SRC_DIR"
- exit 2
-fi
-
-rm -rf "$DST_DIR_WWW"
-
-# Copy www dir recursively
-CODE=
-if [[ -n $COPY_HIDDEN ]]; then
- rsync -Lra "$SRC_DIR" "$DST_DIR"
- CODE=$?
-else
- rsync -Lra --exclude="- .*" "$SRC_DIR" "$DST_DIR"
- CODE=$?
-fi
-
-if [ $CODE -ne 0 ]; then
- echo "error: Error occurred on copying www. Code $CODE"
- exit 3
-fi
-
-# Copy the config.xml file.
-cp -f "${PROJECT_FILE_PATH%.xcodeproj}/config.xml" "$DST_DIR"
-
-IFS=$ORIG_IFS
diff --git a/cordova/platforms/ios/TagSpaces/TagSpaces-Info.plist b/cordova/platforms/ios/TagSpaces/TagSpaces-Info.plist
deleted file mode 100644
index 1616947ce..000000000
--- a/cordova/platforms/ios/TagSpaces/TagSpaces-Info.plist
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>en_US</string>
- <key>CFBundleDisplayName</key>
- <string>TagSpaces</string>
- <key>CFBundleExecutable</key>
- <string>$(EXECUTABLE_NAME)</string>
- <key>CFBundleIdentifier</key>
- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>$(PRODUCT_NAME)</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>1.0.0</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0.0</string>
- <key>LSRequiresIPhoneOS</key>
- <true/>
- <key>NSMainNibFile</key>
- <string/>
- <key>NSMainNibFile~ipad</key>
- <string/>
- <key>UILaunchStoryboardName</key>
- <string>CDVLaunchScreen</string>
- <key>UIRequiresFullScreen</key>
- <true/>
- <key>UISupportedInterfaceOrientations</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- <string>UIInterfaceOrientationLandscapeLeft</string>
- <string>UIInterfaceOrientationLandscapeRight</string>
- </array>
- <key>UISupportedInterfaceOrientations~ipad</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- <string>UIInterfaceOrientationLandscapeLeft</string>
- <string>UIInterfaceOrientationPortraitUpsideDown</string>
- <string>UIInterfaceOrientationLandscapeRight</string>
- </array>
- <key>NSAppTransportSecurity</key>
- <dict>
- <key>NSAllowsArbitraryLoads</key>
- <true/>
- </dict>
-</dict>
-</plist>
\ No newline at end of file
diff --git a/cordova/platforms/ios/cordova/Api.js b/cordova/platforms/ios/cordova/Api.js
index 5532c19c8..204138653 100644
--- a/cordova/platforms/ios/cordova/Api.js
+++ b/cordova/platforms/ios/cordova/Api.js
@@ -17,690 +17,4 @@
under the License.
*/
-/* jslint node: true */
-
-/**
- * @todo update coho to update this line.
- * @todo use `package.json` instead but first
- * figure out how this fit in with the platform-centered workflow structure.
- * This workflow would not have the `package.json` file.
- */
-// Coho updates this line
-const VERSION = '6.2.0';
-
-const fs = require('fs-extra');
-const path = require('path');
-const unorm = require('unorm');
-const projectFile = require('./lib/projectFile');
-const check_reqs = require('./lib/check_reqs');
-const CordovaError = require('cordova-common').CordovaError;
-const CordovaLogger = require('cordova-common').CordovaLogger;
-const events = require('cordova-common').events;
-const PluginManager = require('cordova-common').PluginManager;
-const util = require('util');
-const xcode = require('xcode');
-const ConfigParser = require('cordova-common').ConfigParser;
-
-function setupEvents (externalEventEmitter) {
- if (externalEventEmitter) {
- // This will make the platform internal events visible outside
- events.forwardEventsTo(externalEventEmitter);
- } else {
- // There is no logger if external emitter is not present,
- // so attach a console logger
- CordovaLogger.get().subscribe(events);
- }
-}
-
-function getVariableSpec (spec, options) {
- return spec.includes('$') ? options.cli_variables[spec.replace('$', '')] : spec;
-}
-
-/**
- * Creates a new PlatformApi instance.
- *
- * @param {String} [platform] Platform name, used for backward compatibility
- * w/ PlatformPoly (CordovaLib).
- * @param {String} [platformRootDir] Platform root location, used for backward
- * compatibility w/ PlatformPoly (CordovaLib).
- * @param {EventEmitter} [events] An EventEmitter instance that will be used for
- * logging purposes. If no EventEmitter provided, all events will be logged to
- * console
- */
-function Api (platform, platformRootDir, events) {
- // 'platform' property is required as per PlatformApi spec
- this.platform = platform || 'ios';
- this.root = platformRootDir || path.resolve(__dirname, '..');
-
- setupEvents(events);
-
- let xcodeProjDir;
- let xcodeCordovaProj;
-
- try {
- const xcodeProjDir_array = fs.readdirSync(this.root).filter(e => e.match(/\.xcodeproj$/i));
- if (xcodeProjDir_array.length > 1) {
- for (let x = 0; x < xcodeProjDir_array.length; x++) {
- if (xcodeProjDir_array[x].substring(0, 2) === '._') {
- xcodeProjDir_array.splice(x, 1);
- }
- }
- }
- xcodeProjDir = xcodeProjDir_array[0];
-
- if (!xcodeProjDir) {
- throw new CordovaError(`The provided path "${this.root}" is not a Cordova iOS project.`);
- }
-
- const cordovaProjName = xcodeProjDir.substring(xcodeProjDir.lastIndexOf(path.sep) + 1, xcodeProjDir.indexOf('.xcodeproj'));
- xcodeCordovaProj = path.join(this.root, cordovaProjName);
- } catch (e) {
- throw new CordovaError(`The provided path "${this.root}" is not a Cordova iOS project.`);
- }
-
- this.locations = {
- root: this.root,
- www: path.join(this.root, 'www'),
- platformWww: path.join(this.root, 'platform_www'),
- configXml: path.join(xcodeCordovaProj, 'config.xml'),
- defaultConfigXml: path.join(this.root, 'cordova/defaults.xml'),
- pbxproj: path.join(this.root, xcodeProjDir, 'project.pbxproj'),
- xcodeProjDir: path.join(this.root, xcodeProjDir),
- xcodeCordovaProj
- };
-}
-
-/**
- * Creates platform in a specified directory.
- *
- * @param {String} destination Destination directory, where install platform to
- * @param {ConfigParser} [config] ConfigParser instance, used to retrieve
- * project creation options, such as package id and project name.
- * @param {Object} [options] An options object. The most common options are:
- * @param {String} [options.customTemplate] A path to custom template, that
- * should override the default one from platform.
- * @param {Boolean} [options.link] Flag that indicates that platform's
- * sources will be linked to installed platform instead of copying.
- * @param {EventEmitter} [events] An EventEmitter instance that will be used for
- * logging purposes. If no EventEmitter provided, all events will be logged to
- * console
- *
- * @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi
- * instance or rejected with CordovaError.
- */
-Api.createPlatform = (destination, config, options, events) => {
- setupEvents(events);
-
- // CB-6992 it is necessary to normalize characters
- // because node and shell scripts handles unicode symbols differently
- // We need to normalize the name to NFD form since iOS uses NFD unicode form
- const name = unorm.nfd(config.name());
- let result;
- try {
- result = require('../../../lib/create')
- .createProject(destination, config.getAttribute('ios-CFBundleIdentifier') || config.packageName(), name, options, config)
- .then(() => {
- // after platform is created we return Api instance based on new Api.js location
- // This is required to correctly resolve paths in the future api calls
- const PlatformApi = require(path.resolve(destination, 'cordova/Api'));
- return new PlatformApi('ios', destination, events);
- });
- } catch (e) {
- events.emit('error', 'createPlatform is not callable from the iOS project API.');
- throw e;
- }
- return result;
-};
-
-/**
- * Updates already installed platform.
- *
- * @param {String} destination Destination directory, where platform installed
- * @param {Object} [options] An options object. The most common options are:
- * @param {String} [options.customTemplate] A path to custom template, that
- * should override the default one from platform.
- * @param {Boolean} [options.link] Flag that indicates that platform's
- * sources will be linked to installed platform instead of copying.
- * @param {EventEmitter} [events] An EventEmitter instance that will be used for
- * logging purposes. If no EventEmitter provided, all events will be logged to
- * console
- *
- * @return {Promise<PlatformApi>} Promise either fulfilled with PlatformApi
- * instance or rejected with CordovaError.
- */
-Api.updatePlatform = (destination, options, events) => {
- setupEvents(events);
-
- let result;
- try {
- result = require('../../../lib/create')
- .updateProject(destination, options)
- .then(() => {
- const PlatformApi = require(path.resolve(destination, 'cordova/Api'));
- return new PlatformApi('ios', destination, events);
- });
- } catch (e) {
- events.emit('error', 'updatePlatform is not callable from the iOS project API, you will need to do this manually.');
- throw e;
- }
- return result;
-};
-
-/**
- * Gets a CordovaPlatform object, that represents the platform structure.
- *
- * @return {CordovaPlatform} A structure that contains the description of
- * platform's file structure and other properties of platform.
- */
-Api.prototype.getPlatformInfo = function () {
- const result = {};
- result.locations = this.locations;
- result.root = this.root;
- result.name = this.platform;
- result.version = Api.version();
- result.projectConfig = new ConfigParser(this.locations.configXml);
-
- return result;
-};
-
-/**
- * Updates installed platform with provided www assets and new app
- * configuration. This method is required for CLI workflow and will be called
- * each time before build, so the changes, made to app configuration and www
- * code, will be applied to platform.
- *
- * @param {CordovaProject} cordovaProject A CordovaProject instance, that defines a
- * project structure and configuration, that should be applied to platform
- * (contains project's www location and ConfigParser instance for project's
- * config).
- *
- * @return {Promise} Return a promise either fulfilled, or rejected with
- * CordovaError instance.
- */
-Api.prototype.prepare = function (cordovaProject) {
- cordovaProject.projectConfig = new ConfigParser(cordovaProject.locations.rootConfigXml || cordovaProject.projectConfig.path);
-
- return require('./lib/prepare').prepare.call(this, cordovaProject);
-};
-
-/**
- * Installs a new plugin into platform. It doesn't resolves plugin dependencies.
- *
- * @param {PluginInfo} plugin A PluginInfo instance that represents plugin
- * that will be installed.
- * @param {Object} installOptions An options object. Possible options below:
- * @param {Boolean} installOptions.link: Flag that specifies that plugin
- * sources will be symlinked to app's directory instead of copying (if
- * possible).
- * @param {Object} installOptions.variables An object that represents
- * variables that will be used to install plugin. See more details on plugin
- * variables in documentation:
- * https://cordova.apache.org/docs/en/4.0.0/plugin_ref_spec.md.html
- *
- * @return {Promise} Return a promise either fulfilled, or rejected with
- * CordovaError instance.
- */
-Api.prototype.addPlugin = function (plugin, installOptions) {
- const xcodeproj = projectFile.parse(this.locations);
-
- installOptions = installOptions || {};
- installOptions.variables = installOptions.variables || {};
- // Add PACKAGE_NAME variable into vars
- if (!installOptions.variables.PACKAGE_NAME) {
- installOptions.variables.PACKAGE_NAME = xcodeproj.getPackageName();
- }
-
- return PluginManager.get(this.platform, this.locations, xcodeproj)
- .addPlugin(plugin, installOptions)
- .then(() => {
- if (plugin != null) {
- const headerTags = plugin.getHeaderFiles(this.platform);
- const bridgingHeaders = headerTags.filter(obj => obj.type === 'BridgingHeader');
- if (bridgingHeaders.length > 0) {
- const project_dir = this.locations.root;
- const project_name = this.locations.xcodeCordovaProj.split('/').pop();
- const BridgingHeader = require('./lib/BridgingHeader').BridgingHeader;
- const bridgingHeaderFile = new BridgingHeader(path.join(project_dir, project_name, 'Bridging-Header.h'));
- events.emit('verbose', 'Adding Bridging-Headers since the plugin contained <header-file> with type="BridgingHeader"');
- bridgingHeaders.forEach(obj => {
- const bridgingHeaderPath = path.basename(obj.src);
- bridgingHeaderFile.addHeader(plugin.id, bridgingHeaderPath);
- });
- bridgingHeaderFile.write();
- }
- }
- })
- .then(() => {
- if (plugin != null) {
- const podSpecs = plugin.getPodSpecs ? plugin.getPodSpecs(this.platform) : [];
- const frameworkTags = plugin.getFrameworks(this.platform);
- const frameworkPods = frameworkTags.filter(obj => obj.type === 'podspec');
- return this.addPodSpecs(plugin, podSpecs, frameworkPods, installOptions);
- }
- })
- // CB-11022 Return truthy value to prevent running prepare after
- .then(() => true);
-};
-
-/**
- * Removes an installed plugin from platform.
- *
- * Since method accepts PluginInfo instance as input parameter instead of plugin
- * id, caller shoud take care of managing/storing PluginInfo instances for
- * future uninstalls.
- *
- * @param {PluginInfo} plugin A PluginInfo instance that represents plugin
- * that will be installed.
- *
- * @return {Promise} Return a promise either fulfilled, or rejected with
- * CordovaError instance.
- */
-Api.prototype.removePlugin = function (plugin, uninstallOptions) {
- const xcodeproj = projectFile.parse(this.locations);
-
- return PluginManager.get(this.platform, this.locations, xcodeproj)
- .removePlugin(plugin, uninstallOptions)
- .then(() => {
- if (plugin != null) {
- const headerTags = plugin.getHeaderFiles(this.platform);
- const bridgingHeaders = headerTags.filter(obj => obj.type === 'BridgingHeader');
- if (bridgingHeaders.length > 0) {
- const project_dir = this.locations.root;
- const project_name = this.locations.xcodeCordovaProj.split('/').pop();
- const BridgingHeader = require('./lib/BridgingHeader').BridgingHeader;
- const bridgingHeaderFile = new BridgingHeader(path.join(project_dir, project_name, 'Bridging-Header.h'));
- events.emit('verbose', 'Removing Bridging-Headers since the plugin contained <header-file> with type="BridgingHeader"');
- bridgingHeaders.forEach(obj => {
- const bridgingHeaderPath = path.basename(obj.src);
- bridgingHeaderFile.removeHeader(plugin.id, bridgingHeaderPath);
- });
- bridgingHeaderFile.write();
- }
- }
- })
- .then(() => {
- if (plugin != null) {
- const podSpecs = plugin.getPodSpecs ? plugin.getPodSpecs(this.platform) : [];
- const frameworkTags = plugin.getFrameworks(this.platform);
- const frameworkPods = frameworkTags.filter(obj => obj.type === 'podspec');
- return this.removePodSpecs(plugin, podSpecs, frameworkPods, uninstallOptions);
- }
- })
- // CB-11022 Return truthy value to prevent running prepare after
- .then(() => true);
-};
-
-/**
- * adding CocoaPods libraries
- *
- * @param {PluginInfo} plugin A PluginInfo instance that represents plugin
- * that will be installed.
- * @param {Object} podSpecs: the return value of plugin.getPodSpecs(this.platform)
- * @param {Object} frameworkPods: framework tags object with type === 'podspec'
- * @return {Promise} Return a promise
- */
-
-Api.prototype.addPodSpecs = function (plugin, podSpecs, frameworkPods, installOptions) {
- const project_dir = this.locations.root;
- const project_name = this.locations.xcodeCordovaProj.split('/').pop();
- const minDeploymentTarget = this.getPlatformInfo().projectConfig.getPreference('deployment-target', 'ios');
-
- const Podfile = require('./lib/Podfile').Podfile;
- const PodsJson = require('./lib/PodsJson').PodsJson;
- const podsjsonFile = new PodsJson(path.join(project_dir, PodsJson.FILENAME));
- const podfileFile = new Podfile(path.join(project_dir, Podfile.FILENAME), project_name, minDeploymentTarget);
-
- if (podSpecs.length) {
- events.emit('verbose', 'Adding pods since the plugin contained <podspecs>');
- podSpecs.forEach(obj => {
- // declarations
- if (obj.declarations) {
- Object.keys(obj.declarations).forEach(key => {
- if (obj.declarations[key] === 'true') {
- const declaration = Podfile.proofDeclaration(key);
- const podJson = {
- declaration
- };
- const val = podsjsonFile.getDeclaration(declaration);
- if (val) {
- podsjsonFile.incrementDeclaration(declaration);
- } else {
- podJson.count = 1;
- podsjsonFile.setJsonDeclaration(declaration, podJson);
- podfileFile.addDeclaration(podJson.declaration);
- }
- }
- });
- }
-
- // sources
- if (obj.sources) {
- Object.keys(obj.sources).forEach(key => {
- const podJson = {
- source: obj.sources[key].source
- };
- const val = podsjsonFile.getSource(key);
- if (val) {
- podsjsonFile.incrementSource(key);
- } else {
- podJson.count = 1;
- podsjsonFile.setJsonSource(key, podJson);
- podfileFile.addSource(podJson.source);
- }
- });
- }
-
- // libraries
- if (obj.libraries) {
- Object.keys(obj.libraries).forEach(key => {
- const podJson = Object.assign({}, obj.libraries[key]);
- if (podJson.spec) {
- podJson.spec = getVariableSpec(podJson.spec, installOptions);
- }
- const val = podsjsonFile.getLibrary(key);
- if (val) {
- events.emit('warn', `${plugin.id} depends on ${podJson.name}, which may conflict with another plugin. ${podJson.name}@${val.spec} is already installed and was not overwritten.`);
- podsjsonFile.incrementLibrary(key);
- } else {
- podJson.count = 1;
- podsjsonFile.setJsonLibrary(key, podJson);
- podfileFile.addSpec(podJson.name, podJson);
- }
- });
- }
- });
- }
-
- if (frameworkPods.length) {
- events.emit('warn', '"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.');
- events.emit('verbose', 'Adding pods since the plugin contained <framework>(s) with type="podspec"');
- frameworkPods.forEach(obj => {
- const spec = getVariableSpec(obj.spec, installOptions);
- const podJson = {
- name: obj.src,
- type: obj.type,
- spec
- };
-
- const val = podsjsonFile.getLibrary(podJson.name);
- if (val) { // found
- if (podJson.spec !== val.spec) { // exists, different spec, print warning
- events.emit('warn', `${plugin.id} depends on ${podJson.name}@${podJson.spec}, which conflicts with another plugin. ${podJson.name}@${val.spec} is already installed and was not overwritten.`);
- }
- // increment count, but don't add in Podfile because it already exists
- podsjsonFile.incrementLibrary(podJson.name);
- } else { // not found, write new
- podJson.count = 1;
- podsjsonFile.setJsonLibrary(podJson.name, podJson);
- // add to Podfile
- podfileFile.addSpec(podJson.name, podJson.spec);
- }
- });
- }
-
- if (podSpecs.length > 0 || frameworkPods.length > 0) {
- // now that all the pods have been processed, write to pods.json
- podsjsonFile.write();
-
- // only write and pod install if the Podfile changed
- if (podfileFile.isDirty()) {
- podfileFile.write();
- events.emit('verbose', 'Running `pod install` (to install plugins)');
- projectFile.purgeProjectFileCache(this.locations.root);
-
- return podfileFile.install(check_reqs.check_cocoapods)
- .then(() => this.setSwiftVersionForCocoaPodsLibraries(podsjsonFile));
- } else {
- events.emit('verbose', 'Podfile unchanged, skipping `pod install`');
- }
- }
- return Promise.resolve();
-};
-
-/**
- * removing CocoaPods libraries
- *
- * @param {PluginInfo} plugin A PluginInfo instance that represents plugin
- * that will be installed.
- * @param {Object} podSpecs: the return value of plugin.getPodSpecs(this.platform)
- * @param {Object} frameworkPods: framework tags object with type === 'podspec'
- * @return {Promise} Return a promise
- */
-
-Api.prototype.removePodSpecs = function (plugin, podSpecs, frameworkPods, uninstallOptions) {
- const project_dir = this.locations.root;
- const project_name = this.locations.xcodeCordovaProj.split('/').pop();
-
- const Podfile = require('./lib/Podfile').Podfile;
- const PodsJson = require('./lib/PodsJson').PodsJson;
- const podsjsonFile = new PodsJson(path.join(project_dir, PodsJson.FILENAME));
- const podfileFile = new Podfile(path.join(project_dir, Podfile.FILENAME), project_name);
-
- if (podSpecs.length) {
- events.emit('verbose', 'Adding pods since the plugin contained <podspecs>');
- podSpecs.forEach(obj => {
- // declarations
- Object.keys(obj.declarations).forEach(key => {
- if (obj.declarations[key] === 'true') {
- const declaration = Podfile.proofDeclaration(key);
- const podJson = {
- declaration
- };
- const val = podsjsonFile.getDeclaration(declaration);
- if (val) {
- podsjsonFile.decrementDeclaration(declaration);
- } else {
- const message = util.format('plugin \"%s\" declaration \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.declaration); /* eslint no-useless-escape : 0 */
- events.emit('verbose', message);
- }
- if (!val || val.count === 0) {
- podfileFile.removeDeclaration(podJson.declaration);
- }
- }
- });
- // sources
- Object.keys(obj.sources).forEach(key => {
- const podJson = {
- source: obj.sources[key].source
- };
- const val = podsjsonFile.getSource(key);
- if (val) {
- podsjsonFile.decrementSource(key);
- } else {
- const message = util.format('plugin \"%s\" source \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.source); /* eslint no-useless-escape : 0 */
- events.emit('verbose', message);
- }
- if (!val || val.count === 0) {
- podfileFile.removeSource(podJson.source);
- }
- });
- // libraries
- Object.keys(obj.libraries).forEach(key => {
- const podJson = Object.assign({}, obj.libraries[key]);
- if (podJson.spec) {
- podJson.spec = getVariableSpec(podJson.spec, uninstallOptions);
- }
- const val = podsjsonFile.getLibrary(key);
- if (val) {
- podsjsonFile.decrementLibrary(key);
- } else {
- const message = util.format('plugin \"%s\" podspec \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.name); /* eslint no-useless-escape : 0 */
- events.emit('verbose', message);
- }
- if (!val || val.count === 0) {
- podfileFile.removeSpec(podJson.name);
- }
- });
- });
- }
-
- if (frameworkPods.length) {
- events.emit('warn', '"framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag.');
- events.emit('verbose', 'Adding pods since the plugin contained <framework>(s) with type=\"podspec\"'); /* eslint no-useless-escape : 0 */
- frameworkPods.forEach(obj => {
- const spec = getVariableSpec(obj.spec, uninstallOptions);
- const podJson = {
- name: obj.src,
- type: obj.type,
- spec
- };
-
- const val = podsjsonFile.getLibrary(podJson.name);
- if (val) { // found, decrement count
- podsjsonFile.decrementLibrary(podJson.name);
- } else { // not found (perhaps a sync error)
- const message = util.format('plugin \"%s\" podspec \"%s\" does not seem to be in pods.json, nothing to remove. Will attempt to remove from Podfile.', plugin.id, podJson.name); /* eslint no-useless-escape : 0 */
- events.emit('verbose', message);
- }
-
- // always remove from the Podfile
- podfileFile.removeSpec(podJson.name);
- });
- }
-
- if (podSpecs.length > 0 || frameworkPods.length > 0) {
- // now that all the pods have been processed, write to pods.json
- podsjsonFile.write();
-
- if (podfileFile.isDirty()) {
- podfileFile.write();
- events.emit('verbose', 'Running `pod install` (to uninstall pods)');
-
- return podfileFile.install(check_reqs.check_cocoapods)
- .then(() => this.setSwiftVersionForCocoaPodsLibraries(podsjsonFile));
- } else {
- events.emit('verbose', 'Podfile unchanged, skipping `pod install`');
- }
- }
- return Promise.resolve();
-};
-
-/**
- * set Swift Version for all CocoaPods libraries
- *
- * @param {PodsJson} podsjsonFile A PodsJson instance that represents pods.json
- */
-
-Api.prototype.setSwiftVersionForCocoaPodsLibraries = function (podsjsonFile) {
- let __dirty = false;
- return check_reqs.check_cocoapods().then(toolOptions => {
- if (toolOptions.ignore) {
- events.emit('verbose', '=== skip Swift Version Settings For Cocoapods Libraries');
- } else {
- const podPbxPath = path.join(this.root, 'Pods', 'Pods.xcodeproj', 'project.pbxproj');
- const podXcodeproj = xcode.project(podPbxPath);
- podXcodeproj.parseSync();
- const podTargets = podXcodeproj.pbxNativeTargetSection();
- const podConfigurationList = podXcodeproj.pbxXCConfigurationList();
- const podConfigs = podXcodeproj.pbxXCBuildConfigurationSection();
-
- const libraries = podsjsonFile.getLibraries();
- Object.keys(libraries).forEach(key => {
- const podJson = libraries[key];
- const name = podJson.name;
- const swiftVersion = podJson['swift-version'];
- if (swiftVersion) {
- __dirty = true;
- Object.keys(podTargets)
- .filter(targetKey => podTargets[targetKey].productName === name)
- .map(targetKey => podTargets[targetKey].buildConfigurationList)
- .map(buildConfigurationListId => podConfigurationList[buildConfigurationListId])
- .map(buildConfigurationList => buildConfigurationList.buildConfigurations)
- .reduce((acc, buildConfigurations) => acc.concat(buildConfigurations), [])
- .map(buildConfiguration => buildConfiguration.value)
- .forEach(buildId => {
- __dirty = true;
- podConfigs[buildId].buildSettings.SWIFT_VERSION = swiftVersion;
- });
- }
- });
- if (__dirty) {
- fs.writeFileSync(podPbxPath, podXcodeproj.writeSync(), 'utf-8');
- }
- }
- });
-};
-
-/**
- * Builds an application package for current platform.
- *
- * @param {Object} buildOptions A build options. This object's structure is
- * highly depends on platform's specific. The most common options are:
- * @param {Boolean} buildOptions.debug Indicates that packages should be
- * built with debug configuration. This is set to true by default unless the
- * 'release' option is not specified.
- * @param {Boolean} buildOptions.release Indicates that packages should be
- * built with release configuration. If not set to true, debug configuration
- * will be used.
- * @param {Boolean} buildOptions.device Specifies that built app is intended
- * to run on device
- * @param {Boolean} buildOptions.emulator: Specifies that built app is
- * intended to run on emulator
- * @param {String} buildOptions.target Specifies the device id that will be
- * used to run built application.
- * @param {Boolean} buildOptions.nobuild Indicates that this should be a
- * dry-run call, so no build artifacts will be produced.
- * @param {String[]} buildOptions.archs Specifies chip architectures which
- * app packages should be built for. List of valid architectures is depends on
- * platform.
- * @param {String} buildOptions.buildConfig The path to build configuration
- * file. The format of this file is depends on platform.
- * @param {String[]} buildOptions.argv Raw array of command-line arguments,
- * passed to `build` command. The purpose of this property is to pass a
- * platform-specific arguments, and eventually let platform define own
- * arguments processing logic.
- *
- * @return {Promise} Return a promise either fulfilled, or rejected with
- * CordovaError instance.
- */
-Api.prototype.build = function (buildOptions) {
- return check_reqs.run()
- .then(() => require('./lib/build').run.call(this, buildOptions));
-};
-
-/**
- * Builds an application package for current platform and runs it on
- * specified/default device. If no 'device'/'emulator'/'target' options are
- * specified, then tries to run app on default device if connected, otherwise
- * runs the app on emulator.
- *
- * @param {Object} runOptions An options object. The structure is the same
- * as for build options.
- *
- * @return {Promise} A promise either fulfilled if package was built and ran
- * successfully, or rejected with CordovaError.
- */
-Api.prototype.run = function (runOptions) {
- return check_reqs.run()
- .then(() => require('./lib/run').run.call(this, runOptions));
-};
-
-/**
- * Cleans out the build artifacts from platform's directory.
- *
- * @return {Promise} Return a promise either fulfilled, or rejected with
- * CordovaError.
- */
-Api.prototype.clean = function (cleanOptions) {
- return check_reqs.run()
- .then(() => require('./lib/clean').run.call(this, cleanOptions))
- .then(() => require('./lib/prepare').clean.call(this, cleanOptions));
-};
-
-/**
- * Performs a requirements check for current platform. Each platform defines its
- * own set of requirements, which should be resolved before platform can be
- * built successfully.
- *
- * @return {Promise<Requirement[]>} Promise, resolved with set of Requirement
- * objects for current platform.
- */
-Api.prototype.requirements = function () {
- return check_reqs.check_all();
-};
-
-Api.version = function () {
- return VERSION;
-};
-
-module.exports = Api;
+module.exports = require('cordova-ios');
diff --git a/cordova/platforms/ios/cordova/apple_ios_version b/cordova/platforms/ios/cordova/apple_ios_version
new file mode 100755
index 000000000..133a73783
--- /dev/null
+++ b/cordova/platforms/ios/cordova/apple_ios_version
@@ -0,0 +1,24 @@
+#!/usr/bin/env node
+
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+const versions = require('cordova-ios/lib/versions.js');
+
+versions.printOrDie('apple_ios');
diff --git a/cordova/platforms/ios/cordova/apple_osx_version b/cordova/platforms/ios/cordova/apple_osx_version
new file mode 100755
index 000000000..ad484e63b
--- /dev/null
+++ b/cordova/platforms/ios/cordova/apple_osx_version
@@ -0,0 +1,24 @@
+#!/usr/bin/env node
+
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+const versions = require('cordova-ios/lib/versions.js');
+
+versions.printOrDie('apple_osx');
diff --git a/cordova/platforms/ios/cordova/apple_xcode_version b/cordova/platforms/ios/cordova/apple_xcode_version
new file mode 100755
index 000000000..68908b3c2
--- /dev/null
+++ b/cordova/platforms/ios/cordova/apple_xcode_version
@@ -0,0 +1,24 @@
+#!/usr/bin/env node
+
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+const versions = require('cordova-ios/lib/versions.js');
+
+versions.printOrDie('apple_xcode');
diff --git a/cordova/platforms/ios/cordova/build b/cordova/platforms/ios/cordova/build
deleted file mode 100755
index f4b0d9a04..000000000
--- a/cordova/platforms/ios/cordova/build
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var args = process.argv;
-var Api = require('./Api');
-var nopt = require('nopt');
-
-// Support basic help commands
-if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) {
- require('./lib/build').help();
- process.exit(0);
-}
-
-// Parse arguments
-var buildOpts = nopt({
- verbose: Boolean,
- silent: Boolean,
- archs: String,
- debug: Boolean,
- release: Boolean,
- device: Boolean,
- emulator: Boolean,
- codeSignIdentity: String,
- codeSignResourceRules: String,
- provisioningProfile: String,
- automaticProvisioning: Boolean,
- developmentTeam: String,
- packageType: String,
- buildConfig: String,
- buildFlag: [String, Array],
- noSign: Boolean
-}, { '-r': '--release', d: '--verbose' }, args);
-
-// Make buildOptions compatible with PlatformApi build method spec
-buildOpts.argv = buildOpts.argv.remain;
-
-require('./loggingHelper').adjustLoggerLevel(buildOpts);
-
-new Api().build(buildOpts).then(
- () => {
- console.log('** BUILD SUCCEEDED **');
- },
- err => {
- var errorMessage = (err && err.stack) ? err.stack : err;
- console.error(errorMessage);
- process.exit(2);
- }
-);
diff --git a/cordova/platforms/ios/cordova/build-debug.xcconfig b/cordova/platforms/ios/cordova/build-debug.xcconfig
index 7e7985bb5..d7ee4f625 100644
--- a/cordova/platforms/ios/cordova/build-debug.xcconfig
+++ b/cordova/platforms/ios/cordova/build-debug.xcconfig
@@ -22,9 +22,6 @@
//
#include "build.xcconfig"
-
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) DEBUG=1
-
#include "build-extras.xcconfig"
// (CB-11792)
diff --git a/cordova/platforms/ios/cordova/build-release.xcconfig b/cordova/platforms/ios/cordova/build-release.xcconfig
index 70b0f0730..886e82297 100644
--- a/cordova/platforms/ios/cordova/build-release.xcconfig
+++ b/cordova/platforms/ios/cordova/build-release.xcconfig
@@ -22,10 +22,6 @@
//
#include "build.xcconfig"
-
-CODE_SIGN_IDENTITY = iPhone Distribution
-CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Distribution
-
#include "build-extras.xcconfig"
// (CB-11792)
diff --git a/cordova/platforms/ios/cordova/build.bat b/cordova/platforms/ios/cordova/build.bat
deleted file mode 100755
index 2f97fcb47..000000000
--- a/cordova/platforms/ios/cordova/build.bat
+++ /dev/null
@@ -1,19 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License
-
-@ECHO OFF
-ECHO WARN: The 'build' command is not available for cordova-ios on windows machines.>&2
diff --git a/cordova/platforms/ios/cordova/build.xcconfig b/cordova/platforms/ios/cordova/build.xcconfig
index 3c8b9307d..c96c940a2 100644
--- a/cordova/platforms/ios/cordova/build.xcconfig
+++ b/cordova/platforms/ios/cordova/build.xcconfig
@@ -21,25 +21,3 @@
// XCode build settings shared by all Build Configurations.
// Settings are overridden by configuration-level .xcconfig file (build-release/build-debug).
//
-
-HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
-OTHER_LDFLAGS = -ObjC
-
-// Type of signing identity used for codesigning, resolves to first match of given type.
-// "iPhone Developer": Development builds (default, local only; iOS Development certificate) or "iPhone Distribution": Distribution builds (Adhoc/In-House/AppStore; iOS Distribution certificate)
-CODE_SIGN_IDENTITY = iPhone Developer
-CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer
-
-// (CB-9721) Set ENABLE_BITCODE to NO in build.xcconfig
-ENABLE_BITCODE = NO
-
-// (CB-9719) Set CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES to YES in build.xcconfig
-CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
-
-// (CB-10072)
-SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h
-
-// (CB-11854)
-CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist
-
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) WK_WEB_VIEW_ONLY=$(WK_WEB_VIEW_ONLY)
diff --git a/cordova/platforms/ios/cordova/clean b/cordova/platforms/ios/cordova/clean
deleted file mode 100755
index f36a648e5..000000000
--- a/cordova/platforms/ios/cordova/clean
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var Api = require('./Api');
-var nopt = require('nopt');
-
-if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) {
- console.log('Cleans the project directory.');
- process.exit(0);
-}
-
-// Do some basic argument parsing
-var opts = nopt({
- verbose: Boolean,
- silent: Boolean
-}, { d: '--verbose' });
-
-// Make buildOptions compatible with PlatformApi clean method spec
-opts.argv = opts.argv.original;
-
-// Skip cleaning prepared files when not invoking via cordova CLI.
-opts.noPrepare = true;
-
-require('./loggingHelper').adjustLoggerLevel(opts);
-
-new Api().clean(opts).then(
- () => {
- console.log('** CLEAN SUCCEEDED **');
- },
- err => {
- console.error(err);
- process.exit(2);
- }
-);
diff --git a/cordova/platforms/ios/cordova/clean.bat b/cordova/platforms/ios/cordova/clean.bat
deleted file mode 100755
index 583072870..000000000
--- a/cordova/platforms/ios/cordova/clean.bat
+++ /dev/null
@@ -1,19 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License
-
-@ECHO OFF
-ECHO WARN: The 'clean' command is not available for cordova-ios on windows machines.>&2
diff --git a/cordova/platforms/ios/cordova/defaults.xml b/cordova/platforms/ios/cordova/defaults.xml
index 8733ce39f..63db1be01 100644
--- a/cordova/platforms/ios/cordova/defaults.xml
+++ b/cordova/platforms/ios/cordova/defaults.xml
@@ -18,23 +18,18 @@
under the License.
-->
<widget xmlns = "http://www.w3.org/ns/widgets"
- id = "io.cordova.helloCordova"
+ id = "org.apache.cordova.hellocordova"
version = "2.0.0">
<!-- Preferences for iOS -->
<preference name="AllowInlineMediaPlayback" value="false" />
- <preference name="BackupWebStorage" value="cloud" />
<preference name="DisallowOverscroll" value="false" />
<preference name="EnableViewportScale" value="false" />
- <preference name="KeyboardDisplayRequiresUserAction" value="true" />
+ <preference name="MediaPermissionGrantType" value="grantIfSameHostElsePrompt" />
<preference name="MediaTypesRequiringUserActionForPlayback" value="none" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="SuppressesLongPressGesture" value="false" />
<preference name="Suppresses3DTouchGesture" value="false" />
- <preference name="GapBetweenPages" value="0" />
- <preference name="PageLength" value="0" />
- <preference name="PaginationBreakingMode" value="page" /> <!-- page, column -->
- <preference name="PaginationMode" value="unpaginated" /> <!-- unpaginated, leftToRight, topToBottom, bottomToTop, rightToLeft -->
<feature name="CDVWebViewEngine">
<param name="ios-package" value="CDVWebViewEngine" />
@@ -61,5 +56,9 @@
<param name="ios-package" value="CDVGestureHandler"/>
<param name="onload" value="true"/>
</feature>
+ <feature name="StatusBarInternal">
+ <param name="ios-package" value="CDVStatusBarInternal"/>
+ <param name="onload" value="true"/>
+ </feature>
</widget>
diff --git a/cordova/platforms/ios/cordova/lib/BridgingHeader.js b/cordova/platforms/ios/cordova/lib/BridgingHeader.js
deleted file mode 100644
index 9e200b508..000000000
--- a/cordova/platforms/ios/cordova/lib/BridgingHeader.js
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-'use strict';
-
-const fs = require('fs-extra');
-const CordovaError = require('cordova-common').CordovaError;
-
-function BridgingHeader (bridgingHeaderPath) {
- this.path = bridgingHeaderPath;
- this.bridgingHeaders = null;
- if (!fs.existsSync(this.path)) {
- throw new CordovaError('BridgingHeader.h is not found.');
- }
- this.bridgingHeaders = this.__parseForBridgingHeader(fs.readFileSync(this.path, 'utf8'));
-}
-
-BridgingHeader.prototype.addHeader = function (plugin_id, header_path) {
- this.bridgingHeaders.push({ type: 'code', code: `#import "${header_path}"\n` });
-};
-
-BridgingHeader.prototype.removeHeader = function (plugin_id, header_path) {
- this.bridgingHeaders = this.bridgingHeaders.filter(function (line) {
- if (this.found) {
- return true;
- }
- if (line.type === 'code') {
- const re = new RegExp(`#import\\s+"${preg_quote(header_path)}"(\\s*|\\s.+)(\\n|$)`);
- if (re.test(line.code)) {
- this.found = true;
- return false;
- }
- }
- return true;
- }, { found: false });
-};
-
-BridgingHeader.prototype.write = function () {
- const text = this.__stringifyForBridgingHeader(this.bridgingHeaders);
- fs.writeFileSync(this.path, text, 'utf8');
-};
-
-BridgingHeader.prototype.__stringifyForBridgingHeader = function (bridgingHeaders) {
- return bridgingHeaders.map(obj => obj.code).join('');
-};
-
-BridgingHeader.prototype.__parseForBridgingHeader = function (text) {
- let i = 0;
- const list = [];
- let type = 'code';
- let start = 0;
- while (i < text.length) {
- switch (type) {
- case 'comment':
- if (i + 1 < text.length && text[i] === '*' && text[i + 1] === '/') {
- i += 2;
- list.push({ type, code: text.slice(start, i) });
- type = 'code';
- start = i;
- } else {
- i += 1;
- }
- break;
- case 'line-comment':
- if (i < text.length && text[i] === '\n') {
- i += 1;
- list.push({ type, code: text.slice(start, i) });
- type = 'code';
- start = i;
- } else {
- i += 1;
- }
- break;
- case 'code':
- default:
- if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '*') { // comment
- if (start < i) {
- list.push({ type, code: text.slice(start, i) });
- }
- type = 'comment';
- start = i;
- } else if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '/') { // line comment
- if (start < i) {
- list.push({ type, code: text.slice(start, i) });
- }
- type = 'line-comment';
- start = i;
- } else if (i < text.length && text[i] === '\n') {
- i += 1;
- list.push({ type, code: text.slice(start, i) });
- start = i;
- } else {
- i += 1;
- }
- break;
- }
- }
- if (start < i) {
- list.push({ type, code: text.slice(start, i) });
- }
- return list;
-};
-
-function preg_quote (str, delimiter) {
- return (`${str}`).replace(new RegExp(`[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\${delimiter || ''}-]`, 'g'), '\\$&');
-}
-
-module.exports.BridgingHeader = BridgingHeader;
diff --git a/cordova/platforms/ios/cordova/lib/Podfile.js b/cordova/platforms/ios/cordova/lib/Podfile.js
deleted file mode 100644
index f16729744..000000000
--- a/cordova/platforms/ios/cordova/lib/Podfile.js
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-'use strict';
-
-const fs = require('fs-extra');
-const path = require('path');
-const util = require('util');
-const {
- CordovaError,
- events,
- superspawn: { spawn }
-} = require('cordova-common');
-
-Podfile.FILENAME = 'Podfile';
-Podfile.declarationRegexpMap = {
- 'use_frameworks!': 'use[-_]frameworks!?',
- 'inhibit_all_warnings!': 'inhibit[-_]all[-_]warnings!?'
-};
-
-function Podfile (podFilePath, projectName, minDeploymentTarget) {
- this.declarationToken = '##INSERT_DECLARATION##';
- this.sourceToken = '##INSERT_SOURCE##';
- this.podToken = '##INSERT_POD##';
-
- this.path = podFilePath;
- this.projectName = projectName;
- this.minDeploymentTarget = minDeploymentTarget || '11.0';
- this.contents = null;
- this.sources = null;
- this.declarations = null;
- this.pods = null;
- this.__dirty = false;
-
- // check whether it is named Podfile
- const filename = this.path.split(path.sep).pop();
- if (filename !== Podfile.FILENAME) {
- throw new CordovaError(util.format('Podfile: The file at %s is not `%s`.', this.path, Podfile.FILENAME));
- }
-
- if (!projectName) {
- throw new CordovaError('Podfile: The projectName was not specified in the constructor.');
- }
-
- if (!fs.existsSync(this.path)) {
- events.emit('verbose', util.format('Podfile: The file at %s does not exist.', this.path));
- events.emit('verbose', 'Creating new Podfile in platforms/ios');
- this.clear();
- this.write();
- } else {
- events.emit('verbose', 'Podfile found in platforms/ios');
- // parse for pods
- const fileText = fs.readFileSync(this.path, 'utf8');
- this.declarations = this.__parseForDeclarations(fileText);
- this.sources = this.__parseForSources(fileText);
- this.pods = this.__parseForPods(fileText);
- }
-}
-
-Podfile.prototype.__parseForDeclarations = function (text) {
- // split by \n
- const arr = text.split('\n');
-
- // getting lines between "platform :ios, '11.0'"" and "target 'HelloCordova'" do
- const declarationsPreRE = new RegExp('platform :ios,\\s+\'[^\']+\'');
- const declarationsPostRE = new RegExp('target\\s+\'[^\']+\'\\s+do');
- const declarationRE = new RegExp('^\\s*[^#]');
-
- return arr.reduce((acc, line) => {
- switch (acc.state) {
- case 0:
- if (declarationsPreRE.exec(line)) {
- acc.state = 1; // Start to read
- }
- break;
- case 1:
- if (declarationsPostRE.exec(line)) {
- acc.state = 2; // Finish to read
- } else {
- acc.lines.push(line);
- }
- break;
- case 2:
- default:
- // do nothing;
- }
- return acc;
- }, { state: 0, lines: [] })
- .lines
- .filter(line => declarationRE.exec(line))
- .reduce((obj, line) => {
- obj[line] = line;
- return obj;
- }, {});
-};
-
-Podfile.prototype.__parseForSources = function (text) {
- // split by \n
- const arr = text.split('\n');
-
- const sourceRE = new RegExp('source \'(.*)\'');
- return arr.filter(line => {
- const m = sourceRE.exec(line);
-
- return (m !== null);
- })
- .reduce((obj, line) => {
- const m = sourceRE.exec(line);
- if (m !== null) {
- const source = m[1];
- obj[source] = source;
- }
- return obj;
- }, {});
-};
-
-Podfile.prototype.__parseForPods = function (text) {
- // split by \n
- const arr = text.split('\n');
-
- // aim is to match (space insignificant around the comma, comma optional):
- // pod 'Foobar', '1.2'
- // pod 'Foobar', 'abc 123 1.2'
- // pod 'PonyDebugger', :configurations => ['Debug', 'Beta']
- // var podRE = new RegExp('pod \'([^\']*)\'\\s*,?\\s*(.*)');
- const podRE = new RegExp('pod \'([^\']*)\'\\s*(?:,\\s*\'([^\']*)\'\\s*)?,?\\s*(.*)');
-
- // only grab lines that don't have the pod spec'
- return arr.filter(line => {
- const m = podRE.exec(line);
-
- return (m !== null);
- })
- .reduce((obj, line) => {
- const m = podRE.exec(line);
-
- if (m !== null) {
- const podspec = {
- name: m[1]
- };
- if (m[2]) {
- podspec.spec = m[2];
- }
- if (m[3]) {
- podspec.options = m[3];
- }
- obj[m[1]] = podspec; // i.e pod 'Foo', '1.2' ==> { 'Foo' : '1.2'}
- }
-
- return obj;
- }, {});
-};
-
-Podfile.prototype.escapeSingleQuotes = function (string) {
- return string.replace(/'/g, '\\\'');
-};
-
-Podfile.prototype.getTemplate = function () {
- // Escaping possible ' in the project name
- const projectName = this.escapeSingleQuotes(this.projectName);
- return util.format(
- '# DO NOT MODIFY -- auto-generated by Apache Cordova\n' +
- '%s\n' +
- 'platform :ios, \'%s\'\n' +
- '%s\n' +
- 'target \'%s\' do\n' +
- '\tproject \'%s.xcodeproj\'\n' +
- '%s\n' +
- 'end\n',
- this.sourceToken, this.minDeploymentTarget, this.declarationToken, projectName, projectName, this.podToken);
-};
-
-Podfile.prototype.addSpec = function (name, spec) {
- name = name || '';
- // optional
- spec = spec; /* eslint no-self-assign : 0 */
-
- if (!name.length) { // blank names are not allowed
- throw new CordovaError('Podfile addSpec: name is not specified.');
- }
-
- if (typeof spec === 'string') {
- if (spec.startsWith(':')) {
- spec = { name, options: spec };
- } else {
- spec = { name, spec };
- }
- }
-
- this.pods[name] = spec;
- this.__dirty = true;
-
- events.emit('verbose', util.format('Added pod line for `%s`', name));
-};
-
-Podfile.prototype.removeSpec = function (name) {
- if (this.existsSpec(name)) {
- delete this.pods[name];
- this.__dirty = true;
- }
-
- events.emit('verbose', util.format('Removed pod line for `%s`', name));
-};
-
-Podfile.prototype.getSpec = function (name) {
- return this.pods[name];
-};
-
-Podfile.prototype.existsSpec = function (name) {
- return (name in this.pods);
-};
-
-Podfile.prototype.addSource = function (src) {
- this.sources[src] = src;
- this.__dirty = true;
-
- events.emit('verbose', util.format('Added source line for `%s`', src));
-};
-
-Podfile.prototype.removeSource = function (src) {
- if (this.existsSource(src)) {
- delete this.sources[src];
- this.__dirty = true;
- }
-
- events.emit('verbose', util.format('Removed source line for `%s`', src));
-};
-
-Podfile.prototype.existsSource = function (src) {
- return (src in this.sources);
-};
-
-Podfile.prototype.addDeclaration = function (declaration) {
- this.declarations[declaration] = declaration;
- this.__dirty = true;
-
- events.emit('verbose', util.format('Added declaration line for `%s`', declaration));
-};
-
-Podfile.prototype.removeDeclaration = function (declaration) {
- if (this.existsDeclaration(declaration)) {
- delete this.declarations[declaration];
- this.__dirty = true;
- }
-
- events.emit('verbose', util.format('Removed source line for `%s`', declaration));
-};
-
-Podfile.proofDeclaration = declaration => {
- const list = Object.keys(Podfile.declarationRegexpMap).filter(key => {
- const regexp = new RegExp(Podfile.declarationRegexpMap[key]);
- return regexp.test(declaration);
- });
- if (list.length > 0) {
- return list[0];
- }
- return declaration;
-};
-
-Podfile.prototype.existsDeclaration = function (declaration) {
- return (declaration in this.declarations);
-};
-
-Podfile.prototype.clear = function () {
- this.sources = {};
- this.declarations = {};
- this.pods = {};
- this.__dirty = true;
-};
-
-Podfile.prototype.destroy = function () {
- fs.unlinkSync(this.path);
- events.emit('verbose', util.format('Deleted `%s`', this.path));
-};
-
-Podfile.prototype.write = function () {
- let text = this.getTemplate();
-
- const podsString =
- Object.keys(this.pods).map(key => {
- const name = key;
- const json = this.pods[key];
-
- if (typeof json === 'string') { // compatibility for using framework tag.
- const spec = json;
- if (spec.length) {
- if (spec.indexOf(':') === 0) {
- // don't quote it, it's a specification (starts with ':')
- return util.format('\tpod \'%s\', %s', name, spec);
- } else {
- // quote it, it's a version
- return util.format('\tpod \'%s\', \'%s\'', name, spec);
- }
- } else {
- return util.format('\tpod \'%s\'', name);
- }
- } else {
- const list = [`'${name}'`];
- if ('spec' in json && json.spec.length) {
- list.push(`'${json.spec}'`);
- }
-
- let options = ['tag', 'branch', 'commit', 'git', 'podspec']
- .filter(tag => tag in json)
- .map(tag => `:${tag} => '${json[tag]}'`);
-
- if ('configurations' in json) {
- options.push(`:configurations => [${json.configurations.split(',').map(conf => `'${conf.trim()}'`).join(',')}]`);
- }
- if ('options' in json) {
- options = [json.options];
- }
- if (options.length > 0) {
- list.push(options.join(', '));
- }
- return util.format('\tpod %s', list.join(', '));
- }
- }).join('\n');
-
- const sourcesString =
- Object.keys(this.sources).map(key => {
- const source = this.sources[key];
- return util.format('source \'%s\'', source);
- }).join('\n');
-
- const declarationString =
- Object.keys(this.declarations).map(key => {
- const declaration = this.declarations[key];
- return declaration;
- }).join('\n');
-
- text = text.replace(this.podToken, podsString)
- .replace(this.sourceToken, sourcesString)
- .replace(this.declarationToken, declarationString);
-
- fs.writeFileSync(this.path, text, 'utf8');
- this.__dirty = false;
-
- events.emit('verbose', 'Wrote to Podfile.');
-};
-
-Podfile.prototype.isDirty = function () {
- return this.__dirty;
-};
-
-Podfile.prototype.before_install = function (toolOptions) {
- toolOptions = toolOptions || {};
-
- // Template tokens in order: project name, project name, debug | release
- const template =
- '// DO NOT MODIFY -- auto-generated by Apache Cordova\n' +
- '#include "Pods/Target Support Files/Pods-%s/Pods-%s.%s.xcconfig"';
-
- const debugContents = util.format(template, this.projectName, this.projectName, 'debug');
- const releaseContents = util.format(template, this.projectName, this.projectName, 'release');
-
- const debugConfigPath = path.join(this.path, '..', 'pods-debug.xcconfig');
- const releaseConfigPath = path.join(this.path, '..', 'pods-release.xcconfig');
-
- fs.writeFileSync(debugConfigPath, debugContents, 'utf8');
- fs.writeFileSync(releaseConfigPath, releaseContents, 'utf8');
-
- return Promise.resolve(toolOptions);
-};
-
-Podfile.prototype.install = function (requirementsCheckerFunction) {
- const opts = {};
- opts.cwd = path.join(this.path, '..'); // parent path of this Podfile
- opts.stdio = 'pipe';
- opts.printCommand = true;
- let first = true;
-
- if (!requirementsCheckerFunction) {
- requirementsCheckerFunction = Promise.resolve();
- }
-
- return requirementsCheckerFunction()
- .then(toolOptions => this.before_install(toolOptions))
- .then(toolOptions => {
- if (toolOptions.ignore) {
- events.emit('verbose', '==== pod install start ====\n');
- events.emit('verbose', toolOptions.ignoreMessage);
- return Promise.resolve();
- } else {
- return spawn('pod', ['install', '--verbose'], opts)
- .progress(stdio => {
- if (stdio.stderr) { console.error(stdio.stderr); }
- if (stdio.stdout) {
- if (first) {
- events.emit('verbose', '==== pod install start ====\n');
- first = false;
- }
- events.emit('verbose', stdio.stdout);
- }
- });
- }
- })
- .then(() => { // done
- events.emit('verbose', '==== pod install end ====\n');
- });
-};
-
-module.exports.Podfile = Podfile;
diff --git a/cordova/platforms/ios/cordova/lib/PodsJson.js b/cordova/platforms/ios/cordova/lib/PodsJson.js
deleted file mode 100644
index 598d9607b..000000000
--- a/cordova/platforms/ios/cordova/lib/PodsJson.js
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const fs = require('fs-extra');
-const path = require('path');
-const util = require('util');
-const events = require('cordova-common').events;
-const CordovaError = require('cordova-common').CordovaError;
-
-PodsJson.FILENAME = 'pods.json';
-PodsJson.LIBRARY = 'libraries';
-PodsJson.SOURCE = 'sources';
-PodsJson.DECLARATION = 'declarations';
-
-function PodsJson (podsJsonPath) {
- this.path = podsJsonPath;
- this.contents = null;
- this.__dirty = false;
-
- const filename = this.path.split(path.sep).pop();
- if (filename !== PodsJson.FILENAME) {
- throw new CordovaError(util.format('PodsJson: The file at %s is not `%s`.', this.path, PodsJson.FILENAME));
- }
-
- if (!fs.existsSync(this.path)) {
- events.emit('verbose', util.format('pods.json: The file at %s does not exist.', this.path));
- events.emit('verbose', 'Creating new pods.json in platforms/ios');
- this.clear();
- this.write();
- } else {
- events.emit('verbose', 'pods.json found in platforms/ios');
- // load contents
- const contents = fs.readFileSync(this.path, 'utf8');
- this.contents = JSON.parse(contents);
- }
- this.__updateFormatIfNecessary();
-}
-
-PodsJson.prototype.__isOldFormat = function () {
- if (this.contents !== null) {
- if (this.contents.declarations === undefined ||
- this.contents.sources === undefined ||
- this.contents.libraries === undefined) {
- return true;
- }
- }
- return false;
-};
-
-PodsJson.prototype.__updateFormatIfNecessary = function () {
- if (this.__isOldFormat()) {
- this.contents = {
- declarations: {},
- sources: {},
- libraries: this.contents
- };
- this.__dirty = true;
- events.emit('verbose', 'Update format of pods.json');
- }
-};
-
-PodsJson.prototype.getLibraries = function () {
- return this.contents[PodsJson.LIBRARY];
-};
-
-PodsJson.prototype.__get = function (kind, name) {
- return this.contents[kind][name];
-};
-
-PodsJson.prototype.getLibrary = function (name) {
- return this.__get(PodsJson.LIBRARY, name);
-};
-
-PodsJson.prototype.getSource = function (name) {
- return this.__get(PodsJson.SOURCE, name);
-};
-
-PodsJson.prototype.getDeclaration = function (name) {
- return this.__get(PodsJson.DECLARATION, name);
-};
-
-PodsJson.prototype.__remove = function (kind, name) {
- if (this.contents[kind][name]) {
- delete this.contents[kind][name];
- this.__dirty = true;
- events.emit('verbose', util.format('Remove from pods.json for `%s` - `%s`', name));
- }
-};
-
-PodsJson.prototype.removeLibrary = function (name) {
- this.__remove(PodsJson.LIBRARY, name);
-};
-
-PodsJson.prototype.removeSource = function (name) {
- this.__remove(PodsJson.SOURCE, name);
-};
-
-PodsJson.prototype.removeDeclaration = function (name) {
- this.__remove(PodsJson.DECLARATION, name);
-};
-
-PodsJson.prototype.clear = function () {
- this.contents = {
- declarations: {},
- sources: {},
- libraries: {}
- };
- this.__dirty = true;
-};
-
-PodsJson.prototype.destroy = function () {
- fs.unlinkSync(this.path);
- events.emit('verbose', util.format('Deleted `%s`', this.path));
-};
-
-PodsJson.prototype.write = function () {
- if (this.contents) {
- fs.writeFileSync(this.path, JSON.stringify(this.contents, null, 4));
- this.__dirty = false;
- events.emit('verbose', 'Wrote to pods.json.');
- }
-};
-
-PodsJson.prototype.__increment = function (kind, name) {
- const val = this.__get(kind, name);
- if (val) {
- val.count++;
- }
-};
-
-PodsJson.prototype.incrementLibrary = function (name) {
- this.__increment(PodsJson.LIBRARY, name);
-};
-
-PodsJson.prototype.incrementSource = function (name) {
- this.__increment(PodsJson.SOURCE, name);
-};
-
-PodsJson.prototype.incrementDeclaration = function (name) {
- this.__increment(PodsJson.DECLARATION, name);
-};
-
-PodsJson.prototype.__decrement = function (kind, name) {
- const val = this.__get(kind, name);
- if (val) {
- val.count--;
- if (val.count <= 0) {
- this.__remove(kind, name);
- }
- }
-};
-
-PodsJson.prototype.decrementLibrary = function (name) {
- this.__decrement(PodsJson.LIBRARY, name);
-};
-
-PodsJson.prototype.decrementSource = function (name) {
- this.__decrement(PodsJson.SOURCE, name);
-};
-
-PodsJson.prototype.decrementDeclaration = function (name) {
- this.__decrement(PodsJson.DECLARATION, name);
-};
-
-PodsJson.prototype.__setJson = function (kind, name, json) {
- this.contents[kind][name] = Object.assign({}, json);
- this.__dirty = true;
- events.emit('verbose', util.format('Set pods.json for `%s` - `%s`', kind, name));
-};
-
-// sample json for library
-// { name: "Eureka", spec: "4.2.0", "swift-version": "4.1", count: 1 }
-PodsJson.prototype.setJsonLibrary = function (name, json) {
- this.__setJson(PodsJson.LIBRARY, name, json);
-};
-
-// sample json for source
-// { source: "https://github.com/brightcove/BrightcoveSpecs.git", count: 1 }
-PodsJson.prototype.setJsonSource = function (name, json) {
- this.__setJson(PodsJson.SOURCE, name, json);
-};
-
-// sample json for declaration
-// { declaration: ""}
-PodsJson.prototype.setJsonDeclaration = function (name, json) {
- this.__setJson(PodsJson.DECLARATION, name, json);
-};
-
-PodsJson.prototype.isDirty = function () {
- return this.__dirty;
-};
-
-module.exports.PodsJson = PodsJson;
diff --git a/cordova/platforms/ios/cordova/lib/build.js b/cordova/platforms/ios/cordova/lib/build.js
deleted file mode 100644
index ddcc4b6d0..000000000
--- a/cordova/platforms/ios/cordova/lib/build.js
+++ /dev/null
@@ -1,442 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-const path = require('path');
-const which = require('which');
-const {
- CordovaError,
- events,
- superspawn: { spawn }
-} = require('cordova-common');
-const fs = require('fs-extra');
-const plist = require('plist');
-const util = require('util');
-
-const check_reqs = require('./check_reqs');
-const projectFile = require('./projectFile');
-
-// These are regular expressions to detect if the user is changing any of the built-in xcodebuildArgs
-/* eslint-disable no-useless-escape */
-const buildFlagMatchers = {
- workspace: /^\-workspace\s*(.*)/,
- scheme: /^\-scheme\s*(.*)/,
- configuration: /^\-configuration\s*(.*)/,
- sdk: /^\-sdk\s*(.*)/,
- destination: /^\-destination\s*(.*)/,
- archivePath: /^\-archivePath\s*(.*)/,
- configuration_build_dir: /^(CONFIGURATION_BUILD_DIR=.*)/,
- shared_precomps_dir: /^(SHARED_PRECOMPS_DIR=.*)/
-};
-/* eslint-enable no-useless-escape */
-
-/**
- * Creates a project object (see projectFile.js/parseProjectFile) from
- * a project path and name
- *
- * @param {*} projectPath
- * @param {*} projectName
- */
-function createProjectObject (projectPath, projectName) {
- const locations = {
- root: projectPath,
- pbxproj: path.join(projectPath, `${projectName}.xcodeproj`, 'project.pbxproj')
- };
-
- return projectFile.parse(locations);
-}
-
-/**
- * Returns a promise that resolves to the default simulator target; the logic here
- * matches what `cordova emulate ios` does.
- *
- * The return object has two properties: `name` (the Xcode destination name),
- * `identifier` (the simctl identifier), and `simIdentifier` (essentially the cordova emulate target)
- *
- * @return {Promise}
- */
-function getDefaultSimulatorTarget () {
- events.emit('log', 'Select last emulator from list as default.');
- return require('./listEmulatorBuildTargets').run()
- .then(emulators => {
- let targetEmulator;
- if (emulators.length > 0) {
- targetEmulator = emulators[0];
- }
- emulators.forEach(emulator => {
- if (emulator.name.indexOf('iPhone') === 0) {
- targetEmulator = emulator;
- }
- });
- return targetEmulator;
- });
-}
-
-module.exports.run = buildOpts => {
- let emulatorTarget = '';
- const projectPath = path.join(__dirname, '..', '..');
- let projectName = '';
-
- buildOpts = buildOpts || {};
-
- if (buildOpts.debug && buildOpts.release) {
- return Promise.reject(new CordovaError('Cannot specify "debug" and "release" options together.'));
- }
-
- if (buildOpts.device && buildOpts.emulator) {
- return Promise.reject(new CordovaError('Cannot specify "device" and "emulator" options together.'));
- }
-
- if (buildOpts.buildConfig) {
- if (!fs.existsSync(buildOpts.buildConfig)) {
- return Promise.reject(new CordovaError(`Build config file does not exist: ${buildOpts.buildConfig}`));
- }
- events.emit('log', `Reading build config file: ${path.resolve(buildOpts.buildConfig)}`);
- const contents = fs.readFileSync(buildOpts.buildConfig, 'utf-8');
- const buildConfig = JSON.parse(contents.replace(/^\ufeff/, '')); // Remove BOM
- if (buildConfig.ios) {
- const buildType = buildOpts.release ? 'release' : 'debug';
- const config = buildConfig.ios[buildType];
- if (config) {
- ['codeSignIdentity', 'codeSignResourceRules', 'provisioningProfile', 'developmentTeam', 'packageType', 'buildFlag', 'iCloudContainerEnvironment', 'automaticProvisioning'].forEach(
- key => {
- buildOpts[key] = buildOpts[key] || config[key];
- });
- }
- }
- }
-
- return require('./listDevices').run()
- .then(devices => {
- if (devices.length > 0 && !(buildOpts.emulator)) {
- // we also explicitly set device flag in options as we pass
- // those parameters to other api (build as an example)
- buildOpts.device = true;
- return check_reqs.check_ios_deploy();
- }
- }).then(() => {
- // CB-12287: Determine the device we should target when building for a simulator
- if (!buildOpts.device) {
- let newTarget = buildOpts.target || '';
-
- if (newTarget) {
- // only grab the device name, not the runtime specifier
- newTarget = newTarget.split(',')[0];
- }
- // a target was given to us, find the matching Xcode destination name
- const promise = require('./listEmulatorBuildTargets').targetForSimIdentifier(newTarget);
- return promise.then(theTarget => {
- if (!theTarget) {
- return getDefaultSimulatorTarget().then(defaultTarget => {
- emulatorTarget = defaultTarget.name;
- events.emit('warn', `No simulator found for "${newTarget}. Falling back to the default target.`);
- events.emit('log', `Building for "${emulatorTarget}" Simulator (${defaultTarget.identifier}, ${defaultTarget.simIdentifier}).`);
- return emulatorTarget;
- });
- } else {
- emulatorTarget = theTarget.name;
- events.emit('log', `Building for "${emulatorTarget}" Simulator (${theTarget.identifier}, ${theTarget.simIdentifier}).`);
- return emulatorTarget;
- }
- });
- }
- })
- .then(() => check_reqs.run())
- .then(() => findXCodeProjectIn(projectPath))
- .then(name => {
- projectName = name;
- let extraConfig = '';
- if (buildOpts.codeSignIdentity) {
- extraConfig += `CODE_SIGN_IDENTITY = ${buildOpts.codeSignIdentity}\n`;
- extraConfig += `CODE_SIGN_IDENTITY[sdk=iphoneos*] = ${buildOpts.codeSignIdentity}\n`;
- }
- if (buildOpts.codeSignResourceRules) {
- extraConfig += `CODE_SIGN_RESOURCE_RULES_PATH = ${buildOpts.codeSignResourceRules}\n`;
- }
- if (buildOpts.provisioningProfile) {
- extraConfig += `PROVISIONING_PROFILE = ${buildOpts.provisioningProfile}\n`;
- }
- if (buildOpts.developmentTeam) {
- extraConfig += `DEVELOPMENT_TEAM = ${buildOpts.developmentTeam}\n`;
- }
-
- function writeCodeSignStyle (value) {
- const project = createProjectObject(projectPath, projectName);
-
- events.emit('verbose', `Set CODE_SIGN_STYLE Build Property to ${value}.`);
- project.xcode.updateBuildProperty('CODE_SIGN_STYLE', value);
- events.emit('verbose', `Set ProvisioningStyle Target Attribute to ${value}.`);
- project.xcode.addTargetAttribute('ProvisioningStyle', value);
-
- project.write();
- }
-
- if (buildOpts.provisioningProfile) {
- events.emit('verbose', 'ProvisioningProfile build option set, changing project settings to Manual.');
- writeCodeSignStyle('Manual');
- } else if (buildOpts.automaticProvisioning) {
- events.emit('verbose', 'ProvisioningProfile build option NOT set, changing project settings to Automatic.');
- writeCodeSignStyle('Automatic');
- }
-
- return fs.writeFile(path.join(__dirname, '..', 'build-extras.xcconfig'), extraConfig, 'utf-8');
- }).then(() => {
- const configuration = buildOpts.release ? 'Release' : 'Debug';
-
- events.emit('log', `Building project: ${path.join(projectPath, `${projectName}.xcworkspace`)}`);
- events.emit('log', `\tConfiguration: ${configuration}`);
- events.emit('log', `\tPlatform: ${buildOpts.device ? 'device' : 'emulator'}`);
- events.emit('log', `\tTarget: ${emulatorTarget}`);
-
- const buildOutputDir = path.join(projectPath, 'build', (buildOpts.device ? 'device' : 'emulator'));
-
- // remove the build/device folder before building
- fs.removeSync(buildOutputDir);
-
- const xcodebuildArgs = getXcodeBuildArgs(projectName, projectPath, configuration, buildOpts.device, buildOpts.buildFlag, emulatorTarget, buildOpts.automaticProvisioning);
- return spawn('xcodebuild', xcodebuildArgs, { cwd: projectPath, printCommand: true, stdio: 'inherit' });
- }).then(() => {
- if (!buildOpts.device || buildOpts.noSign) {
- return;
- }
-
- const project = createProjectObject(projectPath, projectName);
- const bundleIdentifier = project.getPackageName();
- const exportOptions = { compileBitcode: false, method: 'development' };
-
- if (buildOpts.packageType) {
- exportOptions.method = buildOpts.packageType;
- }
-
- if (buildOpts.iCloudContainerEnvironment) {
- exportOptions.iCloudContainerEnvironment = buildOpts.iCloudContainerEnvironment;
- }
-
- if (buildOpts.developmentTeam) {
- exportOptions.teamID = buildOpts.developmentTeam;
- }
-
- if (buildOpts.provisioningProfile && bundleIdentifier) {
- exportOptions.provisioningProfiles = { [bundleIdentifier]: String(buildOpts.provisioningProfile) };
- exportOptions.signingStyle = 'manual';
- }
-
- if (buildOpts.codeSignIdentity) {
- exportOptions.signingCertificate = buildOpts.codeSignIdentity;
- }
-
- const exportOptionsPlist = plist.build(exportOptions);
- const exportOptionsPath = path.join(projectPath, 'exportOptions.plist');
-
- const buildOutputDir = path.join(projectPath, 'build', 'device');
-
- function checkSystemRuby () {
- const ruby_cmd = which.sync('ruby', { nothrow: true });
-
- if (ruby_cmd !== '/usr/bin/ruby') {
- events.emit('warn', 'Non-system Ruby in use. This may cause packaging to fail.\n' +
- 'If you use RVM, please run `rvm use system`.\n' +
- 'If you use chruby, please run `chruby system`.');
- }
- }
-
- function packageArchive () {
- const xcodearchiveArgs = getXcodeArchiveArgs(projectName, projectPath, buildOutputDir, exportOptionsPath, buildOpts.automaticProvisioning);
- return spawn('xcodebuild', xcodearchiveArgs, { cwd: projectPath, printCommand: true, stdio: 'inherit' });
- }
-
- return fs.writeFile(exportOptionsPath, exportOptionsPlist, 'utf-8')
- .then(checkSystemRuby)
- .then(packageArchive);
- });
-};
-
-/**
- * Searches for first XCode project in specified folder
- * @param {String} projectPath Path where to search project
- * @return {Promise} Promise either fulfilled with project name or rejected
- */
-function findXCodeProjectIn (projectPath) {
- // 'Searching for Xcode project in ' + projectPath);
- const xcodeProjFiles = fs.readdirSync(projectPath).filter(name => path.extname(name) === '.xcodeproj');
-
- if (xcodeProjFiles.length === 0) {
- return Promise.reject(new CordovaError(`No Xcode project found in ${projectPath}`));
- }
- if (xcodeProjFiles.length > 1) {
- events.emit('warn', `Found multiple .xcodeproj directories in \n${projectPath}\nUsing first one`);
- }
-
- const projectName = path.basename(xcodeProjFiles[0], '.xcodeproj');
- return Promise.resolve(projectName);
-}
-
-module.exports.findXCodeProjectIn = findXCodeProjectIn;
-
-/**
- * Returns array of arguments for xcodebuild
- * @param {String} projectName Name of xcode project
- * @param {String} projectPath Path to project file. Will be used to set CWD for xcodebuild
- * @param {String} configuration Configuration name: debug|release
- * @param {Boolean} isDevice Flag that specify target for package (device/emulator)
- * @param {Array} buildFlags
- * @param {String} emulatorTarget Target for emulator (rather than default)
- * @param {Boolean} autoProvisioning Whether to allow Xcode to automatically update provisioning
- * @return {Array} Array of arguments that could be passed directly to spawn method
- */
-function getXcodeBuildArgs (projectName, projectPath, configuration, isDevice, buildFlags, emulatorTarget, autoProvisioning) {
- let options;
- let buildActions;
- let settings;
- const customArgs = {};
- customArgs.otherFlags = [];
-
- if (buildFlags) {
- if (typeof buildFlags === 'string' || buildFlags instanceof String) {
- parseBuildFlag(buildFlags, customArgs);
- } else { // buildFlags is an Array of strings
- buildFlags.forEach(flag => {
- parseBuildFlag(flag, customArgs);
- });
- }
- }
-
- if (isDevice) {
- options = [
- '-workspace', customArgs.workspace || `${projectName}.xcworkspace`,
- '-scheme', customArgs.scheme || projectName,
- '-configuration', customArgs.configuration || configuration,
- '-destination', customArgs.destination || 'generic/platform=iOS',
- '-archivePath', customArgs.archivePath || `${projectName}.xcarchive`
- ];
- buildActions = ['archive'];
- settings = [
- customArgs.configuration_build_dir || `CONFIGURATION_BUILD_DIR=${path.join(projectPath, 'build', 'device')}`,
- customArgs.shared_precomps_dir || `SHARED_PRECOMPS_DIR=${path.join(projectPath, 'build', 'sharedpch')}`
- ];
- // Add other matched flags to otherFlags to let xcodebuild present an appropriate error.
- // This is preferable to just ignoring the flags that the user has passed in.
- if (customArgs.sdk) {
- customArgs.otherFlags = customArgs.otherFlags.concat(['-sdk', customArgs.sdk]);
- }
-
- if (autoProvisioning) {
- options = options.concat(['-allowProvisioningUpdates']);
- }
- } else { // emulator
- options = [
- '-workspace', customArgs.project || `${projectName}.xcworkspace`,
- '-scheme', customArgs.scheme || projectName,
- '-configuration', customArgs.configuration || configuration,
- '-sdk', customArgs.sdk || 'iphonesimulator',
- '-destination', customArgs.destination || `platform=iOS Simulator,name=${emulatorTarget}`
- ];
- buildActions = ['build'];
- settings = [
- customArgs.configuration_build_dir || `CONFIGURATION_BUILD_DIR=${path.join(projectPath, 'build', 'emulator')}`,
- customArgs.shared_precomps_dir || `SHARED_PRECOMPS_DIR=${path.join(projectPath, 'build', 'sharedpch')}`
- ];
- // Add other matched flags to otherFlags to let xcodebuild present an appropriate error.
- // This is preferable to just ignoring the flags that the user has passed in.
- if (customArgs.archivePath) {
- customArgs.otherFlags = customArgs.otherFlags.concat(['-archivePath', customArgs.archivePath]);
- }
- }
-
- return options.concat(buildActions).concat(settings).concat(customArgs.otherFlags);
-}
-
-/**
- * Returns array of arguments for xcodebuild
- * @param {String} projectName Name of xcode project
- * @param {String} projectPath Path to project file. Will be used to set CWD for xcodebuild
- * @param {String} outputPath Output directory to contain the IPA
- * @param {String} exportOptionsPath Path to the exportOptions.plist file
- * @param {Boolean} autoProvisioning Whether to allow Xcode to automatically update provisioning
- * @return {Array} Array of arguments that could be passed directly to spawn method
- */
-function getXcodeArchiveArgs (projectName, projectPath, outputPath, exportOptionsPath, autoProvisioning) {
- return [
- '-exportArchive',
- '-archivePath', `${projectName}.xcarchive`,
- '-exportOptionsPlist', exportOptionsPath,
- '-exportPath', outputPath
- ].concat(autoProvisioning ? ['-allowProvisioningUpdates'] : []);
-}
-
-function parseBuildFlag (buildFlag, args) {
- let matched;
- for (const key in buildFlagMatchers) {
- const found = buildFlag.match(buildFlagMatchers[key]);
- if (found) {
- matched = true;
- // found[0] is the whole match, found[1] is the first match in parentheses.
- args[key] = found[1];
- events.emit('warn', util.format('Overriding xcodebuildArg: %s', buildFlag));
- }
- }
-
- if (!matched) {
- // If the flag starts with a '-' then it is an xcodebuild built-in option or a
- // user-defined setting. The regex makes sure that we don't split a user-defined
- // setting that is wrapped in quotes.
- /* eslint-disable no-useless-escape */
- if (buildFlag[0] === '-' && !buildFlag.match(/^.*=(\".*\")|(\'.*\')$/)) {
- args.otherFlags = args.otherFlags.concat(buildFlag.split(' '));
- events.emit('warn', util.format('Adding xcodebuildArg: %s', buildFlag.split(' ')));
- } else {
- args.otherFlags.push(buildFlag);
- events.emit('warn', util.format('Adding xcodebuildArg: %s', buildFlag));
- }
- }
-}
-
-// help/usage function
-module.exports.help = function help () {
- console.log('');
- console.log('Usage: build [--debug | --release] [--archs=\"<list of architectures...>\"]');
- console.log(' [--device | --simulator] [--codeSignIdentity=\"<identity>\"]');
- console.log(' [--codeSignResourceRules=\"<resourcerules path>\"]');
- console.log(' [--developmentTeam=\"<Team ID>\"]');
- console.log(' [--provisioningProfile=\"<provisioning profile>\"]');
- console.log(' --help : Displays this dialog.');
- console.log(' --debug : Builds project in debug mode. (Default)');
- console.log(' --release : Builds project in release mode.');
- console.log(' -r : Shortcut :: builds project in release mode.');
- /* eslint-enable no-useless-escape */
- // TODO: add support for building different archs
- // console.log(" --archs : Builds project binaries for specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).");
- console.log(' --device, --simulator');
- console.log(' : Specifies, what type of project to build');
- console.log(' --codeSignIdentity : Type of signing identity used for code signing.');
- console.log(' --codeSignResourceRules : Path to ResourceRules.plist.');
- console.log(' --developmentTeam : New for Xcode 8. The development team (Team ID)');
- console.log(' to use for code signing.');
- console.log(' --provisioningProfile : UUID of the profile.');
- console.log(' --device --noSign : Builds project without application signing.');
- console.log('');
- console.log('examples:');
- console.log(' build ');
- console.log(' build --debug');
- console.log(' build --release');
- console.log(' build --codeSignIdentity="iPhone Distribution" --provisioningProfile="926c2bd6-8de9-4c2f-8407-1016d2d12954"');
- // TODO: add support for building different archs
- // console.log(" build --release --archs=\"armv7\"");
- console.log('');
- process.exit(0);
-};
diff --git a/cordova/platforms/ios/cordova/lib/check_reqs.js b/cordova/platforms/ios/cordova/lib/check_reqs.js
deleted file mode 100644
index 83f5f6fa6..000000000
--- a/cordova/platforms/ios/cordova/lib/check_reqs.js
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-'use strict';
-
-const which = require('which');
-const versions = require('./versions');
-const { CordovaError } = require('cordova-common');
-
-const SUPPORTED_OS_PLATFORMS = ['darwin'];
-
-const XCODEBUILD_MIN_VERSION = '9.0.0';
-const XCODEBUILD_NOT_FOUND_MESSAGE =
- `Please install version ${XCODEBUILD_MIN_VERSION} or greater from App Store`;
-
-const IOS_DEPLOY_MIN_VERSION = '1.9.2';
-const IOS_DEPLOY_NOT_FOUND_MESSAGE =
- `Please download, build and install version ${IOS_DEPLOY_MIN_VERSION} or greater from https://github.com/ios-control/ios-deploy into your path, or do 'npm install -g ios-deploy'`;
-
-const COCOAPODS_MIN_VERSION = '1.8.0';
-const COCOAPODS_NOT_FOUND_MESSAGE = `Please install version ${COCOAPODS_MIN_VERSION} or greater from https://cocoapods.org/`;
-
-/**
- * Checks if xcode util is available
- * @return {Promise} Returns a promise either resolved with xcode version or rejected
- */
-module.exports.run = module.exports.check_xcodebuild = () => {
- return checkTool('xcodebuild', XCODEBUILD_MIN_VERSION, XCODEBUILD_NOT_FOUND_MESSAGE);
-};
-
-/**
- * Checks if ios-deploy util is available
- * @return {Promise} Returns a promise either resolved with ios-deploy version or rejected
- */
-module.exports.check_ios_deploy = () => {
- return checkTool('ios-deploy', IOS_DEPLOY_MIN_VERSION, IOS_DEPLOY_NOT_FOUND_MESSAGE);
-};
-
-module.exports.check_os = () => {
- // Build iOS apps available for OSX platform only, so we reject on others platforms
- return os_platform_is_supported()
- ? Promise.resolve(process.platform)
- : Promise.reject(new CordovaError('Cordova tooling for iOS requires Apple macOS'));
-};
-
-function os_platform_is_supported () {
- return (SUPPORTED_OS_PLATFORMS.indexOf(process.platform) !== -1);
-}
-
-/**
- * Checks if cocoapods is available.
- * @return {Promise} Returns a promise either resolved or rejected
- */
-module.exports.check_cocoapods = toolChecker => {
- if (os_platform_is_supported()) {
- return checkTool('pod', COCOAPODS_MIN_VERSION, COCOAPODS_NOT_FOUND_MESSAGE, 'CocoaPods');
- }
-
- return Promise.resolve({
- ignore: true,
- ignoreMessage: `CocoaPods check and installation ignored on ${process.platform}`
- });
-};
-
-/**
- * Checks if specific tool is available.
- * @param {String} tool Tool name to check. Known tools are 'xcodebuild' and 'ios-deploy'
- * @param {Number} minVersion Min allowed tool version.
- * @param {String} message Message that will be used to reject promise.
- * @param {String} toolFriendlyName Friendly name of the tool, to report to the user. Optional.
- * @return {Promise} Returns a promise either resolved with tool version or rejected
- */
-function checkTool (tool, minVersion, message, toolFriendlyName) {
- toolFriendlyName = toolFriendlyName || tool;
-
- // Check whether tool command is available at all
- const tool_command = which.sync(tool, { nothrow: true });
- if (!tool_command) {
- return Promise.reject(new CordovaError(`${toolFriendlyName} was not found. ${message || ''}`));
- }
-
- // check if tool version is greater than specified one
- return versions.get_tool_version(tool).then(version => {
- version = version.trim();
- return versions.compareVersions(version, minVersion) >= 0
- ? Promise.resolve({ version })
- : Promise.reject(new CordovaError(`Cordova needs ${toolFriendlyName} version ${minVersion} or greater, you have version ${version}. ${message || ''}`));
- });
-}
-
-/**
- * Object that represents one of requirements for current platform.
- * @param {String} id The unique identifier for this requirements.
- * @param {String} name The name of requirements. Human-readable field.
- * @param {Boolean} isFatal Marks the requirement as fatal. If such requirement will fail
- * next requirements' checks will be skipped.
- */
-const Requirement = function (id, name, isFatal) {
- this.id = id;
- this.name = name;
- this.installed = false;
- this.metadata = {};
- this.isFatal = isFatal || false;
-};
-
-/**
- * Methods that runs all checks one by one and returns a result of checks
- * as an array of Requirement objects. This method intended to be used by cordova-lib check_reqs method
- *
- * @return Promise<Requirement[]> Array of requirements. Due to implementation, promise is always fulfilled.
- */
-module.exports.check_all = () => {
- const requirements = [
- new Requirement('os', 'Apple macOS', true),
- new Requirement('xcode', 'Xcode'),
- new Requirement('ios-deploy', 'ios-deploy'),
- new Requirement('CocoaPods', 'CocoaPods')
- ];
-
- const result = [];
- let fatalIsHit = false;
-
- const checkFns = [
- module.exports.check_os,
- module.exports.check_xcodebuild,
- module.exports.check_ios_deploy,
- module.exports.check_cocoapods
- ];
-
- // Then execute requirement checks one-by-one
- return checkFns.reduce((promise, checkFn, idx) => {
- return promise.then(() => {
- // If fatal requirement is failed,
- // we don't need to check others
- if (fatalIsHit) return Promise.resolve();
-
- const requirement = requirements[idx];
- return checkFn()
- .then(version => {
- requirement.installed = true;
- requirement.metadata.version = version;
- result.push(requirement);
- }, err => {
- if (requirement.isFatal) fatalIsHit = true;
- requirement.metadata.reason = err;
- result.push(requirement);
- });
- });
- }, Promise.resolve())
- // When chain is completed, return requirements array to upstream API
- .then(() => result);
-};
diff --git a/cordova/platforms/ios/cordova/lib/clean.js b/cordova/platforms/ios/cordova/lib/clean.js
deleted file mode 100644
index 72aac0baf..000000000
--- a/cordova/platforms/ios/cordova/lib/clean.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-const path = require('path');
-const fs = require('fs-extra');
-const {
- CordovaError,
- superspawn: { spawn }
-} = require('cordova-common');
-
-const projectPath = path.join(__dirname, '..', '..');
-
-module.exports.run = () => {
- const projectName = fs.readdirSync(projectPath).filter(name => path.extname(name) === '.xcodeproj');
-
- if (!projectName) {
- return Promise.reject(new CordovaError(`No Xcode project found in ${projectPath}`));
- }
-
- const xcodebuildClean = configName => {
- return spawn(
- 'xcodebuild',
- ['-project', projectName, '-configuration', configName, '-alltargets', 'clean'],
- { cwd: projectPath, printCommand: true, stdio: 'inherit' }
- );
- };
-
- return xcodebuildClean('Debug')
- .then(() => xcodebuildClean('Release'))
- .then(() => fs.removeSync(path.join(projectPath, 'build')));
-};
diff --git a/cordova/platforms/ios/cordova/lib/list-devices b/cordova/platforms/ios/cordova/lib/list-devices
index 5f89e21b2..81c3e3d77 100755
--- a/cordova/platforms/ios/cordova/lib/list-devices
+++ b/cordova/platforms/ios/cordova/lib/list-devices
@@ -19,7 +19,7 @@
under the License.
*/
-const { run } = require('./listDevices');
+const { run } = require('cordova-ios/lib/listDevices');
run().then(devices => {
devices.forEach(device => {
diff --git a/cordova/platforms/ios/cordova/lib/list-emulator-build-targets b/cordova/platforms/ios/cordova/lib/list-emulator-build-targets
deleted file mode 100755
index 304c4c171..000000000
--- a/cordova/platforms/ios/cordova/lib/list-emulator-build-targets
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const { run } = require('./listEmulatorBuildTargets');
-
-run().then(targets => {
- console.log(JSON.stringify(targets, null, 2));
-});
diff --git a/cordova/platforms/ios/cordova/lib/list-emulator-images b/cordova/platforms/ios/cordova/lib/list-emulator-images
index db9b72af0..b422269c7 100755
--- a/cordova/platforms/ios/cordova/lib/list-emulator-images
+++ b/cordova/platforms/ios/cordova/lib/list-emulator-images
@@ -19,7 +19,7 @@
under the License.
*/
-const { run } = require('./listEmulatorImages');
+const { run } = require('cordova-ios/lib/listEmulatorImages');
run().then(names => {
names.forEach(name => {
diff --git a/cordova/platforms/ios/cordova/lib/list-started-emulators b/cordova/platforms/ios/cordova/lib/list-started-emulators
deleted file mode 100755
index 7f06cf2e8..000000000
--- a/cordova/platforms/ios/cordova/lib/list-started-emulators
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const { run } = require('./listStartedEmulators');
-
-run().then(emulators => {
- emulators.forEach(emulator => {
- console.log(emulator);
- });
-});
diff --git a/cordova/platforms/ios/cordova/lib/listDevices.js b/cordova/platforms/ios/cordova/lib/listDevices.js
deleted file mode 100644
index 86a67ffbb..000000000
--- a/cordova/platforms/ios/cordova/lib/listDevices.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const { superspawn: { spawn } } = require('cordova-common');
-
-const DEVICE_REGEX = /-o (iPhone|iPad|iPod)@.*?"USB Serial Number" = "([^"]*)"/gs;
-
-/**
- * Gets list of connected iOS devices
- * @return {Promise} Promise fulfilled with list of available iOS devices
- */
-function listDevices () {
- return spawn('ioreg', ['-p', 'IOUSB', '-l'])
- .then(output => {
- return [...matchAll(output, DEVICE_REGEX)]
- .map(m => m.slice(1).reverse().join(' '));
- });
-}
-
-// TODO: Should be replaced with String#matchAll once available
-function * matchAll (s, r) {
- let match;
- while ((match = r.exec(s))) yield match;
-}
-
-exports.run = listDevices;
diff --git a/cordova/platforms/ios/cordova/lib/listEmulatorBuildTargets.js b/cordova/platforms/ios/cordova/lib/listEmulatorBuildTargets.js
deleted file mode 100644
index 5b1bc2a78..000000000
--- a/cordova/platforms/ios/cordova/lib/listEmulatorBuildTargets.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const { superspawn: { spawn }, events } = require('cordova-common');
-
-/**
- * Returns a list of available simulator build targets of the form
- *
- * [
- * { name: <xcode-destination-name>,
- * identifier: <simctl-identifier>,
- * simIdentifier: <cordova emulate target>
- * }
- * ]
- *
- */
-function listEmulatorBuildTargets () {
- events.emit('log', 'List simulator targets');
- return spawn('xcrun', ['simctl', 'list', '--json'], { printCommand: true })
- .then(output => JSON.parse(output))
- .then(function (simInfo) {
- var devices = simInfo.devices;
- var deviceTypes = simInfo.devicetypes;
- return deviceTypes.reduce(function (typeAcc, deviceType) {
- if (!deviceType.name.match(/^[iPad|iPhone]/)) {
- // ignore targets we don't support (like Apple Watch or Apple TV)
- return typeAcc;
- }
- var availableDevices = Object.keys(devices).reduce(function (availAcc, deviceCategory) {
- var availableDevicesInCategory = devices[deviceCategory];
- availableDevicesInCategory.forEach(function (device) {
- if (device.name === deviceType.name || device.name === deviceType.name.replace(/-inch/g, ' inch')) {
- // Check new flag isAvailable (XCode 10.1+) or legacy string availability (XCode 10 and lower)
- if (device.isAvailable || (device.availability && device.availability.toLowerCase().indexOf('unavailable') < 0)) {
- availAcc.push(device);
- }
- }
- });
- return availAcc;
- }, []);
- // we only want device types that have at least one available device
- // (regardless of OS); this filters things out like iPhone 4s, which
- // is present in deviceTypes, but probably not available on the user's
- // system.
- if (availableDevices.length > 0) {
- typeAcc.push(deviceType);
- }
- return typeAcc;
- }, []);
- })
- .then(function (filteredTargets) {
- // the simIdentifier, or cordova emulate target name, is the very last part
- // of identifier.
- return filteredTargets.map(function (target) {
- var identifierPieces = target.identifier.split('.');
- target.simIdentifier = identifierPieces[identifierPieces.length - 1];
- return target;
- });
- });
-}
-
-exports.run = listEmulatorBuildTargets;
-
-/**
- * Given a simIdentifier, return the matching target.
- *
- * @param {string} simIdentifier a target, like "iPhone-SE"
- * @return {Object} the matching target, or undefined if no match
- */
-exports.targetForSimIdentifier = function (simIdentifier) {
- return listEmulatorBuildTargets()
- .then(function (targets) {
- return targets.reduce(function (acc, target) {
- if (!acc && target.simIdentifier.toLowerCase() === simIdentifier.toLowerCase()) {
- acc = target;
- }
- return acc;
- }, undefined);
- });
-};
diff --git a/cordova/platforms/ios/cordova/lib/listEmulatorImages.js b/cordova/platforms/ios/cordova/lib/listEmulatorImages.js
deleted file mode 100644
index 09e143402..000000000
--- a/cordova/platforms/ios/cordova/lib/listEmulatorImages.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var iossim = require('ios-sim');
-
-/**
- * Gets list of iOS devices available for simulation
- * @return {Promise} Promise fulfilled with list of devices available for simulation
- */
-function listEmulatorImages () {
- return Promise.resolve(iossim.getdevicetypes());
-}
-
-exports.run = listEmulatorImages;
diff --git a/cordova/platforms/ios/cordova/lib/listStartedEmulators.js b/cordova/platforms/ios/cordova/lib/listStartedEmulators.js
deleted file mode 100644
index ec1cb7f2f..000000000
--- a/cordova/platforms/ios/cordova/lib/listStartedEmulators.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const { superspawn: { spawn } } = require('cordova-common');
-
-/**
- * Gets list of running iOS simulators
- * @return {Promise} Promise fulfilled with list of running iOS simulators
- *
- * @todo In the next PR, I will refactor this entire method.
- *
- * The process no longer contains the pattern "[i]OS Simulator".
- * The process is now called "Simulator.app"
- *
- * Additionaly, `defaults read com.apple.iphonesimulator "SimulateDevice"` is also not valid aymore.
- *
- * I will replace this entire method to locate the active simulators though `simctl`
- *
- * Alternativly, remove this file. It is not documented in Cordova and not used anywhere in our code base.
- */
-function listStartedEmulators () {
- // wrap exec call into promise
- return spawn('ps', ['aux'])
- .then(output => {
- if (output.match(/[i]OS Simulator/)) {
- return spawn('defaults', ['read', 'com.apple.iphonesimulator', '"SimulateDevice"']);
- }
-
- return '';
- })
- .then(output => output.split('\n'));
-}
-
-exports.run = listStartedEmulators;
diff --git a/cordova/platforms/ios/cordova/lib/plugman/pluginHandlers.js b/cordova/platforms/ios/cordova/lib/plugman/pluginHandlers.js
deleted file mode 100644
index 09d5ae51e..000000000
--- a/cordova/platforms/ios/cordova/lib/plugman/pluginHandlers.js
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-'use strict';
-const fs = require('fs-extra');
-const path = require('path');
-const util = require('util');
-const events = require('cordova-common').events;
-const CordovaError = require('cordova-common').CordovaError;
-
-// These frameworks are required by cordova-ios by default. We should never add/remove them.
-const keep_these_frameworks = [
- 'MobileCoreServices.framework',
- 'CoreGraphics.framework',
- 'AssetsLibrary.framework'
-];
-
-const handlers = {
- 'source-file': {
- install: function (obj, plugin, project, options) {
- installHelper('source-file', obj, plugin.dir, project.projectDir, plugin.id, options, project);
- },
- uninstall: function (obj, plugin, project, options) {
- uninstallHelper('source-file', obj, project.projectDir, plugin.id, options, project);
- }
- },
- 'header-file': {
- install: function (obj, plugin, project, options) {
- installHelper('header-file', obj, plugin.dir, project.projectDir, plugin.id, options, project);
- },
- uninstall: function (obj, plugin, project, options) {
- uninstallHelper('header-file', obj, project.projectDir, plugin.id, options, project);
- }
- },
- 'resource-file': {
- install: function (obj, plugin, project, options) {
- const src = obj.src;
- let target = obj.target;
- const srcFile = path.resolve(plugin.dir, src);
-
- if (!target) {
- target = path.basename(src);
- }
- const destFile = path.resolve(project.resources_dir, target);
-
- if (!fs.existsSync(srcFile)) {
- throw new CordovaError(`Cannot find resource file "${srcFile}" for plugin ${plugin.id} in iOS platform`);
- }
- if (fs.existsSync(destFile)) {
- throw new CordovaError(`File already exists at destination "${destFile}" for resource file specified by plugin ${plugin.id} in iOS platform`);
- }
- project.xcode.addResourceFile(path.join('Resources', target));
- const link = !!(options && options.link);
- copyFile(plugin.dir, src, project.projectDir, destFile, link);
- },
- uninstall: function (obj, plugin, project, options) {
- const src = obj.src;
- let target = obj.target;
-
- if (!target) {
- target = path.basename(src);
- }
- const destFile = path.resolve(project.resources_dir, target);
-
- project.xcode.removeResourceFile(path.join('Resources', target));
- fs.removeSync(destFile);
- }
- },
- framework: { // CB-5238 custom frameworks only
- install: function (obj, plugin, project, options) {
- const src = obj.src;
- const custom = !!(obj.custom); // convert to boolean (if truthy/falsy)
- const embed = !!(obj.embed); // convert to boolean (if truthy/falsy)
- const link = !embed; // either link or embed can be true, but not both. the other has to be false
-
- if (!custom) {
- const keepFrameworks = keep_these_frameworks;
-
- if (keepFrameworks.indexOf(src) < 0) {
- if (obj.type === 'podspec') {
- // podspec handled in Api.js
- } else {
- project.frameworks[src] = project.frameworks[src] || 0;
- project.frameworks[src]++;
- const opt = { customFramework: false, embed: false, link: true, weak: obj.weak };
- events.emit('verbose', util.format('Adding non-custom framework to project... %s -> %s', src, JSON.stringify(opt)));
- project.xcode.addFramework(src, opt);
- events.emit('verbose', util.format('Non-custom framework added to project. %s -> %s', src, JSON.stringify(opt)));
- }
- }
- return;
- }
- const srcFile = path.resolve(plugin.dir, src);
- const targetDir = path.resolve(project.plugins_dir, plugin.id, path.basename(src));
- if (!fs.existsSync(srcFile)) throw new CordovaError(`Cannot find framework "${srcFile}" for plugin ${plugin.id} in iOS platform`);
- if (fs.existsSync(targetDir)) throw new CordovaError(`Framework "${targetDir}" for plugin ${plugin.id} already exists in iOS platform`);
- const symlink = !!(options && options.link);
- copyFile(plugin.dir, src, project.projectDir, targetDir, symlink); // frameworks are directories
- // CB-10773 translate back slashes to forward on win32
- const project_relative = fixPathSep(path.relative(project.projectDir, targetDir));
- // CB-11233 create Embed Frameworks Build Phase if does not exist
- const existsEmbedFrameworks = project.xcode.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Frameworks');
- if (!existsEmbedFrameworks && embed) {
- events.emit('verbose', '"Embed Frameworks" Build Phase (Embedded Binaries) does not exist, creating it.');
- project.xcode.addBuildPhase([], 'PBXCopyFilesBuildPhase', 'Embed Frameworks', null, 'frameworks');
- }
- const opt = { customFramework: true, embed, link, sign: true };
- events.emit('verbose', util.format('Adding custom framework to project... %s -> %s', src, JSON.stringify(opt)));
- project.xcode.addFramework(project_relative, opt);
- events.emit('verbose', util.format('Custom framework added to project. %s -> %s', src, JSON.stringify(opt)));
- },
- uninstall: function (obj, plugin, project, options) {
- const src = obj.src;
-
- if (!obj.custom) { // CB-9825 cocoapod integration for plugins
- const keepFrameworks = keep_these_frameworks;
- if (keepFrameworks.indexOf(src) < 0) {
- if (obj.type !== 'podspec') {
- // this should be refactored
- project.frameworks[src] = project.frameworks[src] || 1;
- project.frameworks[src]--;
- if (project.frameworks[src] < 1) {
- // Only remove non-custom framework from xcode project
- // if there is no references remains
- project.xcode.removeFramework(src);
- delete project.frameworks[src];
- }
- }
- }
- return;
- }
-
- const targetDir = fixPathSep(path.resolve(project.plugins_dir, plugin.id, path.basename(src)));
- const pbxFile = project.xcode.removeFramework(targetDir, { customFramework: true });
- if (pbxFile) {
- project.xcode.removeFromPbxEmbedFrameworksBuildPhase(pbxFile);
- }
- fs.removeSync(targetDir);
- }
- },
- 'lib-file': {
- install: function (obj, plugin, project, options) {
- events.emit('verbose', '<lib-file> install is not supported for iOS plugins');
- },
- uninstall: function (obj, plugin, project, options) {
- events.emit('verbose', '<lib-file> uninstall is not supported for iOS plugins');
- }
- },
- asset: {
- install: function (obj, plugin, project, options) {
- if (!obj.src) {
- throw new CordovaError(generateAttributeError('src', 'asset', plugin.id));
- }
- if (!obj.target) {
- throw new CordovaError(generateAttributeError('target', 'asset', plugin.id));
- }
-
- copyFile(plugin.dir, obj.src, project.www, obj.target);
- if (options && options.usePlatformWww) copyFile(plugin.dir, obj.src, project.platformWww, obj.target);
- },
- uninstall: function (obj, plugin, project, options) {
- const target = obj.target;
-
- if (!target) {
- throw new CordovaError(generateAttributeError('target', 'asset', plugin.id));
- }
-
- removeFile(project.www, target);
- removeFileF(path.resolve(project.www, 'plugins', plugin.id));
- if (options && options.usePlatformWww) {
- removeFile(project.platformWww, target);
- removeFileF(path.resolve(project.platformWww, 'plugins', plugin.id));
- }
- }
- },
- 'js-module': {
- install: function (obj, plugin, project, options) {
- // Copy the plugin's files into the www directory.
- const moduleSource = path.resolve(plugin.dir, obj.src);
- const moduleName = `${plugin.id}.${obj.name || path.basename(obj.src, path.extname(obj.src))}`;
-
- // Read in the file, prepend the cordova.define, and write it back out.
- let scriptContent = fs.readFileSync(moduleSource, 'utf-8').replace(/^\ufeff/, ''); // Window BOM
- if (moduleSource.match(/.*\.json$/)) {
- scriptContent = `module.exports = ${scriptContent}`;
- }
- scriptContent = `cordova.define("${moduleName}", function(require, exports, module) {\n${scriptContent}\n});\n`;
-
- const moduleDestination = path.resolve(project.www, 'plugins', plugin.id, obj.src);
- fs.ensureDirSync(path.dirname(moduleDestination));
- fs.writeFileSync(moduleDestination, scriptContent, 'utf-8');
- if (options && options.usePlatformWww) {
- const platformWwwDestination = path.resolve(project.platformWww, 'plugins', plugin.id, obj.src);
- fs.ensureDirSync(path.dirname(platformWwwDestination));
- fs.writeFileSync(platformWwwDestination, scriptContent, 'utf-8');
- }
- },
- uninstall: function (obj, plugin, project, options) {
- const pluginRelativePath = path.join('plugins', plugin.id, obj.src);
- removeFileAndParents(project.www, pluginRelativePath);
- if (options && options.usePlatformWww) removeFileAndParents(project.platformWww, pluginRelativePath);
- }
- }
-};
-
-module.exports.getInstaller = type => {
- if (handlers[type] && handlers[type].install) {
- return handlers[type].install;
- }
-
- events.emit('warn', `<${type}> is not supported for iOS plugins`);
-};
-
-module.exports.getUninstaller = type => {
- if (handlers[type] && handlers[type].uninstall) {
- return handlers[type].uninstall;
- }
-
- events.emit('warn', `<${type}> is not supported for iOS plugins`);
-};
-
-function installHelper (type, obj, plugin_dir, project_dir, plugin_id, options, project) {
- const srcFile = path.resolve(plugin_dir, obj.src);
- const targetDir = path.resolve(project.plugins_dir, plugin_id, obj.targetDir || '');
- const destFile = path.join(targetDir, path.basename(obj.src));
-
- let project_ref;
- const link = !!(options && options.link);
- if (link) {
- const trueSrc = fs.realpathSync(srcFile);
- // Create a symlink in the expected place, so that uninstall can use it.
- if (options && options.force) {
- copyFile(plugin_dir, trueSrc, project_dir, destFile, link);
- } else {
- copyNewFile(plugin_dir, trueSrc, project_dir, destFile, link);
- }
- // Xcode won't save changes to a file if there is a symlink involved.
- // Make the Xcode reference the file directly.
- // Note: Can't use path.join() here since it collapses 'Plugins/..', and xcode
- // library special-cases Plugins/ prefix.
- project_ref = `Plugins/${fixPathSep(path.relative(fs.realpathSync(project.plugins_dir), trueSrc))}`;
- } else {
- if (options && options.force) {
- copyFile(plugin_dir, srcFile, project_dir, destFile, link);
- } else {
- copyNewFile(plugin_dir, srcFile, project_dir, destFile, link);
- }
- project_ref = `Plugins/${fixPathSep(path.relative(project.plugins_dir, destFile))}`;
- }
-
- if (type === 'header-file') {
- project.xcode.addHeaderFile(project_ref);
- } else if (obj.framework) {
- const opt = { weak: obj.weak };
- const project_relative = path.join(path.basename(project.xcode_path), project_ref);
- project.xcode.addFramework(project_relative, opt);
- project.xcode.addToLibrarySearchPaths({ path: project_ref });
- } else {
- project.xcode.addSourceFile(project_ref, obj.compilerFlags ? { compilerFlags: obj.compilerFlags } : {});
- }
-}
-
-function uninstallHelper (type, obj, project_dir, plugin_id, options, project) {
- const targetDir = path.resolve(project.plugins_dir, plugin_id, obj.targetDir || '');
- const destFile = path.join(targetDir, path.basename(obj.src));
-
- let project_ref;
- const link = !!(options && options.link);
- if (link) {
- const trueSrc = fs.readlinkSync(destFile);
- project_ref = `Plugins/${fixPathSep(path.relative(fs.realpathSync(project.plugins_dir), trueSrc))}`;
- } else {
- project_ref = `Plugins/${fixPathSep(path.relative(project.plugins_dir, destFile))}`;
- }
-
- fs.removeSync(targetDir);
-
- if (type === 'header-file') {
- project.xcode.removeHeaderFile(project_ref);
- } else if (obj.framework) {
- const project_relative = path.join(path.basename(project.xcode_path), project_ref);
- project.xcode.removeFramework(project_relative);
- project.xcode.removeFromLibrarySearchPaths({ path: project_ref });
- } else {
- project.xcode.removeSourceFile(project_ref);
- }
-}
-
-const pathSepFix = new RegExp(path.sep.replace(/\\/, '\\\\'), 'g');
-function fixPathSep (file) {
- return file.replace(pathSepFix, '/');
-}
-
-function copyFile (plugin_dir, src, project_dir, dest, link) {
- src = path.resolve(plugin_dir, src);
- if (!fs.existsSync(src)) throw new CordovaError(`"${src}" not found!`);
-
- // check that src path is inside plugin directory
- const real_path = fs.realpathSync(src);
- const real_plugin_path = fs.realpathSync(plugin_dir);
- if (real_path.indexOf(real_plugin_path) !== 0) { throw new CordovaError(`File "${src}" is located outside the plugin directory "${plugin_dir}"`); }
-
- dest = path.resolve(project_dir, dest);
-
- // check that dest path is located in project directory
- if (dest.indexOf(project_dir) !== 0) { throw new CordovaError(`Destination "${dest}" for source file "${src}" is located outside the project`); }
-
- fs.ensureDirSync(path.dirname(dest));
-
- if (link) {
- linkFileOrDirTree(src, dest);
- } else {
- fs.copySync(src, dest);
- }
-}
-
-// Same as copy file but throws error if target exists
-function copyNewFile (plugin_dir, src, project_dir, dest, link) {
- const target_path = path.resolve(project_dir, dest);
- if (fs.existsSync(target_path)) { throw new CordovaError(`"${target_path}" already exists!`); }
-
- copyFile(plugin_dir, src, project_dir, dest, !!link);
-}
-
-function linkFileOrDirTree (src, dest) {
- if (fs.existsSync(dest)) {
- fs.removeSync(dest);
- }
-
- if (fs.statSync(src).isDirectory()) {
- fs.ensureDirSync(dest);
- fs.readdirSync(src).forEach(entry => {
- linkFileOrDirTree(path.join(src, entry), path.join(dest, entry));
- });
- } else {
- fs.linkSync(src, dest);
- }
-}
-
-// checks if file exists and then deletes. Error if doesn't exist
-function removeFile (project_dir, src) {
- const file = path.resolve(project_dir, src);
- fs.removeSync(file);
-}
-
-// deletes file/directory without checking
-function removeFileF (file) {
- fs.removeSync(file);
-}
-
-function removeFileAndParents (baseDir, destFile, stopper) {
- stopper = stopper || '.';
- const file = path.resolve(baseDir, destFile);
- if (!fs.existsSync(file)) return;
-
- removeFileF(file);
-
- // check if directory is empty
- let curDir = path.dirname(file);
-
- while (curDir !== path.resolve(baseDir, stopper)) {
- if (fs.existsSync(curDir) && fs.readdirSync(curDir).length === 0) {
- fs.rmdirSync(curDir);
- curDir = path.resolve(curDir, '..');
- } else {
- // directory not empty...do nothing
- break;
- }
- }
-}
-
-function generateAttributeError (attribute, element, id) {
- return `Required attribute "${attribute}" not specified in <${element}> element from plugin: ${id}`;
-}
diff --git a/cordova/platforms/ios/cordova/lib/prepare.js b/cordova/platforms/ios/cordova/lib/prepare.js
deleted file mode 100644
index 7badf9fa1..000000000
--- a/cordova/platforms/ios/cordova/lib/prepare.js
+++ /dev/null
@@ -1,1151 +0,0 @@
-/**
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-'use strict';
-
-const fs = require('fs-extra');
-const path = require('path');
-const unorm = require('unorm');
-const plist = require('plist');
-const URL = require('url');
-const events = require('cordova-common').events;
-const xmlHelpers = require('cordova-common').xmlHelpers;
-const ConfigParser = require('cordova-common').ConfigParser;
-const CordovaError = require('cordova-common').CordovaError;
-const PlatformJson = require('cordova-common').PlatformJson;
-const PlatformMunger = require('cordova-common').ConfigChanges.PlatformMunger;
-const PluginInfoProvider = require('cordova-common').PluginInfoProvider;
-const FileUpdater = require('cordova-common').FileUpdater;
-const projectFile = require('./projectFile');
-
-// launch storyboard and related constants
-const IMAGESET_COMPACT_SIZE_CLASS = 'compact';
-const CDV_ANY_SIZE_CLASS = 'any';
-
-module.exports.prepare = function (cordovaProject, options) {
- const platformJson = PlatformJson.load(this.locations.root, 'ios');
- const munger = new PlatformMunger('ios', this.locations.root, platformJson, new PluginInfoProvider());
-
- this._config = updateConfigFile(cordovaProject.projectConfig, munger, this.locations);
-
- // Update own www dir with project's www assets and plugins' assets and js-files
- return updateWww(cordovaProject, this.locations)
- // update project according to config.xml changes.
- .then(() => updateProject(this._config, this.locations))
- .then(() => {
- updateIcons(cordovaProject, this.locations);
- updateLaunchStoryboardImages(cordovaProject, this.locations);
- updateBackgroundColor(cordovaProject, this.locations);
- updateFileResources(cordovaProject, this.locations);
- })
- .then(() => {
- alertDeprecatedPreference(this._config);
- })
- .then(() => {
- events.emit('verbose', 'Prepared iOS project successfully');
- });
-};
-
-module.exports.clean = function (options) {
- // A cordovaProject isn't passed into the clean() function, because it might have
- // been called from the platform shell script rather than the CLI. Check for the
- // noPrepare option passed in by the non-CLI clean script. If that's present, or if
- // there's no config.xml found at the project root, then don't clean prepared files.
- const projectRoot = path.resolve(this.root, '../..');
- const projectConfigFile = path.join(projectRoot, 'config.xml');
- if ((options && options.noPrepare) || !fs.existsSync(projectConfigFile) ||
- !fs.existsSync(this.locations.configXml)) {
- return Promise.resolve();
- }
-
- const projectConfig = new ConfigParser(this.locations.configXml);
-
- return Promise.resolve().then(() => {
- cleanWww(projectRoot, this.locations);
- cleanIcons(projectRoot, projectConfig, this.locations);
- cleanLaunchStoryboardImages(projectRoot, projectConfig, this.locations);
- cleanBackgroundColor(projectRoot, projectConfig, this.locations);
- cleanFileResources(projectRoot, projectConfig, this.locations);
- });
-};
-
-/**
- * Updates config files in project based on app's config.xml and config munge,
- * generated by plugins.
- *
- * @param {ConfigParser} sourceConfig A project's configuration that will
- * be merged into platform's config.xml
- * @param {ConfigChanges} configMunger An initialized ConfigChanges instance
- * for this platform.
- * @param {Object} locations A map of locations for this platform
- *
- * @return {ConfigParser} An instance of ConfigParser, that
- * represents current project's configuration. When returned, the
- * configuration is already dumped to appropriate config.xml file.
- */
-function updateConfigFile (sourceConfig, configMunger, locations) {
- events.emit('verbose', `Generating platform-specific config.xml from defaults for iOS at ${locations.configXml}`);
-
- // First cleanup current config and merge project's one into own
- // Overwrite platform config.xml with defaults.xml.
- fs.copySync(locations.defaultConfigXml, locations.configXml);
-
- // Then apply config changes from global munge to all config files
- // in project (including project's config)
- configMunger.reapply_global_munge().save_all();
-
- events.emit('verbose', 'Merging project\'s config.xml into platform-specific iOS config.xml');
- // Merge changes from app's config.xml into platform's one
- const config = new ConfigParser(locations.configXml);
- xmlHelpers.mergeXml(sourceConfig.doc.getroot(),
- config.doc.getroot(), 'ios', /* clobber= */true);
-
- config.write();
- return config;
-}
-
-/**
- * Logs all file operations via the verbose event stream, indented.
- */
-function logFileOp (message) {
- events.emit('verbose', ` ${message}`);
-}
-
-/**
- * Updates platform 'www' directory by replacing it with contents of
- * 'platform_www' and app www. Also copies project's overrides' folder into
- * the platform 'www' folder
- *
- * @param {Object} cordovaProject An object which describes cordova project.
- * @param {boolean} destinations An object that contains destinations
- * paths for www files.
- */
-function updateWww (cordovaProject, destinations) {
- const sourceDirs = [
- path.relative(cordovaProject.root, cordovaProject.locations.www),
- path.relative(cordovaProject.root, destinations.platformWww)
- ];
-
- // If project contains 'merges' for our platform, use them as another overrides
- const merges_path = path.join(cordovaProject.root, 'merges', 'ios');
- if (fs.existsSync(merges_path)) {
- events.emit('verbose', 'Found "merges/ios" folder. Copying its contents into the iOS project.');
- sourceDirs.push(path.join('merges', 'ios'));
- }
-
- const targetDir = path.relative(cordovaProject.root, destinations.www);
- events.emit(
- 'verbose', `Merging and updating files from [${sourceDirs.join(', ')}] to ${targetDir}`);
- FileUpdater.mergeAndUpdateDir(
- sourceDirs, targetDir, { rootDir: cordovaProject.root }, logFileOp);
-
- return Promise.resolve();
-}
-
-/**
- * Cleans all files from the platform 'www' directory.
- */
-function cleanWww (projectRoot, locations) {
- const targetDir = path.relative(projectRoot, locations.www);
- events.emit('verbose', `Cleaning ${targetDir}`);
-
- // No source paths are specified, so mergeAndUpdateDir() will clear the target directory.
- FileUpdater.mergeAndUpdateDir(
- [], targetDir, { rootDir: projectRoot, all: true }, logFileOp);
-}
-
-/**
- * Updates project structure and AndroidManifest according to project's configuration.
- *
- * @param {ConfigParser} platformConfig A project's configuration that will
- * be used to update project
- * @param {Object} locations A map of locations for this platform (In/Out)
- */
-function updateProject (platformConfig, locations) {
- // CB-6992 it is necessary to normalize characters
- // because node and shell scripts handles unicode symbols differently
- // We need to normalize the name to NFD form since iOS uses NFD unicode form
- const name = unorm.nfd(platformConfig.name());
- const version = platformConfig.version();
- const displayName = platformConfig.shortName && platformConfig.shortName();
-
- const originalName = path.basename(locations.xcodeCordovaProj);
-
- // Update package id (bundle id)
- const plistFile = path.join(locations.xcodeCordovaProj, `${originalName}-Info.plist`);
- const infoPlist = plist.parse(fs.readFileSync(plistFile, 'utf8'));
-
- // Update version (bundle version)
- infoPlist.CFBundleShortVersionString = version;
- const CFBundleVersion = platformConfig.getAttribute('ios-CFBundleVersion') || default_CFBundleVersion(version);
- infoPlist.CFBundleVersion = CFBundleVersion;
-
- if (platformConfig.getAttribute('defaultlocale')) {
- infoPlist.CFBundleDevelopmentRegion = platformConfig.getAttribute('defaultlocale');
- }
-
- if (displayName) {
- infoPlist.CFBundleDisplayName = displayName;
- }
-
- // replace Info.plist ATS entries according to <access> and <allow-navigation> config.xml entries
- const ats = writeATSEntries(platformConfig);
- if (Object.keys(ats).length > 0) {
- infoPlist.NSAppTransportSecurity = ats;
- } else {
- delete infoPlist.NSAppTransportSecurity;
- }
-
- handleOrientationSettings(platformConfig, infoPlist);
-
- /* eslint-disable no-tabs */
- // Write out the plist file with the same formatting as Xcode does
- let info_contents = plist.build(infoPlist, { indent: '\t', offset: -1 });
- /* eslint-enable no-tabs */
-
- info_contents = info_contents.replace(/<string>[\s\r\n]*<\/string>/g, '<string></string>');
- fs.writeFileSync(plistFile, info_contents, 'utf-8');
- events.emit('verbose', `Wrote out iOS Bundle Version "${version}" to ${plistFile}`);
-
- return handleBuildSettings(platformConfig, locations, infoPlist).then(() => {
- if (name === originalName) {
- events.emit('verbose', `iOS Product Name has not changed (still "${originalName}")`);
- return Promise.resolve();
- } else { // CB-11712 <name> was changed, we don't support it'
- const errorString =
- 'The product name change (<name> tag) in config.xml is not supported dynamically.\n' +
- 'To change your product name, you have to remove, then add your ios platform again.\n' +
- 'Make sure you save your plugins beforehand using `cordova plugin save`.\n' +
- '\tcordova plugin save\n' +
- '\tcordova platform rm ios\n' +
- '\tcordova platform add ios\n';
-
- return Promise.reject(new CordovaError(errorString));
- }
- });
-}
-
-function handleOrientationSettings (platformConfig, infoPlist) {
- switch (getOrientationValue(platformConfig)) {
- case 'portrait':
- infoPlist.UIInterfaceOrientation = ['UIInterfaceOrientationPortrait'];
- infoPlist.UISupportedInterfaceOrientations = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown'];
- infoPlist['UISupportedInterfaceOrientations~ipad'] = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown'];
- break;
- case 'landscape':
- infoPlist.UIInterfaceOrientation = ['UIInterfaceOrientationLandscapeLeft'];
- infoPlist.UISupportedInterfaceOrientations = ['UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
- infoPlist['UISupportedInterfaceOrientations~ipad'] = ['UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
- break;
- case 'all':
- infoPlist.UIInterfaceOrientation = ['UIInterfaceOrientationPortrait'];
- infoPlist.UISupportedInterfaceOrientations = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
- infoPlist['UISupportedInterfaceOrientations~ipad'] = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
- break;
- case 'default':
- infoPlist.UISupportedInterfaceOrientations = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
- infoPlist['UISupportedInterfaceOrientations~ipad'] = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight'];
- delete infoPlist.UIInterfaceOrientation;
- }
-}
-
-function handleBuildSettings (platformConfig, locations, infoPlist) {
- const pkg = platformConfig.getAttribute('ios-CFBundleIdentifier') || platformConfig.packageName();
- const targetDevice = parseTargetDevicePreference(platformConfig.getPreference('target-device', 'ios'));
- const deploymentTarget = platformConfig.getPreference('deployment-target', 'ios');
- const swiftVersion = platformConfig.getPreference('SwiftVersion', 'ios');
-
- let project;
-
- try {
- project = projectFile.parse(locations);
- } catch (err) {
- return Promise.reject(new CordovaError(`Could not parse ${locations.pbxproj}: ${err}`));
- }
-
- const origPkg = project.xcode.getBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', undefined, platformConfig.name());
-
- // no build settings provided and we don't need to update build settings for launch storyboards,
- // then we don't need to parse and update .pbxproj file
- if (origPkg === pkg && !targetDevice && !deploymentTarget && !swiftVersion) {
- return Promise.resolve();
- }
-
- if (origPkg !== pkg) {
- events.emit('verbose', `Set PRODUCT_BUNDLE_IDENTIFIER to ${pkg}.`);
- project.xcode.updateBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', pkg, null, platformConfig.name());
- }
-
- if (targetDevice) {
- events.emit('verbose', `Set TARGETED_DEVICE_FAMILY to ${targetDevice}.`);
- project.xcode.updateBuildProperty('TARGETED_DEVICE_FAMILY', targetDevice);
- }
-
- if (deploymentTarget) {
- events.emit('verbose', `Set IPHONEOS_DEPLOYMENT_TARGET to "${deploymentTarget}".`);
- project.xcode.updateBuildProperty('IPHONEOS_DEPLOYMENT_TARGET', deploymentTarget);
- }
-
- if (swiftVersion) {
- events.emit('verbose', `Set SwiftVersion to "${swiftVersion}".`);
- project.xcode.updateBuildProperty('SWIFT_VERSION', swiftVersion);
- }
-
- project.write();
-
- return Promise.resolve();
-}
-
-function mapIconResources (icons, iconsDir) {
- // See https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
- // for launch images sizes reference.
- const platformIcons = [
- { dest: 'icon-20.png', width: 20, height: 20 },
- { dest: '[email protected]', width: 40, height: 40 },
- { dest: '[email protected]', width: 60, height: 60 },
- { dest: 'icon-40.png', width: 40, height: 40 },
- { dest: '[email protected]', width: 80, height: 80 },
- { dest: 'icon-50.png', width: 50, height: 50 },
- { dest: '[email protected]', width: 100, height: 100 },
- { dest: '[email protected]', width: 120, height: 120 },
- { dest: '[email protected]', width: 180, height: 180 },
- { dest: 'icon-72.png', width: 72, height: 72 },
- { dest: '[email protected]', width: 144, height: 144 },
- { dest: 'icon-76.png', width: 76, height: 76 },
- { dest: '[email protected]', width: 152, height: 152 },
- { dest: '[email protected]', width: 167, height: 167 },
- { dest: 'icon-1024.png', width: 1024, height: 1024 },
- { dest: 'icon-29.png', width: 29, height: 29 },
- { dest: '[email protected]', width: 58, height: 58 },
- { dest: '[email protected]', width: 87, height: 87 },
- { dest: 'icon.png', width: 57, height: 57 },
- { dest: '[email protected]', width: 114, height: 114 },
- { dest: '[email protected]', width: 48, height: 48 },
- { dest: '[email protected]', width: 55, height: 55 },
- { dest: '[email protected]', width: 88, height: 88 },
- { dest: '[email protected]', width: 172, height: 172 },
- { dest: '[email protected]', width: 196, height: 196 }
- ];
-
- const pathMap = {};
- platformIcons.forEach(item => {
- const icon = icons.getBySize(item.width, item.height) || icons.getDefault();
- if (icon) {
- const target = path.join(iconsDir, item.dest);
- pathMap[target] = icon.src;
- }
- });
- return pathMap;
-}
-
-function getIconsDir (projectRoot, platformProjDir) {
- let iconsDir;
- const xcassetsExists = folderExists(path.join(projectRoot, platformProjDir, 'Images.xcassets/'));
-
- if (xcassetsExists) {
- iconsDir = path.join(platformProjDir, 'Images.xcassets/AppIcon.appiconset/');
- } else {
- iconsDir = path.join(platformProjDir, 'Resources/icons/');
- }
-
- return iconsDir;
-}
-
-function updateIcons (cordovaProject, locations) {
- const icons = cordovaProject.projectConfig.getIcons('ios');
-
- if (icons.length === 0) {
- events.emit('verbose', 'This app does not have icons defined');
- return;
- }
-
- const platformProjDir = path.relative(cordovaProject.root, locations.xcodeCordovaProj);
- const iconsDir = getIconsDir(cordovaProject.root, platformProjDir);
- const resourceMap = mapIconResources(icons, iconsDir);
- events.emit('verbose', `Updating icons at ${iconsDir}`);
- FileUpdater.updatePaths(
- resourceMap, { rootDir: cordovaProject.root }, logFileOp);
-}
-
-function cleanIcons (projectRoot, projectConfig, locations) {
- const icons = projectConfig.getIcons('ios');
- if (icons.length > 0) {
- const platformProjDir = path.relative(projectRoot, locations.xcodeCordovaProj);
- const iconsDir = getIconsDir(projectRoot, platformProjDir);
- const resourceMap = mapIconResources(icons, iconsDir);
- Object.keys(resourceMap).forEach(targetIconPath => {
- resourceMap[targetIconPath] = null;
- });
- events.emit('verbose', `Cleaning icons at ${iconsDir}`);
-
- // Source paths are removed from the map, so updatePaths() will delete the target files.
- FileUpdater.updatePaths(
- resourceMap, { rootDir: projectRoot, all: true }, logFileOp);
- }
-}
-
-/**
- * Returns the directory for the BackgroundColor.colorset asset, or null if no
- * xcassets exist.
- *
- * @param {string} projectRoot The project's root directory
- * @param {string} platformProjDir The platform's project directory
- */
-function getBackgroundColorDir (projectRoot, platformProjDir) {
- if (folderExists(path.join(projectRoot, platformProjDir, 'Images.xcassets/'))) {
- return path.join(platformProjDir, 'Images.xcassets', 'BackgroundColor.colorset');
- } else {
- return null;
- }
-}
-
-function colorPreferenceToComponents (pref) {
- if (!pref || !pref.match(/^(#[0-9A-Fa-f]{3}|(0x|#)([0-9A-Fa-f]{2})?[0-9A-Fa-f]{6})$/)) {
- return {
- platform: 'ios',
- reference: 'systemBackgroundColor'
- };
- }
-
- let red = 'FF';
- let green = 'FF';
- let blue = 'FF';
- let alpha = 1.0;
-
- if (pref[0] === '#' && pref.length === 4) {
- red = pref[1] + pref[1];
- green = pref[2] + pref[2];
- blue = pref[3] + pref[3];
- }
-
- if (pref.length >= 7 && (pref[0] === '#' || pref.substring(0, 2) === '0x')) {
- let offset = pref[0] === '#' ? 1 : 2;
-
- if (pref.substring(offset).length === 8) {
- alpha = parseInt(pref.substring(offset, offset + 2), 16) / 255.0;
- offset += 2;
- }
-
- red = pref.substring(offset, offset + 2);
- green = pref.substring(offset + 2, offset + 4);
- blue = pref.substring(offset + 4, offset + 6);
- }
-
- return {
- 'color-space': 'srgb',
- components: {
- red: '0x' + red.toUpperCase(),
- green: '0x' + green.toUpperCase(),
- blue: '0x' + blue.toUpperCase(),
- alpha: alpha.toFixed(3)
- }
- };
-}
-
-/**
- * Update the background color Contents.json in xcassets.
- *
- * @param {Object} cordovaProject The cordova project
- * @param {Object} locations A dictionary containing useful location paths
- */
-function updateBackgroundColor (cordovaProject, locations) {
- const pref = cordovaProject.projectConfig.getPreference('BackgroundColor', 'ios') || '';
-
- const platformProjDir = path.relative(cordovaProject.root, locations.xcodeCordovaProj);
- const backgroundColorDir = getBackgroundColorDir(cordovaProject.root, platformProjDir);
-
- if (backgroundColorDir) {
- const contentsJSON = {
- colors: [{
- idiom: 'universal',
- color: colorPreferenceToComponents(pref)
- }],
- info: {
- author: 'Xcode',
- version: 1
- }
- };
-
- events.emit('verbose', 'Updating Background Color color set Contents.json');
- fs.writeFileSync(path.join(cordovaProject.root, backgroundColorDir, 'Contents.json'),
- JSON.stringify(contentsJSON, null, 2));
- }
-}
-
-/**
- * Resets the background color Contents.json in xcassets to default.
- *
- * @param {string} projectRoot Path to the project root
- * @param {Object} projectConfig The project's config.xml
- * @param {Object} locations A dictionary containing useful location paths
- */
-function cleanBackgroundColor (projectRoot, projectConfig, locations) {
- const platformProjDir = path.relative(projectRoot, locations.xcodeCordovaProj);
- const backgroundColorDir = getBackgroundColorDir(projectRoot, platformProjDir);
-
- if (backgroundColorDir) {
- const contentsJSON = {
- colors: [{
- idiom: 'universal',
- color: colorPreferenceToComponents(null)
- }],
- info: {
- author: 'Xcode',
- version: 1
- }
- };
-
- events.emit('verbose', 'Cleaning Background Color color set Contents.json');
- fs.writeFileSync(path.join(projectRoot, backgroundColorDir, 'Contents.json'),
- JSON.stringify(contentsJSON, null, 2));
- }
-}
-
-function updateFileResources (cordovaProject, locations) {
- const platformDir = path.relative(cordovaProject.root, locations.root);
- const files = cordovaProject.projectConfig.getFileResources('ios');
-
- const project = projectFile.parse(locations);
-
- // if there are resource-file elements in config.xml
- if (files.length === 0) {
- events.emit('verbose', 'This app does not have additional resource files defined');
- return;
- }
-
- const resourceMap = {};
- files.forEach(res => {
- const src = res.src;
- let target = res.target;
-
- if (!target) {
- target = src;
- }
-
- let targetPath = path.join(project.resources_dir, target);
- targetPath = path.relative(cordovaProject.root, targetPath);
-
- if (!fs.existsSync(targetPath)) {
- project.xcode.addResourceFile(target);
- } else {
- events.emit('warn', `Overwriting existing resource file at ${targetPath}`);
- }
-
- resourceMap[targetPath] = src;
- });
-
- events.emit('verbose', `Updating resource files at ${platformDir}`);
- FileUpdater.updatePaths(
- resourceMap, { rootDir: cordovaProject.root }, logFileOp);
-
- project.write();
-}
-
-function alertDeprecatedPreference (configParser) {
- const deprecatedToNewPreferences = {
- MediaPlaybackRequiresUserAction: {
- newPreference: 'MediaTypesRequiringUserActionForPlayback',
- isDeprecated: true
- },
- MediaPlaybackAllowsAirPlay: {
- newPreference: 'AllowsAirPlayForMediaPlayback',
- isDeprecated: false
- }
- };
-
- Object.keys(deprecatedToNewPreferences).forEach(oldKey => {
- if (configParser.getPreference(oldKey)) {
- const isDeprecated = deprecatedToNewPreferences[oldKey].isDeprecated;
- const verb = isDeprecated ? 'has been' : 'is being';
- const newPreferenceKey = deprecatedToNewPreferences[oldKey].newPreference;
-
- // Create the Log Message
- const log = [`The preference name "${oldKey}" ${verb} deprecated.`];
- if (newPreferenceKey) {
- log.push(`It is recommended to replace this preference with "${newPreferenceKey}."`);
- } else {
- log.push('There is no replacement for this preference.');
- }
-
- /**
- * If the preference has been deprecated, the usage of the old preference is no longer used.
- * Therefore, the following line is not appended. It is added only if the old preference is still used.
- * We are only keeping the top lines for deprecated items only for an additional major release when
- * the pre-warning was not provided in a past major release due to a necessary quick deprecation.
- * Typically caused by implementation nature or third-party requirement changes.
- */
- if (!isDeprecated) {
- log.push('Please note that this preference will be removed in the near future.');
- }
-
- events.emit('warn', log.join(' '));
- }
- });
-}
-
-function cleanFileResources (projectRoot, projectConfig, locations) {
- const platformDir = path.relative(projectRoot, locations.root);
- const files = projectConfig.getFileResources('ios', true);
- if (files.length > 0) {
- events.emit('verbose', `Cleaning resource files at ${platformDir}`);
-
- const project = projectFile.parse(locations);
-
- const resourceMap = {};
- files.forEach(res => {
- const src = res.src;
- let target = res.target;
-
- if (!target) {
- target = src;
- }
-
- let targetPath = path.join(project.resources_dir, target);
- targetPath = path.relative(projectRoot, targetPath);
- const resfile = path.join('Resources', path.basename(targetPath));
- project.xcode.removeResourceFile(resfile);
-
- resourceMap[targetPath] = null;
- });
-
- FileUpdater.updatePaths(
- resourceMap, { rootDir: projectRoot, all: true }, logFileOp);
-
- project.write();
- }
-}
-
-/**
- * Returns an array of images for each possible idiom, scale, and size class. The images themselves are
- * located in the platform's splash images by their pattern (@scale~idiom~sizesize). All possible
- * combinations are returned, but not all will have a `filename` property. If the latter isn't present,
- * the device won't attempt to load an image matching the same traits. If the filename is present,
- * the device will try to load the image if it corresponds to the traits.
- *
- * The resulting return looks like this:
- *
- * [
- * {
- * idiom: 'universal|ipad|iphone',
- * scale: '1x|2x|3x',
- * width: 'any|com',
- * height: 'any|com',
- * filename: undefined|'Default@scale~idiom~widthheight.png',
- * src: undefined|'path/to/original/matched/image/from/splash/screens.png',
- * target: undefined|'path/to/asset/library/Default@scale~idiom~widthheight.png',
- * appearence: undefined|'dark'|'light'
- * }, ...
- * ]
- *
- * @param {Array<Object>} splashScreens splash screens as defined in config.xml for this platform
- * @param {string} launchStoryboardImagesDir project-root/Images.xcassets/LaunchStoryboard.imageset/
- * @return {Array<Object>}
- */
-function mapLaunchStoryboardContents (splashScreens, launchStoryboardImagesDir) {
- const platformLaunchStoryboardImages = [];
- const idioms = ['universal', 'ipad', 'iphone'];
- const scalesForIdiom = {
- universal: ['1x', '2x', '3x'],
- ipad: ['1x', '2x'],
- iphone: ['1x', '2x', '3x']
- };
- const sizes = ['com', 'any'];
- const appearences = ['', 'dark', 'light'];
-
- idioms.forEach(idiom => {
- scalesForIdiom[idiom].forEach(scale => {
- sizes.forEach(width => {
- sizes.forEach(height => {
- appearences.forEach(appearence => {
- const item = { idiom, scale, width, height };
-
- if (appearence !== '') {
- item.appearence = appearence;
- }
-
- /* examples of the search pattern:
- * scale ~ idiom ~ width height ~ appearence
- * @2x ~ universal ~ any any
- * @3x ~ iphone ~ com any ~ dark
- * @2x ~ ipad ~ com any ~ light
- */
- const searchPattern = '@' + scale + '~' + idiom + '~' + width + height + (appearence ? '~' + appearence : '');
-
- /* because old node versions don't have Array.find, the below is
- * functionally equivalent to this:
- * var launchStoryboardImage = splashScreens.find(function(item) {
- * return (item.src.indexOf(searchPattern) >= 0) ? (appearence !== '' ? true : ((item.src.indexOf(searchPattern + '~light') >= 0 || (item.src.indexOf(searchPattern + '~dark') >= 0)) ? false : true)) : false;
- * });
- */
- const launchStoryboardImage = splashScreens.reduce(
- (p, c) => (c.src.indexOf(searchPattern) >= 0) ? (appearence !== '' ? c : ((c.src.indexOf(searchPattern + '~light') >= 0 || (c.src.indexOf(searchPattern + '~dark') >= 0)) ? p : c)) : p,
- undefined
- );
-
- if (launchStoryboardImage) {
- item.filename = `Default${searchPattern}.png`;
- item.src = launchStoryboardImage.src;
- item.target = path.join(launchStoryboardImagesDir, item.filename);
- }
-
- platformLaunchStoryboardImages.push(item);
- });
- });
- });
- });
- });
- return platformLaunchStoryboardImages;
-}
-
-/**
- * Returns a dictionary representing the source and destination paths for the launch storyboard images
- * that need to be copied.
- *
- * The resulting return looks like this:
- *
- * {
- * 'target-path': 'source-path',
- * ...
- * }
- *
- * @param {Array<Object>} splashScreens splash screens as defined in config.xml for this platform
- * @param {string} launchStoryboardImagesDir project-root/Images.xcassets/LaunchStoryboard.imageset/
- * @return {Object}
- */
-function mapLaunchStoryboardResources (splashScreens, launchStoryboardImagesDir) {
- const platformLaunchStoryboardImages = mapLaunchStoryboardContents(splashScreens, launchStoryboardImagesDir);
- const pathMap = {};
- platformLaunchStoryboardImages.forEach(item => {
- if (item.target) {
- pathMap[item.target] = item.src;
- }
- });
- return pathMap;
-}
-
-/**
- * Builds the object that represents the contents.json file for the LaunchStoryboard image set.
- *
- * The resulting return looks like this:
- *
- * {
- * images: [
- * {
- * idiom: 'universal|ipad|iphone',
- * scale: '1x|2x|3x',
- * width-class: undefined|'compact',
- * height-class: undefined|'compact'
- * ...
- * }, ...
- * ],
- * info: {
- * author: 'Xcode',
- * version: 1
- * }
- * }
- *
- * A bit of minor logic is used to map from the array of images returned from mapLaunchStoryboardContents
- * to the format requried by Xcode.
- *
- * @param {Array<Object>} splashScreens splash screens as defined in config.xml for this platform
- * @param {string} launchStoryboardImagesDir project-root/Images.xcassets/LaunchStoryboard.imageset/
- * @return {Object}
- */
-function getLaunchStoryboardContentsJSON (splashScreens, launchStoryboardImagesDir) {
- const platformLaunchStoryboardImages = mapLaunchStoryboardContents(splashScreens, launchStoryboardImagesDir);
- const contentsJSON = {
- images: [],
- info: {
- author: 'Xcode',
- version: 1
- }
- };
- contentsJSON.images = platformLaunchStoryboardImages.map(item => {
- const newItem = {
- idiom: item.idiom,
- scale: item.scale
- };
-
- // Xcode doesn't want any size class property if the class is "any"
- // If our size class is "com", Xcode wants "compact".
- if (item.width !== CDV_ANY_SIZE_CLASS) {
- newItem['width-class'] = IMAGESET_COMPACT_SIZE_CLASS;
- }
- if (item.height !== CDV_ANY_SIZE_CLASS) {
- newItem['height-class'] = IMAGESET_COMPACT_SIZE_CLASS;
- }
-
- if (item.appearence) {
- newItem.appearances = [{ appearance: 'luminosity', value: item.appearence }];
- }
-
- // Xcode doesn't want a filename property if there's no image for these traits
- if (item.filename) {
- newItem.filename = item.filename;
- }
- return newItem;
- });
- return contentsJSON;
-}
-
-/**
- * Returns the directory for the Launch Storyboard image set, if image sets are being used. If they aren't
- * being used, returns null.
- *
- * @param {string} projectRoot The project's root directory
- * @param {string} platformProjDir The platform's project directory
- */
-function getLaunchStoryboardImagesDir (projectRoot, platformProjDir) {
- let launchStoryboardImagesDir;
- const xcassetsExists = folderExists(path.join(projectRoot, platformProjDir, 'Images.xcassets/'));
-
- if (xcassetsExists) {
- launchStoryboardImagesDir = path.join(platformProjDir, 'Images.xcassets/LaunchStoryboard.imageset/');
- } else {
- // if we don't have a asset library for images, we can't do the storyboard.
- launchStoryboardImagesDir = null;
- }
-
- return launchStoryboardImagesDir;
-}
-
-/**
- * Update the images for the Launch Storyboard and updates the image set's contents.json file appropriately.
- *
- * @param {Object} cordovaProject The cordova project
- * @param {Object} locations A dictionary containing useful location paths
- */
-function updateLaunchStoryboardImages (cordovaProject, locations) {
- const splashScreens = cordovaProject.projectConfig.getSplashScreens('ios');
- const platformProjDir = path.relative(cordovaProject.root, locations.xcodeCordovaProj);
- const launchStoryboardImagesDir = getLaunchStoryboardImagesDir(cordovaProject.root, platformProjDir);
-
- if (launchStoryboardImagesDir) {
- const resourceMap = mapLaunchStoryboardResources(splashScreens, launchStoryboardImagesDir);
- const contentsJSON = getLaunchStoryboardContentsJSON(splashScreens, launchStoryboardImagesDir);
-
- events.emit('verbose', `Updating launch storyboard images at ${launchStoryboardImagesDir}`);
- FileUpdater.updatePaths(
- resourceMap, { rootDir: cordovaProject.root }, logFileOp);
-
- events.emit('verbose', 'Updating Storyboard image set contents.json');
- fs.writeFileSync(path.join(cordovaProject.root, launchStoryboardImagesDir, 'Contents.json'),
- JSON.stringify(contentsJSON, null, 2));
- }
-}
-
-/**
- * Removes the images from the launch storyboard's image set and updates the image set's contents.json
- * file appropriately.
- *
- * @param {string} projectRoot Path to the project root
- * @param {Object} projectConfig The project's config.xml
- * @param {Object} locations A dictionary containing useful location paths
- */
-function cleanLaunchStoryboardImages (projectRoot, projectConfig, locations) {
- const splashScreens = projectConfig.getSplashScreens('ios');
- const platformProjDir = path.relative(projectRoot, locations.xcodeCordovaProj);
- const launchStoryboardImagesDir = getLaunchStoryboardImagesDir(projectRoot, platformProjDir);
- if (launchStoryboardImagesDir) {
- const resourceMap = mapLaunchStoryboardResources(splashScreens, launchStoryboardImagesDir);
- const contentsJSON = getLaunchStoryboardContentsJSON(splashScreens, launchStoryboardImagesDir);
-
- Object.keys(resourceMap).forEach(targetPath => {
- resourceMap[targetPath] = null;
- });
- events.emit('verbose', `Cleaning storyboard image set at ${launchStoryboardImagesDir}`);
-
- // Source paths are removed from the map, so updatePaths() will delete the target files.
- FileUpdater.updatePaths(
- resourceMap, { rootDir: projectRoot, all: true }, logFileOp);
-
- // delete filename from contents.json
- contentsJSON.images.forEach(image => {
- image.filename = undefined;
- });
-
- events.emit('verbose', 'Updating Storyboard image set contents.json');
- fs.writeFileSync(path.join(projectRoot, launchStoryboardImagesDir, 'Contents.json'),
- JSON.stringify(contentsJSON, null, 2));
- }
-}
-
-/**
- * Queries ConfigParser object for the orientation <preference> value. Warns if
- * global preference value is not supported by platform.
- *
- * @param {Object} platformConfig ConfigParser object
- *
- * @return {String} Global/platform-specific orientation in lower-case
- * (or empty string if both are undefined).
- */
-function getOrientationValue (platformConfig) {
- const ORIENTATION_DEFAULT = 'default';
-
- let orientation = platformConfig.getPreference('orientation');
- if (!orientation) {
- return '';
- }
-
- orientation = orientation.toLowerCase();
-
- // Check if the given global orientation is supported
- if (['default', 'portrait', 'landscape', 'all'].indexOf(orientation) >= 0) {
- return orientation;
- }
-
- events.emit('warn', `Unrecognized value for Orientation preference: ${orientation}. Defaulting to value: ${ORIENTATION_DEFAULT}.`);
-
- return ORIENTATION_DEFAULT;
-}
-
-/*
- Parses all <access> and <allow-navigation> entries and consolidates duplicates (for ATS).
- Returns an object with a Hostname as the key, and the value an object with properties:
- {
- Hostname, // String
- NSExceptionAllowsInsecureHTTPLoads, // boolean
- NSIncludesSubdomains, // boolean
- NSExceptionMinimumTLSVersion, // String
- NSExceptionRequiresForwardSecrecy, // boolean
- NSRequiresCertificateTransparency, // boolean
-
- // the three below _only_ show when the Hostname is '*'
- // if any of the three are set, it disables setting NSAllowsArbitraryLoads
- // (Apple already enforces this in ATS)
- NSAllowsArbitraryLoadsInWebContent, // boolean (default: false)
- NSAllowsLocalNetworking, // boolean (default: false)
- NSAllowsArbitraryLoadsForMedia, // boolean (default:false)
-
- }
-*/
-function processAccessAndAllowNavigationEntries (config) {
- const accesses = config.getAccesses();
- const allow_navigations = config.getAllowNavigations();
-
- return allow_navigations
- // we concat allow_navigations and accesses, after processing accesses
- .concat(accesses.map(obj => {
- // map accesses to a common key interface using 'href', not origin
- obj.href = obj.origin;
- delete obj.origin;
- return obj;
- }))
- // we reduce the array to an object with all the entries processed (key is Hostname)
- .reduce((previousReturn, currentElement) => {
- const options = {
- minimum_tls_version: currentElement.minimum_tls_version,
- requires_forward_secrecy: currentElement.requires_forward_secrecy,
- requires_certificate_transparency: currentElement.requires_certificate_transparency,
- allows_arbitrary_loads_for_media: currentElement.allows_arbitrary_loads_in_media || currentElement.allows_arbitrary_loads_for_media,
- allows_arbitrary_loads_in_web_content: currentElement.allows_arbitrary_loads_in_web_content,
- allows_local_networking: currentElement.allows_local_networking
- };
- const obj = parseWhitelistUrlForATS(currentElement.href, options);
-
- if (obj) {
- // we 'union' duplicate entries
- let item = previousReturn[obj.Hostname];
- if (!item) {
- item = {};
- }
- for (const o in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, o)) {
- item[o] = obj[o];
- }
- }
- previousReturn[obj.Hostname] = item;
- }
- return previousReturn;
- }, {});
-}
-
-/*
- Parses a URL and returns an object with these keys:
- {
- Hostname, // String
- NSExceptionAllowsInsecureHTTPLoads, // boolean (default: false)
- NSIncludesSubdomains, // boolean (default: false)
- NSExceptionMinimumTLSVersion, // String (default: 'TLSv1.2')
- NSExceptionRequiresForwardSecrecy, // boolean (default: true)
- NSRequiresCertificateTransparency, // boolean (default: false)
-
- // the three below _only_ apply when the Hostname is '*'
- // if any of the three are set, it disables setting NSAllowsArbitraryLoads
- // (Apple already enforces this in ATS)
- NSAllowsArbitraryLoadsInWebContent, // boolean (default: false)
- NSAllowsLocalNetworking, // boolean (default: false)
- NSAllowsArbitraryLoadsForMedia, // boolean (default:false)
- }
-
- null is returned if the URL cannot be parsed, or is to be skipped for ATS.
-*/
-function parseWhitelistUrlForATS (url, options) {
- // @todo 'url.parse' was deprecated since v11.0.0. Use 'url.URL' constructor instead.
- const href = URL.parse(url); // eslint-disable-line
- const retObj = {};
- retObj.Hostname = href.hostname;
-
- // Guiding principle: we only set values in retObj if they are NOT the default
-
- if (url === '*') {
- retObj.Hostname = '*';
- let val;
-
- val = (options.allows_arbitrary_loads_in_web_content === 'true');
- if (options.allows_arbitrary_loads_in_web_content && val) { // default is false
- retObj.NSAllowsArbitraryLoadsInWebContent = true;
- }
-
- val = (options.allows_arbitrary_loads_for_media === 'true');
- if (options.allows_arbitrary_loads_for_media && val) { // default is false
- retObj.NSAllowsArbitraryLoadsForMedia = true;
- }
-
- val = (options.allows_local_networking === 'true');
- if (options.allows_local_networking && val) { // default is false
- retObj.NSAllowsLocalNetworking = true;
- }
-
- return retObj;
- }
-
- if (!retObj.Hostname) {
- // check origin, if it allows subdomains (wildcard in hostname), we set NSIncludesSubdomains to YES. Default is NO
- const subdomain1 = '/*.'; // wildcard in hostname
- const subdomain2 = '*://*.'; // wildcard in hostname and protocol
- const subdomain3 = '*://'; // wildcard in protocol only
- if (!href.pathname) {
- return null;
- } else if (href.pathname.indexOf(subdomain1) === 0) {
- retObj.NSIncludesSubdomains = true;
- retObj.Hostname = href.pathname.substring(subdomain1.length);
- } else if (href.pathname.indexOf(subdomain2) === 0) {
- retObj.NSIncludesSubdomains = true;
- retObj.Hostname = href.pathname.substring(subdomain2.length);
- } else if (href.pathname.indexOf(subdomain3) === 0) {
- retObj.Hostname = href.pathname.substring(subdomain3.length);
- } else {
- // Handling "scheme:*" case to avoid creating of a blank key in NSExceptionDomains.
- return null;
- }
- }
-
- if (options.minimum_tls_version && options.minimum_tls_version !== 'TLSv1.2') { // default is TLSv1.2
- retObj.NSExceptionMinimumTLSVersion = options.minimum_tls_version;
- }
-
- const rfs = (options.requires_forward_secrecy === 'true');
- if (options.requires_forward_secrecy && !rfs) { // default is true
- retObj.NSExceptionRequiresForwardSecrecy = false;
- }
-
- const rct = (options.requires_certificate_transparency === 'true');
- if (options.requires_certificate_transparency && rct) { // default is false
- retObj.NSRequiresCertificateTransparency = true;
- }
-
- // if the scheme is HTTP, we set NSExceptionAllowsInsecureHTTPLoads to YES. Default is NO
- if (href.protocol === 'http:') {
- retObj.NSExceptionAllowsInsecureHTTPLoads = true;
- } else if (!href.protocol && href.pathname.indexOf('*:/') === 0) { // wilcard in protocol
- retObj.NSExceptionAllowsInsecureHTTPLoads = true;
- }
-
- return retObj;
-}
-
-/*
- App Transport Security (ATS) writer from <access> and <allow-navigation> tags
- in config.xml
-*/
-function writeATSEntries (config) {
- const pObj = processAccessAndAllowNavigationEntries(config);
-
- const ats = {};
-
- for (const hostname in pObj) {
- if (Object.prototype.hasOwnProperty.call(pObj, hostname)) {
- const entry = pObj[hostname];
-
- // Guiding principle: we only set values if they are available
-
- if (hostname === '*') {
- // always write this, for iOS 9, since in iOS 10 it will be overriden if
- // any of the other three keys are written
- ats.NSAllowsArbitraryLoads = true;
-
- // at least one of the overriding keys is present
- if (entry.NSAllowsArbitraryLoadsInWebContent) {
- ats.NSAllowsArbitraryLoadsInWebContent = true;
- }
- if (entry.NSAllowsArbitraryLoadsForMedia) {
- ats.NSAllowsArbitraryLoadsForMedia = true;
- }
- if (entry.NSAllowsLocalNetworking) {
- ats.NSAllowsLocalNetworking = true;
- }
-
- continue;
- }
-
- const exceptionDomain = {};
-
- for (const key in entry) {
- if (Object.prototype.hasOwnProperty.call(entry, key) && key !== 'Hostname') {
- exceptionDomain[key] = entry[key];
- }
- }
-
- if (!ats.NSExceptionDomains) {
- ats.NSExceptionDomains = {};
- }
-
- ats.NSExceptionDomains[hostname] = exceptionDomain;
- }
- }
-
- return ats;
-}
-
-function folderExists (folderPath) {
- try {
- const stat = fs.statSync(folderPath);
- return stat && stat.isDirectory();
- } catch (e) {
- return false;
- }
-}
-
-// Construct a default value for CFBundleVersion as the version with any
-// -rclabel stripped=.
-function default_CFBundleVersion (version) {
- return version.split('-')[0];
-}
-
-// Converts cordova specific representation of target device to XCode value
-function parseTargetDevicePreference (value) {
- if (!value) return null;
- const map = { universal: '"1,2"', handset: '"1"', tablet: '"2"' };
- if (map[value.toLowerCase()]) {
- return map[value.toLowerCase()];
- }
- events.emit('warn', `Unrecognized value for target-device preference: ${value}.`);
- return null;
-}
diff --git a/cordova/platforms/ios/cordova/lib/projectFile.js b/cordova/platforms/ios/cordova/lib/projectFile.js
deleted file mode 100644
index 3e1e83048..000000000
--- a/cordova/platforms/ios/cordova/lib/projectFile.js
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const xcode = require('xcode');
-const plist = require('plist');
-const _ = require('underscore');
-const path = require('path');
-const fs = require('fs-extra');
-
-const pluginHandlers = require('./plugman/pluginHandlers');
-const CordovaError = require('cordova-common').CordovaError;
-
-const cachedProjectFiles = {};
-
-function parseProjectFile (locations) {
- const project_dir = locations.root;
- const pbxPath = locations.pbxproj;
-
- if (cachedProjectFiles[project_dir]) {
- return cachedProjectFiles[project_dir];
- }
-
- const xcodeproj = xcode.project(pbxPath);
- xcodeproj.parseSync();
-
- const xcBuildConfiguration = xcodeproj.pbxXCBuildConfigurationSection();
- const plist_file_entry = _.find(xcBuildConfiguration, entry => entry.buildSettings && entry.buildSettings.INFOPLIST_FILE);
- const plist_file = path.join(project_dir, plist_file_entry.buildSettings.INFOPLIST_FILE.replace(/^"(.*)"$/g, '$1').replace(/\\&/g, '&'));
- const config_file = path.join(path.dirname(plist_file), 'config.xml');
-
- if (!fs.existsSync(plist_file) || !fs.existsSync(config_file)) {
- throw new CordovaError('Could not find *-Info.plist file, or config.xml file.');
- }
-
- const frameworks_file = path.join(project_dir, 'frameworks.json');
- let frameworks = {};
- try {
- frameworks = require(frameworks_file);
- } catch (e) { }
-
- const xcode_dir = path.dirname(plist_file);
- const pluginsDir = path.resolve(xcode_dir, 'Plugins');
- const resourcesDir = path.resolve(xcode_dir, 'Resources');
-
- cachedProjectFiles[project_dir] = {
- plugins_dir: pluginsDir,
- resources_dir: resourcesDir,
- xcode: xcodeproj,
- xcode_path: xcode_dir,
- pbx: pbxPath,
- projectDir: project_dir,
- platformWww: path.join(project_dir, 'platform_www'),
- www: path.join(project_dir, 'www'),
- write: function () {
- fs.writeFileSync(pbxPath, xcodeproj.writeSync());
- if (Object.keys(this.frameworks).length === 0) {
- // If there is no framework references remain in the project, just remove this file
- fs.removeSync(frameworks_file);
- return;
- }
- fs.writeFileSync(frameworks_file, JSON.stringify(this.frameworks, null, 4));
- },
- getPackageName: function () {
- const packageName = plist.parse(fs.readFileSync(plist_file, 'utf8')).CFBundleIdentifier;
- let bundleIdentifier = packageName;
-
- const variables = packageName.match(/\$\((\w+)\)/); // match $(VARIABLE), if any
- if (variables && variables.length >= 2) {
- bundleIdentifier = xcodeproj.getBuildProperty(variables[1]);
- }
-
- return bundleIdentifier.replace(/^"/, '').replace(/"$/, '');
- },
- getInstaller: function (name) {
- return pluginHandlers.getInstaller(name);
- },
- getUninstaller: function (name) {
- return pluginHandlers.getUninstaller(name);
- },
- frameworks
- };
- return cachedProjectFiles[project_dir];
-}
-
-function purgeProjectFileCache (project_dir) {
- delete cachedProjectFiles[project_dir];
-}
-
-module.exports = {
- parse: parseProjectFile,
- purgeProjectFileCache
-};
-
-xcode.project.prototype.pbxEmbedFrameworksBuildPhaseObj = function (target) {
- return this.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Frameworks', target);
-};
-
-xcode.project.prototype.addToPbxEmbedFrameworksBuildPhase = function (file) {
- const sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target);
- if (sources) {
- sources.files.push(pbxBuildPhaseObj(file));
- }
-};
-xcode.project.prototype.removeFromPbxEmbedFrameworksBuildPhase = function (file) {
- const sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target);
- if (sources) {
- sources.files = _.reject(sources.files, file => file.comment === longComment(file));
- }
-};
-
-// special handlers to add frameworks to the 'Embed Frameworks' build phase, needed for custom frameworks
-// see CB-9517. should probably be moved to node-xcode.
-const util = require('util');
-function pbxBuildPhaseObj (file) {
- const obj = Object.create(null);
- obj.value = file.uuid;
- obj.comment = longComment(file);
- return obj;
-}
-
-function longComment (file) {
- return util.format('%s in %s', file.basename, file.group);
-}
diff --git a/cordova/platforms/ios/cordova/lib/run.js b/cordova/platforms/ios/cordova/lib/run.js
deleted file mode 100644
index f7fd8c139..000000000
--- a/cordova/platforms/ios/cordova/lib/run.js
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const path = require('path');
-const build = require('./build');
-const {
- CordovaError,
- events,
- superspawn: { spawn }
-} = require('cordova-common');
-const check_reqs = require('./check_reqs');
-const fs = require('fs-extra');
-
-const cordovaPath = path.join(__dirname, '..');
-const projectPath = path.join(__dirname, '..', '..');
-
-module.exports.run = runOptions => {
- // Validate args
- if (runOptions.device && runOptions.emulator) {
- return Promise.reject(new CordovaError('Only one of "device"/"emulator" options should be specified'));
- }
-
- // support for CB-8168 `cordova/run --list`
- if (runOptions.list) {
- if (runOptions.device) return module.exports.listDevices();
- if (runOptions.emulator) return module.exports.listEmulators();
- // if no --device or --emulator flag is specified, list both devices and emulators
- return module.exports.listDevices().then(() => module.exports.listEmulators());
- }
-
- let useDevice = !!runOptions.device;
-
- return require('./listDevices').run()
- .then(devices => {
- if (devices.length > 0 && !(runOptions.emulator)) {
- useDevice = true;
- // we also explicitly set device flag in options as we pass
- // those parameters to other api (build as an example)
- runOptions.device = true;
- return check_reqs.check_ios_deploy();
- }
- }).then(() => {
- if (!runOptions.nobuild) {
- return build.run(runOptions);
- } else {
- return Promise.resolve();
- }
- }).then(() => build.findXCodeProjectIn(projectPath))
- .then(projectName => {
- let appPath = path.join(projectPath, 'build', 'emulator', `${projectName}.app`);
- const buildOutputDir = path.join(projectPath, 'build', 'device');
-
- // select command to run and arguments depending whether
- // we're running on device/emulator
- if (useDevice) {
- return module.exports.checkDeviceConnected()
- .then(() => {
- // Unpack IPA
- const ipafile = path.join(buildOutputDir, `${projectName}.ipa`);
-
- // unpack the existing platform/ios/build/device/appname.ipa (zipfile), will create a Payload folder
- return spawn('unzip', ['-o', '-qq', ipafile], { cwd: buildOutputDir, printCommand: true, stdio: 'inherit' });
- })
- .then(() => {
- // Uncompress IPA (zip file)
- const appFileInflated = path.join(buildOutputDir, 'Payload', `${projectName}.app`);
- const appFile = path.join(buildOutputDir, `${projectName}.app`);
- const payloadFolder = path.join(buildOutputDir, 'Payload');
-
- // delete the existing platform/ios/build/device/appname.app
- fs.removeSync(appFile);
- // move the platform/ios/build/device/Payload/appname.app to parent
- fs.moveSync(appFileInflated, appFile);
- // delete the platform/ios/build/device/Payload folder
- fs.removeSync(payloadFolder);
-
- return null;
- })
- .then(
- () => {
- appPath = path.join(projectPath, 'build', 'device', `${projectName}.app`);
- let extraArgs = [];
- if (runOptions.argv) {
- // argv.slice(2) removes node and run.js, filterSupportedArgs removes the run.js args
- extraArgs = module.exports.filterSupportedArgs(runOptions.argv.slice(2));
- }
- return module.exports.deployToDevice(appPath, runOptions.target, extraArgs);
- },
- // if device connection check failed use emulator then
- () => module.exports.deployToSim(appPath, runOptions.target)
- );
- } else {
- return module.exports.deployToSim(appPath, runOptions.target);
- }
- });
-};
-
-module.exports.filterSupportedArgs = filterSupportedArgs;
-module.exports.checkDeviceConnected = checkDeviceConnected;
-module.exports.deployToDevice = deployToDevice;
-module.exports.deployToSim = deployToSim;
-module.exports.startSim = startSim;
-module.exports.listDevices = listDevices;
-module.exports.listEmulators = listEmulators;
-
-/**
- * Filters the args array and removes supported args for the 'run' command.
- *
- * @return {Array} array with unsupported args for the 'run' command
- */
-function filterSupportedArgs (args) {
- const filtered = [];
- const sargs = ['--device', '--emulator', '--nobuild', '--list', '--target', '--debug', '--release'];
- const re = new RegExp(sargs.join('|'));
-
- args.forEach(element => {
- // supported args not found, we add
- // we do a regex search because --target can be "--target=XXX"
- if (element.search(re) === -1) {
- filtered.push(element);
- }
- }, this);
-
- return filtered;
-}
-
-/**
- * Checks if any iOS device is connected
- * @return {Promise} Fullfilled when any device is connected, rejected otherwise
- */
-function checkDeviceConnected () {
- return spawn('ios-deploy', ['-c', '-t', '1'], { printCommand: true, stdio: 'inherit' });
-}
-
-/**
- * Deploy specified app package to connected device
- * using ios-deploy command
- * @param {String} appPath Path to application package
- * @return {Promise} Resolves when deploy succeeds otherwise rejects
- */
-function deployToDevice (appPath, target, extraArgs) {
- events.emit('log', 'Deploying to device');
- // Deploying to device...
- if (target) {
- return spawn('ios-deploy', ['--justlaunch', '-d', '-b', appPath, '-i', target].concat(extraArgs), { printCommand: true, stdio: 'inherit' });
- } else {
- return spawn('ios-deploy', ['--justlaunch', '--no-wifi', '-d', '-b', appPath].concat(extraArgs), { printCommand: true, stdio: 'inherit' });
- }
-}
-
-/**
- * Deploy specified app package to ios-sim simulator
- * @param {String} appPath Path to application package
- * @param {String} target Target device type
- * @return {Promise} Resolves when deploy succeeds otherwise rejects
- */
-function deployToSim (appPath, target) {
- events.emit('log', 'Deploying to simulator');
- if (!target) {
- // Select target device for emulator
- return require('./listEmulatorImages').run()
- .then(emulators => {
- if (emulators.length > 0) {
- target = emulators[0];
- }
- emulators.forEach(emulator => {
- if (emulator.indexOf('iPhone') === 0) {
- target = emulator;
- }
- });
- events.emit('log', `No target specified for emulator. Deploying to "${target}" simulator.`);
- return startSim(appPath, target);
- });
- } else {
- return startSim(appPath, target);
- }
-}
-
-function startSim (appPath, target) {
- const logPath = path.join(cordovaPath, 'console.log');
-
- return iossimLaunch(appPath, `com.apple.CoreSimulator.SimDeviceType.${target}`, logPath, '--exit');
-}
-
-function iossimLaunch (appPath, devicetypeid, log, exit) {
- return spawn(
- require.resolve('ios-sim/bin/ios-sim'),
- ['launch', appPath, '--devicetypeid', devicetypeid, '--log', log, exit],
- { cwd: projectPath, printCommand: true }
- ).progress(stdio => {
- if (stdio.stderr) {
- events.emit('error', `[ios-sim] ${stdio.stderr}`);
- }
- if (stdio.stdout) {
- events.emit('log', `[ios-sim] ${stdio.stdout.trim()}`);
- }
- })
- .then(result => {
- events.emit('log', 'Simulator successfully started via `ios-sim`.');
- });
-}
-
-function listDevices () {
- return require('./listDevices').run()
- .then(devices => {
- events.emit('log', 'Available iOS Devices:');
- devices.forEach(device => {
- events.emit('log', `\t${device}`);
- });
- });
-}
-
-function listEmulators () {
- return require('./listEmulatorImages').run()
- .then(emulators => {
- events.emit('log', 'Available iOS Simulators:');
- emulators.forEach(emulator => {
- events.emit('log', `\t${emulator}`);
- });
- });
-}
-
-module.exports.help = () => {
- console.log('\nUsage: run [ --device | [ --emulator [ --target=<id> ] ] ] [ --debug | --release | --nobuild ]');
- // TODO: add support for building different archs
- // console.log(" [ --archs=\"<list of target architectures>\" ] ");
- console.log(' --device : Deploys and runs the project on the connected device.');
- console.log(' --emulator : Deploys and runs the project on an emulator.');
- console.log(' --target=<id> : Deploys and runs the project on the specified target.');
- console.log(' --debug : Builds project in debug mode. (Passed down to build command, if necessary)');
- console.log(' --release : Builds project in release mode. (Passed down to build command, if necessary)');
- console.log(' --nobuild : Uses pre-built package, or errors if project is not built.');
- // TODO: add support for building different archs
- // console.log(" --archs : Specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).");
- console.log('');
- console.log('Examples:');
- console.log(' run');
- console.log(' run --device');
- console.log(' run --emulator --target=\"iPhone-6-Plus\"'); /* eslint no-useless-escape : 0 */
- console.log(' run --device --release');
- console.log(' run --emulator --debug');
- console.log('');
- process.exit(0);
-};
diff --git a/cordova/platforms/ios/cordova/lib/start-emulator b/cordova/platforms/ios/cordova/lib/start-emulator
deleted file mode 100755
index 624335b1e..000000000
--- a/cordova/platforms/ios/cordova/lib/start-emulator
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# Run the below to get the device targets:
-# xcrun instruments -s
-
-set -e
-
-
-DEFAULT_TARGET="iPhone 5s"
-TARGET=${1:-$DEFAULT_TARGET}
-LIB_PATH=$( cd "$( dirname "$0" )" && pwd -P)
-
-xcrun instruments -w "$TARGET" &> /dev/null
\ No newline at end of file
diff --git a/cordova/platforms/ios/cordova/lib/versions.js b/cordova/platforms/ios/cordova/lib/versions.js
deleted file mode 100644
index f89147854..000000000
--- a/cordova/platforms/ios/cordova/lib/versions.js
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-const {
- CordovaError,
- superspawn: { spawn }
-} = require('cordova-common');
-const semver = require('semver');
-
-function fetchSdkVersionByType (sdkType) {
- return spawn('xcodebuild', ['-showsdks'])
- .then(output => {
- const regexSdk = new RegExp(`^${sdkType} \\d`);
-
- const versions = output.split('\n')
- .filter(line => line.trim().match(regexSdk))
- .map(line => line.match(/\d+\.\d+/)[0])
- .sort(exports.compareVersions);
-
- console.log(versions[0]);
- });
-}
-
-exports.get_apple_ios_version = () => {
- return fetchSdkVersionByType('iOS');
-};
-
-exports.get_apple_osx_version = () => {
- return fetchSdkVersionByType('macOS');
-};
-
-exports.get_apple_xcode_version = () => {
- return spawn('xcodebuild', ['-version'])
- .then(output => {
- const versionMatch = /Xcode (.*)/.exec(output);
-
- if (!versionMatch) return Promise.reject(output);
-
- return versionMatch[1];
- });
-};
-
-/**
- * Gets ios-deploy util version
- * @return {Promise} Promise that either resolved with ios-deploy version
- * or rejected in case of error
- */
-exports.get_ios_deploy_version = () => {
- return spawn('ios-deploy', ['--version']);
-};
-
-/**
- * Gets pod (CocoaPods) util version
- * @return {Promise} Promise that either resolved with pod version
- * or rejected in case of error
- */
-exports.get_cocoapods_version = () => {
- return spawn('pod', ['--version']);
-};
-
-/**
- * Gets ios-sim util version
- * @return {Promise} Promise that either resolved with ios-sim version
- * or rejected in case of error
- */
-exports.get_ios_sim_version = () => {
- return spawn('ios-sim', ['--version']);
-};
-
-/**
- * Gets specific tool version
- * @param {String} toolName Tool name to check. Known tools are 'xcodebuild', 'ios-sim' and 'ios-deploy'
- * @return {Promise} Promise that either resolved with tool version
- * or rejected in case of error
- */
-exports.get_tool_version = toolName => {
- switch (toolName) {
- case 'xcodebuild': return exports.get_apple_xcode_version();
- case 'ios-sim': return exports.get_ios_sim_version();
- case 'ios-deploy': return exports.get_ios_deploy_version();
- case 'pod': return exports.get_cocoapods_version();
- default: return Promise.reject(new CordovaError(`${toolName} is not valid tool name. Valid names are: 'xcodebuild', 'ios-sim', 'ios-deploy', and 'pod'`));
- }
-};
-
-/**
- * Compares two version strings that can be coerced to semver.
- *
- * @param {String} version1 Version to compare
- * @param {String} version2 Another version to compare
- * @return {Number} Negative number if first version is lower than the second,
- * positive otherwise and 0 if versions are equal.
- */
-exports.compareVersions = (...args) => {
- const coerceToSemverIfInvalid = v => {
- const semverVersion = semver.parse(v) || semver.coerce(v);
- if (!semverVersion) throw new TypeError(`Invalid Version: ${v}`);
- return semverVersion;
- };
-
- const semverVersions = args.map(coerceToSemverIfInvalid);
- return semver.compare(...semverVersions);
-};
diff --git a/cordova/platforms/ios/cordova/log.bat b/cordova/platforms/ios/cordova/log.bat
deleted file mode 100755
index 4710e57e8..000000000
--- a/cordova/platforms/ios/cordova/log.bat
+++ /dev/null
@@ -1,19 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License
-
-@ECHO OFF
-ECHO WARN: The 'log' command is not available for cordova-ios on windows machines.>&2
diff --git a/cordova/platforms/ios/cordova/run b/cordova/platforms/ios/cordova/run
deleted file mode 100755
index 9e6c8f91e..000000000
--- a/cordova/platforms/ios/cordova/run
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env node
-
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-
-var args = process.argv;
-var Api = require('./Api');
-var nopt = require('nopt');
-
-// Handle help flag
-if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) >= 0) {
- require('./lib/run').help();
- process.exit(0);
-}
-
-// Parse arguments (includes build params as well)
-var opts = nopt({
- verbose: Boolean,
- silent: Boolean,
- debug: Boolean,
- release: Boolean,
- nobuild: Boolean,
- archs: String,
- list: Boolean,
- device: Boolean,
- emulator: Boolean,
- target: String,
- codeSignIdentity: String,
- codeSignResourceRules: String,
- provisioningProfile: String,
- automaticProvisioning: Boolean,
- buildConfig: String,
- noSign: Boolean
-}, { d: '--verbose' }, args);
-
-// Make options compatible with PlatformApi build method spec
-opts.argv = opts.argv.remain;
-
-require('./loggingHelper').adjustLoggerLevel(opts);
-
-new Api().run(opts).then(
- () => {
- console.log('** RUN SUCCEEDED **');
- },
- err => {
- var errorMessage = (err && err.stack) ? err.stack : err;
- console.error(errorMessage);
- process.exit(2);
- }
-);
diff --git a/cordova/platforms/ios/cordova/run.bat b/cordova/platforms/ios/cordova/run.bat
deleted file mode 100755
index 8a3cad2ad..000000000
--- a/cordova/platforms/ios/cordova/run.bat
+++ /dev/null
@@ -1,19 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License
-
-@ECHO OFF
-ECHO WARN: The `run` is not available for cordova-ios on windows machines.>&2
diff --git a/cordova/platforms/ios/cordova/version b/cordova/platforms/ios/cordova/version
index 6bb657b48..7234670bc 100755
--- a/cordova/platforms/ios/cordova/version
+++ b/cordova/platforms/ios/cordova/version
@@ -19,13 +19,6 @@
under the License.
*/
-/*
-
- Returns the VERSION of CordovaLib used.
- Note: it does not work if the --shared option was used to create the project.
-*/
-
-// Coho updates this line
const Api = require('./Api');
console.log(Api.version());
diff --git a/cordova/platforms/ios/cordova/version.bat b/cordova/platforms/ios/cordova/version.bat
deleted file mode 100755
index 84c86b438..000000000
--- a/cordova/platforms/ios/cordova/version.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script="%~dp0version"
-IF EXIST %script% (
- node %script% %*
-) ELSE (
- ECHO.
- ECHO ERROR: Could not find 'version' script in 'cordova' folder, aborting...>&2
- EXIT /B 1
-)
diff --git a/cordova/platforms/ios/frameworks.json b/cordova/platforms/ios/frameworks.json
new file mode 100644
index 000000000..32e967fc7
--- /dev/null
+++ b/cordova/platforms/ios/frameworks.json
@@ -0,0 +1,7 @@
+{
+ "Social.framework": 1,
+ "MessageUI.framework": 1,
+ "ImageIO.framework": 1,
+ "CoreLocation.framework": 1,
+ "AVFoundation.framework": 1
+}
\ No newline at end of file
diff --git a/cordova/platforms/ios/ios.json b/cordova/platforms/ios/ios.json
index b4a43f97c..95b32160e 100644
--- a/cordova/platforms/ios/ios.json
+++ b/cordova/platforms/ios/ios.json
@@ -12,9 +12,55 @@
"xml": "<feature name=\"Downloader\"><param name=\"ios-package\" value=\"Downloader\" /></feature>",
"count": 1
},
+ {
+ "xml": "<feature name=\"Device\"><param name=\"ios-package\" value=\"CDVDevice\" /></feature>",
+ "count": 1
+ },
+ {
+ "xml": "<feature name=\"BackgroundMode\"><param name=\"ios-package\" onload=\"true\" value=\"APPBackgroundMode\" /><param name=\"onload\" value=\"true\" /></feature>",
+ "count": 1
+ },
{
"xml": "<feature name=\"File\"><param name=\"ios-package\" value=\"CDVFile\" /><param name=\"onload\" value=\"true\" /></feature>",
"count": 1
+ },
+ {
+ "xml": "<feature name=\"FileOpener2\"><param name=\"ios-package\" value=\"FileOpener2\" /></feature>",
+ "count": 1
+ },
+ {
+ "xml": "<feature name=\"SocialSharing\"><param name=\"ios-package\" value=\"SocialSharing\" /><param name=\"onload\" value=\"true\" /></feature>",
+ "count": 1
+ },
+ {
+ "xml": "<feature name=\"Camera\"><param name=\"ios-package\" value=\"CDVCamera\" /></feature>",
+ "count": 1
+ },
+ {
+ "xml": "<preference name=\"CameraUsesGeolocation\" value=\"false\" />",
+ "count": 1
+ }
+ ]
+ }
+ },
+ "*-Info.plist": {
+ "parents": {
+ "UIBackgroundModes": [
+ {
+ "xml": "<array><string>audio</string></array>",
+ "count": 1
+ }
+ ],
+ "NSPhotoLibraryAddUsageDescription": [
+ {
+ "xml": "<string>This app requires photo library access to function properly.</string>",
+ "count": 1
+ }
+ ],
+ "NSPhotoLibraryUsageDescription": [
+ {
+ "xml": "<string>This app requires photo library access to function properly.</string>",
+ "count": 1
}
]
}
@@ -23,13 +69,42 @@
},
"installed_plugins": {
"com.whebcraft.cordova.plugin.downloader": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
},
- "cordova-plugin-androidx": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
+ "es6-promise-plugin": {
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
+ },
+ "cordova-plugin-whitelist": {
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
+ },
+ "cordova-plugin-device": {
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
+ },
+ "cordova-plugin-background-mode": {
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
},
"cordova-plugin-file": {
- "PACKAGE_NAME": "org.tagspaces.mobile"
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
+ },
+ "cordova-plugin-file-opener2": {
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
+ },
+ "cordova-plugin-x-socialsharing": {
+ "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
+ "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
+ },
+ "cordova-plugin-camera": {
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
+ },
+ "cordova-plugin-androidx-adapter": {
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
+ },
+ "com-darryncampbell-cordova-plugin-intent": {
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
+ },
+ "cordova-plugin-androidx": {
+ "PACKAGE_NAME": "org.tagspaces.mobileapp"
}
},
"dependent_plugins": {},
@@ -42,6 +117,29 @@
"plugins.Downloader"
]
},
+ {
+ "id": "es6-promise-plugin.Promise",
+ "file": "plugins/es6-promise-plugin/www/promise.js",
+ "pluginId": "es6-promise-plugin",
+ "runs": true
+ },
+ {
+ "id": "cordova-plugin-device.device",
+ "file": "plugins/cordova-plugin-device/www/device.js",
+ "pluginId": "cordova-plugin-device",
+ "clobbers": [
+ "device"
+ ]
+ },
+ {
+ "id": "cordova-plugin-background-mode.BackgroundMode",
+ "file": "plugins/cordova-plugin-background-mode/www/background-mode.js",
+ "pluginId": "cordova-plugin-background-mode",
+ "clobbers": [
+ "cordova.plugins.backgroundMode",
+ "plugin.backgroundMode"
+ ]
+ },
{
"id": "cordova-plugin-file.DirectoryEntry",
"file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
@@ -214,11 +312,76 @@
"cordova"
],
"runs": true
+ },
+ {
+ "id": "cordova-plugin-file-opener2.FileOpener2",
+ "file": "plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js",
+ "pluginId": "cordova-plugin-file-opener2",
+ "clobbers": [
+ "cordova.plugins.fileOpener2"
+ ]
+ },
+ {
+ "id": "cordova-plugin-x-socialsharing.SocialSharing",
+ "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js",
+ "pluginId": "cordova-plugin-x-socialsharing",
+ "clobbers": [
+ "window.plugins.socialsharing"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.Camera",
+ "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "Camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverOptions",
+ "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverOptions"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.camera",
+ "file": "plugins/cordova-plugin-camera/www/Camera.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "navigator.camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverHandle",
+ "file": "plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverHandle"
+ ]
+ },
+ {
+ "id": "com-darryncampbell-cordova-plugin-intent.IntentShim",
+ "file": "plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js",
+ "pluginId": "com-darryncampbell-cordova-plugin-intent",
+ "clobbers": [
+ "intentShim"
+ ]
}
],
"plugin_metadata": {
"com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "cordova-plugin-androidx": "3.0.0",
- "cordova-plugin-file": "7.0.0-dev"
+ "es6-promise-plugin": "4.2.2",
+ "cordova-plugin-whitelist": "1.3.3",
+ "cordova-plugin-device": "2.0.2",
+ "cordova-plugin-background-mode": "0.7.3",
+ "cordova-plugin-file": "6.0.2",
+ "cordova-plugin-file-opener2": "3.0.3",
+ "cordova-plugin-x-socialsharing": "5.6.8",
+ "cordova-plugin-camera": "4.1.0",
+ "cordova-plugin-androidx-adapter": "1.1.3",
+ "com-darryncampbell-cordova-plugin-intent": "2.0.0",
+ "cordova-plugin-androidx": "3.0.0"
}
}
diff --git a/cordova/platforms/ios/packages/cordova-ios-plugins/Package.swift b/cordova/platforms/ios/packages/cordova-ios-plugins/Package.swift
new file mode 100644
index 000000000..705e2778e
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios-plugins/Package.swift
@@ -0,0 +1,37 @@
+// swift-tools-version:5.5
+
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+import PackageDescription
+
+let package = Package(
+ name: "CordovaPlugins",
+ platforms: [
+ .iOS(.v13),
+ .macCatalyst(.v13)
+ ],
+ products: [
+ .library(name: "CordovaPlugins", targets: ["CordovaPlugins"])
+ ],
+ targets: [
+ .target(name: "CordovaPlugins")
+ ]
+)
+
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVTimer.h b/cordova/platforms/ios/packages/cordova-ios-plugins/Sources/CordovaPlugins/CordovaPlugins.swift
similarity index 84%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVTimer.h
rename to cordova/platforms/ios/packages/cordova-ios-plugins/Sources/CordovaPlugins/CordovaPlugins.swift
index 6d31593f2..92baa9178 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVTimer.h
+++ b/cordova/platforms/ios/packages/cordova-ios-plugins/Sources/CordovaPlugins/CordovaPlugins.swift
@@ -15,13 +15,7 @@
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
- */
+*/
-#import <Foundation/Foundation.h>
-
-@interface CDVTimer : NSObject
-
-+ (void)start:(NSString*)name;
-+ (void)stop:(NSString*)name;
-
-@end
+// We need something here so that the empty package will compile successfully
+public let isCordovaApp = true
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.h
similarity index 90%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.h
index 053113431..00d39c486 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.h
@@ -18,7 +18,7 @@
*/
#import <UIKit/UIKit.h>
-#import "CDVCommandDelegate.h"
+#import <Cordova/CDVCommandDelegate.h>
@class CDVViewController;
@class CDVCommandQueue;
@@ -31,6 +31,6 @@
__weak CDVCommandQueue* _commandQueue;
BOOL _delayResponses;
}
-- (id)initWithViewController:(CDVViewController*)viewController;
+- (instancetype)initWithViewController:(CDVViewController *)viewController;
- (void)flushCommandQueueWithDelayedJs;
@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.m
similarity index 94%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.m
index 649d30dbb..70c0c134a 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVCommandDelegateImpl.m
@@ -19,15 +19,13 @@
#import "CDVCommandDelegateImpl.h"
#import "CDVJSON_private.h"
-#import "CDVCommandQueue.h"
-#import "CDVPluginResult.h"
-#import "CDVViewController.h"
+#import <Cordova/CDVCommandQueue.h>
+#import <Cordova/CDVPluginResult.h>
+#import <Cordova/CDVViewController.h>
@implementation CDVCommandDelegateImpl
-@synthesize urlTransformer;
-
-- (id)initWithViewController:(CDVViewController*)viewController
+- (instancetype)initWithViewController:(CDVViewController *)viewController
{
self = [super init];
if (self != nil) {
@@ -54,10 +52,10 @@
[directoryParts removeLastObject];
NSString* directoryPartsJoined = [directoryParts componentsJoinedByString:@"/"];
- NSString* directoryStr = _viewController.wwwFolderName;
+ NSString* directoryStr = _viewController.webContentFolderName;
if ([directoryPartsJoined length] > 0) {
- directoryStr = [NSString stringWithFormat:@"%@/%@", _viewController.wwwFolderName, [directoryParts componentsJoinedByString:@"/"]];
+ directoryStr = [NSString stringWithFormat:@"%@/%@", _viewController.webContentFolderName, [directoryParts componentsJoinedByString:@"/"]];
}
return [mainBundle pathForResource:filename ofType:@"" inDirectory:directoryStr];
@@ -173,7 +171,7 @@
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
}
-- (NSDictionary*)settings
+- (CDVSettingsDictionary*)settings
{
return _viewController.settings;
}
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/CDVDebug.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVDebug.h
similarity index 100%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/CDVDebug.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVDebug.h
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.h
similarity index 96%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.h
index afb5cc661..aaee42ca7 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.h
@@ -17,6 +17,8 @@
under the License.
*/
+#import <Foundation/Foundation.h>
+
@interface NSArray (CDVJSONSerializingPrivate)
- (NSString*)cdv_JSONString;
@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.m
similarity index 98%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.m
index 175ed3984..6815e3eab 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVJSON_private.m
@@ -18,7 +18,6 @@
*/
#import "CDVJSON_private.h"
-#import <Foundation/NSJSONSerialization.h>
@implementation NSArray (CDVJSONSerializingPrivate)
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/CDVPlugin+Private.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVPlugin+Private.h
similarity index 96%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/CDVPlugin+Private.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVPlugin+Private.h
index f88638c20..a06055ccc 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/CDVPlugin+Private.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVPlugin+Private.h
@@ -17,6 +17,8 @@
under the License.
*/
+#import <Cordova/CDVPlugin.h>
+
@interface CDVPlugin (Private)
- (instancetype)initWithWebViewEngine:(id <CDVWebViewEngineProtocol>)theWebViewEngine;
diff --git a/cordova/platforms/ios/TagSpaces/Classes/AppDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVViewController+Private.h
similarity index 77%
rename from cordova/platforms/ios/TagSpaces/Classes/AppDelegate.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVViewController+Private.h
index df27929e6..27a907f96 100644
--- a/cordova/platforms/ios/TagSpaces/Classes/AppDelegate.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/CDVViewController+Private.h
@@ -17,17 +17,12 @@
under the License.
*/
-//
-// AppDelegate.h
-// TagSpaces
-//
-// Created by ___FULLUSERNAME___ on ___DATE___.
-// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
-//
-
#import <Cordova/CDVViewController.h>
-#import <Cordova/CDVAppDelegate.h>
-@interface AppDelegate : CDVAppDelegate {}
+@interface CDVViewController (Private)
+
+- (void)setStatusBarWebViewColor:(UIColor *)color;
+
+- (void)showStatusBar:(BOOL)visible;
@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h
similarity index 100%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.h
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m
similarity index 85%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m
index 34ed46339..839afc693 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVGestureHandler/CDVGestureHandler.m
@@ -30,8 +30,7 @@
{
// You can't suppress 3D Touch and still have regular longpress,
// so if this is false, let's not consider the 3D Touch setting at all.
- if (![self.commandDelegate.settings objectForKey:@"suppresseslongpressgesture"] ||
- ![[self.commandDelegate.settings objectForKey:@"suppresseslongpressgesture"] boolValue]) {
+ if (![self.commandDelegate.settings cordovaBoolSettingForKey:@"SuppressesLongPressGesture" defaultValue:NO]) {
return;
}
@@ -41,8 +40,7 @@
// 0.45 is ok for 'regular longpress', 0.05-0.08 is required for '3D Touch longpress',
// but since this will also kill onclick handlers (not ontouchend) it's optional.
- if ([self.commandDelegate.settings objectForKey:@"suppresses3dtouchgesture"] &&
- [[self.commandDelegate.settings objectForKey:@"suppresses3dtouchgesture"] boolValue]) {
+ if ([self.commandDelegate.settings cordovaBoolSettingForKey:@"Suppresses3DTouchGesture" defaultValue:NO]) {
self.lpgr.minimumPressDuration = 0.15f;
}
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h
similarity index 100%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.h
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m
similarity index 97%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m
index 400cb9dea..d68e00be2 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVHandleOpenURL/CDVHandleOpenURL.m
@@ -18,7 +18,6 @@
*/
#import "CDVHandleOpenURL.h"
-#import <Cordova/CDV.h>
@implementation CDVHandleOpenURL
@@ -65,7 +64,7 @@
};
if (!pageLoaded) {
- NSString* jsString = @"document.readystate";
+ NSString* jsString = @"document.readyState";
[self.webViewEngine evaluateJavaScript:jsString
completionHandler:^(id object, NSError* error) {
if ((error == nil) && [object isKindOfClass:[NSString class]]) {
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.h
similarity index 86%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.h
index 91650970b..57814b1ed 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.h
@@ -19,11 +19,11 @@
#import <Foundation/Foundation.h>
-extern NSString* const kCDVDefaultWhitelistRejectionString;
+extern NSString* const kCDVDefaultAllowListRejectionString;
-@interface CDVWhitelist : NSObject
+@interface CDVAllowList : NSObject
-@property (nonatomic, copy) NSString* whitelistRejectionFormatString;
+@property (nonatomic, copy) NSString* allowListRejectionFormatString;
- (id)initWithArray:(NSArray*)array;
- (BOOL)schemeIsAllowed:(NSString*)scheme;
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.m
similarity index 84%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.m
index 758f4d1ef..11567d263 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVAllowList.m
@@ -17,12 +17,12 @@
under the License.
*/
-#import "CDVWhitelist.h"
+#import "CDVAllowList.h"
-NSString* const kCDVDefaultWhitelistRejectionString = @"ERROR whitelist rejection: url='%@'";
+NSString* const kCDVDefaultAllowListRejectionString = @"ERROR allowList rejection: url='%@'";
NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
-@interface CDVWhitelistPattern : NSObject {
+@interface CDVAllowListPattern : NSObject {
@private
NSRegularExpression* _scheme;
NSRegularExpression* _host;
@@ -36,7 +36,7 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
@end
-@implementation CDVWhitelistPattern
+@implementation CDVAllowListPattern
+ (NSString*)regexFromPattern:(NSString*)pattern allowWildcards:(bool)allowWildcards
{
@@ -62,14 +62,14 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
if ((scheme == nil) || [scheme isEqualToString:@"*"]) {
_scheme = nil;
} else {
- _scheme = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:scheme allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil];
+ _scheme = [NSRegularExpression regularExpressionWithPattern:[CDVAllowListPattern regexFromPattern:scheme allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil];
}
if ([host isEqualToString:@"*"] || host == nil) {
_host = nil;
} else if ([host hasPrefix:@"*."]) {
- _host = [NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"([a-z0-9.-]*\\.)?%@", [CDVWhitelistPattern regexFromPattern:[host substringFromIndex:2] allowWildcards:false]] options:NSRegularExpressionCaseInsensitive error:nil];
+ _host = [NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"([a-z0-9.-]*\\.)?%@", [CDVAllowListPattern regexFromPattern:[host substringFromIndex:2] allowWildcards:false]] options:NSRegularExpressionCaseInsensitive error:nil];
} else {
- _host = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:host allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil];
+ _host = [NSRegularExpression regularExpressionWithPattern:[CDVAllowListPattern regexFromPattern:host allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil];
}
if ((port == nil) || [port isEqualToString:@"*"]) {
_port = nil;
@@ -79,7 +79,7 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
if ((path == nil) || [path isEqualToString:@"/*"]) {
_path = nil;
} else {
- _path = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:path allowWildcards:YES] options:0 error:nil];
+ _path = [NSRegularExpression regularExpressionWithPattern:[CDVAllowListPattern regexFromPattern:path allowWildcards:YES] options:0 error:nil];
}
}
return self;
@@ -96,29 +96,29 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
@end
-@interface CDVWhitelist ()
+@interface CDVAllowList ()
-@property (nonatomic, readwrite, strong) NSMutableArray* whitelist;
+@property (nonatomic, readwrite, strong) NSMutableArray* allowList;
@property (nonatomic, readwrite, strong) NSMutableSet* permittedSchemes;
-- (void)addWhiteListEntry:(NSString*)pattern;
+- (void)addAllowListEntry:(NSString*)pattern;
@end
-@implementation CDVWhitelist
+@implementation CDVAllowList
-@synthesize whitelist, permittedSchemes, whitelistRejectionFormatString;
+@synthesize allowList, permittedSchemes, allowListRejectionFormatString;
- (id)initWithArray:(NSArray*)array
{
self = [super init];
if (self) {
- self.whitelist = [[NSMutableArray alloc] init];
+ self.allowList = [[NSMutableArray alloc] init];
self.permittedSchemes = [[NSMutableSet alloc] init];
- self.whitelistRejectionFormatString = kCDVDefaultWhitelistRejectionString;
+ self.allowListRejectionFormatString = kCDVDefaultAllowListRejectionString;
for (NSString* pattern in array) {
- [self addWhiteListEntry:pattern];
+ [self addAllowListEntry:pattern];
}
}
return self;
@@ -158,18 +158,18 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
return YES;
}
-- (void)addWhiteListEntry:(NSString*)origin
+- (void)addAllowListEntry:(NSString*)origin
{
- if (self.whitelist == nil) {
+ if (self.allowList == nil) {
return;
}
if ([origin isEqualToString:@"*"]) {
NSLog(@"Unlimited access to network resources");
- self.whitelist = nil;
+ self.allowList = nil;
self.permittedSchemes = nil;
} else { // specific access
- NSRegularExpression* parts = [NSRegularExpression regularExpressionWithPattern:@"^((\\*|[A-Za-z-]+):/?/?)?(((\\*\\.)?[^*/:]+)|\\*)?(:(\\d+))?(/.*)?" options:0 error:nil];
+ NSRegularExpression* parts = [NSRegularExpression regularExpressionWithPattern:@"^((\\*|([a-z][a-z0-9+\\-.]*)):/?/?)?(((\\*\\.)?[^*/:]+)|\\*)?(:(\\d+))?(/.*)?" options:0 error:nil];
NSTextCheckingResult* m = [parts firstMatchInString:origin options:NSMatchingAnchored range:NSMakeRange(0, [origin length])];
if (m != nil) {
NSRange r;
@@ -180,7 +180,7 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
}
NSString* host = nil;
- r = [m rangeAtIndex:3];
+ r = [m rangeAtIndex:4];
if (r.location != NSNotFound) {
host = [origin substringWithRange:r];
}
@@ -191,23 +191,23 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
}
NSString* port = nil;
- r = [m rangeAtIndex:7];
+ r = [m rangeAtIndex:8];
if (r.location != NSNotFound) {
port = [origin substringWithRange:r];
}
NSString* path = nil;
- r = [m rangeAtIndex:8];
+ r = [m rangeAtIndex:9];
if (r.location != NSNotFound) {
path = [origin substringWithRange:r];
}
if (scheme == nil) {
// XXX making it stupid friendly for people who forget to include protocol/SSL
- [self.whitelist addObject:[[CDVWhitelistPattern alloc] initWithScheme:@"http" host:host port:port path:path]];
- [self.whitelist addObject:[[CDVWhitelistPattern alloc] initWithScheme:@"https" host:host port:port path:path]];
+ [self.allowList addObject:[[CDVAllowListPattern alloc] initWithScheme:@"http" host:host port:port path:path]];
+ [self.allowList addObject:[[CDVAllowListPattern alloc] initWithScheme:@"https" host:host port:port path:path]];
} else {
- [self.whitelist addObject:[[CDVWhitelistPattern alloc] initWithScheme:scheme host:host port:port path:path]];
+ [self.allowList addObject:[[CDVAllowListPattern alloc] initWithScheme:scheme host:host port:port path:path]];
}
if (self.permittedSchemes != nil) {
@@ -240,8 +240,8 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
- (BOOL)URLIsAllowed:(NSURL*)url logFailure:(BOOL)logFailure
{
- // Shortcut acceptance: Are all urls whitelisted ("*" in whitelist)?
- if (whitelist == nil) {
+ // Shortcut acceptance: Are all urls allowListed ("*" in allowList)?
+ if (allowList == nil) {
return YES;
}
@@ -263,8 +263,8 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
}
}
- // Check the url against patterns in the whitelist
- for (CDVWhitelistPattern* p in self.whitelist) {
+ // Check the url against patterns in the allowList
+ for (CDVAllowListPattern* p in self.allowList) {
if ([p matches:url]) {
return YES;
}
@@ -279,7 +279,7 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
- (NSString*)errorStringForURL:(NSURL*)url
{
- return [NSString stringWithFormat:self.whitelistRejectionFormatString, [url absoluteString]];
+ return [NSString stringWithFormat:self.allowListRejectionFormatString, [url absoluteString]];
}
@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h
similarity index 80%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h
index 14c6a66d3..3f6a1262b 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h
@@ -18,9 +18,7 @@
*/
#import <Cordova/CDVPlugin.h>
-#import <Cordova/CDVWhitelist.h>
-
-#define CDVWebViewNavigationType int
+#import "CDVAllowList.h"
typedef NS_ENUM(NSInteger, CDVIntentAndNavigationFilterValue) {
CDVIntentAndNavigationFilterValueIntentAllowed,
@@ -28,9 +26,9 @@ typedef NS_ENUM(NSInteger, CDVIntentAndNavigationFilterValue) {
CDVIntentAndNavigationFilterValueNoneAllowed
};
-@interface CDVIntentAndNavigationFilter : CDVPlugin <NSXMLParserDelegate>
+@interface CDVIntentAndNavigationFilter : CDVPlugin <CDVPluginNavigationHandler, NSXMLParserDelegate>
-+ (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url intentsWhitelist:(CDVWhitelist*)intentsWhitelist navigationsWhitelist:(CDVWhitelist*)navigationsWhitelist;
++ (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url allowIntentsList:(CDVAllowList*)allowIntentsList navigationsAllowList:(CDVAllowList*)navigationsAllowList;
+ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue;
+ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType;
@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
similarity index 80%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
index 3021f8f57..511d618dd 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m
@@ -18,14 +18,14 @@
*/
#import "CDVIntentAndNavigationFilter.h"
-#import <Cordova/CDV.h>
+#import <Cordova/CDVConfigParser.h>
@interface CDVIntentAndNavigationFilter ()
@property (nonatomic, readwrite) NSMutableArray* allowIntents;
@property (nonatomic, readwrite) NSMutableArray* allowNavigations;
-@property (nonatomic, readwrite) CDVWhitelist* allowIntentsWhitelist;
-@property (nonatomic, readwrite) CDVWhitelist* allowNavigationsWhitelist;
+@property (nonatomic, readwrite) CDVAllowList* allowIntentsList;
+@property (nonatomic, readwrite) CDVAllowList* allowNavigationsList;
@end
@@ -61,8 +61,8 @@
- (void)parserDidEndDocument:(NSXMLParser*)parser
{
- self.allowIntentsWhitelist = [[CDVWhitelist alloc] initWithArray:self.allowIntents];
- self.allowNavigationsWhitelist = [[CDVWhitelist alloc] initWithArray:self.allowNavigations];
+ self.allowIntentsList = [[CDVAllowList alloc] initWithArray:self.allowIntents];
+ self.allowNavigationsList = [[CDVAllowList alloc] initWithArray:self.allowNavigations];
}
- (void)parser:(NSXMLParser*)parser parseErrorOccurred:(NSError*)parseError
@@ -74,18 +74,16 @@
- (void)pluginInitialize
{
- if ([self.viewController isKindOfClass:[CDVViewController class]]) {
- [(CDVViewController*)self.viewController parseSettingsWithParser:self];
- }
+ [CDVConfigParser parseConfigFile:self.viewController.configFilePath withDelegate:self];
}
-+ (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url intentsWhitelist:(CDVWhitelist*)intentsWhitelist navigationsWhitelist:(CDVWhitelist*)navigationsWhitelist
++ (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url allowIntentsList:(CDVAllowList*)allowIntentsList navigationsAllowList:(CDVAllowList*)navigationsAllowList
{
// a URL can only allow-intent OR allow-navigation, if both are specified,
// only allow-navigation is allowed
- BOOL allowNavigationsPass = [navigationsWhitelist URLIsAllowed:url logFailure:NO];
- BOOL allowIntentPass = [intentsWhitelist URLIsAllowed:url logFailure:NO];
+ BOOL allowNavigationsPass = [navigationsAllowList URLIsAllowed:url logFailure:NO];
+ BOOL allowIntentPass = [allowIntentsList URLIsAllowed:url logFailure:NO];
if (allowNavigationsPass && allowIntentPass) {
return CDVIntentAndNavigationFilterValueNavigationAllowed;
@@ -100,7 +98,7 @@
- (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url
{
- return [[self class] filterUrl:url intentsWhitelist:self.allowIntentsWhitelist navigationsWhitelist:self.allowNavigationsWhitelist];
+ return [[self class] filterUrl:url allowIntentsList:self.allowIntentsList navigationsAllowList:self.allowNavigationsList];
}
#define CDVWebViewNavigationTypeLinkClicked 0
@@ -118,8 +116,8 @@
+ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue
{
- NSString* allowIntents_whitelistRejectionFormatString = @"ERROR External navigation rejected - <allow-intent> not set for url='%@'";
- NSString* allowNavigations_whitelistRejectionFormatString = @"ERROR Internal navigation rejected - <allow-navigation> not set for url='%@'";
+ NSString* allowIntents_allowListRejectionFormatString = @"ERROR External navigation rejected - <allow-intent> not set for url='%@'";
+ NSString* allowNavigations_allowListRejectionFormatString = @"ERROR Internal navigation rejected - <allow-navigation> not set for url='%@'";
NSURL* url = [request URL];
@@ -136,16 +134,16 @@
return NO;
case CDVIntentAndNavigationFilterValueNoneAllowed:
// allow-navigation attempt failed for sure
- NSLog(@"%@", [NSString stringWithFormat:allowNavigations_whitelistRejectionFormatString, [url absoluteString]]);
+ NSLog(@"%@", [NSString stringWithFormat:allowNavigations_allowListRejectionFormatString, [url absoluteString]]);
// anchor tag link means it was an allow-intent attempt that failed as well
if (CDVWebViewNavigationTypeLinkClicked == navigationType) {
- NSLog(@"%@", [NSString stringWithFormat:allowIntents_whitelistRejectionFormatString, [url absoluteString]]);
+ NSLog(@"%@", [NSString stringWithFormat:allowIntents_allowListRejectionFormatString, [url absoluteString]]);
}
return NO;
}
}
-- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType
+- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType info:(NSDictionary *)navInfo
{
return [[self class] shouldOverrideLoadWithRequest:request navigationType:navigationType filterValue:[self filterUrl:request.URL]];
}
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h
similarity index 100%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.h
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m
similarity index 73%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m
index 8ae39b67c..0609d6f4b 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m
@@ -17,16 +17,19 @@
under the License.
*/
-#import <WebKit/WebKit.h>
+#import "CDVLaunchScreen.h"
+#import "CDVViewController+Private.h"
-@interface CDVWebViewUIDelegate : NSObject <WKUIDelegate>
+@implementation CDVLaunchScreen
+
+- (void)show:(CDVInvokedUrlCommand *)command
{
- NSMutableArray<UIViewController*>* windows;
+ [self.viewController showSplashScreen:YES];
}
-@property (nonatomic, copy) NSString* title;
-@property (nonatomic, assign) BOOL allowNewWindows;
-
-- (instancetype)initWithTitle:(NSString*)title;
+- (void)hide:(CDVInvokedUrlCommand *)command
+{
+ [self.viewController showSplashScreen:NO];
+}
@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h
similarity index 100%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.h
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.m
similarity index 100%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVLogger/CDVLogger.m
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.h
new file mode 100644
index 000000000..9a83983be
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.h
@@ -0,0 +1,27 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Cordova/CDVPlugin.h>
+
+@interface CDVStatusBarInternal : CDVPlugin
+
+- (void)setVisible:(CDVInvokedUrlCommand*)command;
+- (void)setBackgroundColor:(CDVInvokedUrlCommand*)command;
+
+@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.m
new file mode 100644
index 000000000..fc6412bda
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVStatusBarInternal/CDVStatusBarInternal.m
@@ -0,0 +1,46 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVStatusBarInternal.h"
+#import "CDVViewController+Private.h"
+
+@implementation CDVStatusBarInternal
+
+- (void)setVisible:(CDVInvokedUrlCommand *)command
+{
+ id value = [command argumentAtIndex:0];
+ if (!([value isKindOfClass:[NSNumber class]])) {
+ value = [NSNumber numberWithBool:YES];
+ }
+
+ [self.viewController showStatusBar:[value boolValue]];
+}
+
+- (void)setBackgroundColor:(CDVInvokedUrlCommand *)command
+{
+ NSInteger valueR = [[command argumentAtIndex:0 withDefault:@0] integerValue];
+ NSInteger valueG = [[command argumentAtIndex:1 withDefault:@0] integerValue];
+ NSInteger valueB = [[command argumentAtIndex:2 withDefault:@0] integerValue];
+
+ UIColor *bgColor = [UIColor colorWithRed:valueR/255.f green:valueG/255.f blue:valueB/255.f alpha:1.f];
+ [self.viewController setStatusBarBackgroundColor:bgColor];
+}
+
+@end
+
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.h
similarity index 78%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.h
index c074fa61c..bb2f998af 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.h
@@ -17,18 +17,14 @@
under the License.
*/
-#import <Foundation/Foundation.h>
#import <WebKit/WebKit.h>
-#import "CDVViewController.h"
+@class CDVViewController;
@interface CDVURLSchemeHandler : NSObject <WKURLSchemeHandler>
+NS_ASSUME_NONNULL_BEGIN
-@property (nonatomic, strong) CDVViewController* viewController;
-
-@property (nonatomic) CDVPlugin* schemePlugin;
-
-- (instancetype)initWithVC:(CDVViewController *)controller;
-
+- (instancetype)initWithViewController:(CDVViewController *)controller;
+NS_ASSUME_NONNULL_END
@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.m
new file mode 100644
index 000000000..19aec026c
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVURLSchemeHandler.m
@@ -0,0 +1,258 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+
+#import "CDVURLSchemeHandler.h"
+#import <Cordova/CDVViewController.h>
+#import <Cordova/CDVPlugin.h>
+#import <Foundation/Foundation.h>
+#import <MobileCoreServices/MobileCoreServices.h>
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
+#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
+#endif
+
+static const NSUInteger FILE_BUFFER_SIZE = 1024 * 1024 * 4; // 4 MiB
+
+@interface CDVURLSchemeHandler ()
+
+@property (nonatomic, weak) CDVViewController *viewController;
+@property (nonatomic) NSMapTable <id <WKURLSchemeTask>, CDVPlugin <CDVPluginSchemeHandler> *> *handlerMap;
+
+@end
+
+@implementation CDVURLSchemeHandler
+
+- (instancetype)initWithViewController:(CDVViewController *)controller
+{
+ self = [super init];
+ if (self) {
+ _viewController = controller;
+ _handlerMap = [NSMapTable weakToWeakObjectsMapTable];
+ }
+ return self;
+}
+
+- (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask
+{
+ // Give plugins the chance to handle the url
+ for (CDVPlugin *plugin in self.viewController.enumerablePlugins) {
+ if ([plugin respondsToSelector:@selector(overrideSchemeTask:)]) {
+ CDVPlugin <CDVPluginSchemeHandler> *schemePlugin = (CDVPlugin<CDVPluginSchemeHandler> *)plugin;
+ if ([schemePlugin overrideSchemeTask:urlSchemeTask]) {
+ // Store the plugin that is handling this particular request
+ [self.handlerMap setObject:schemePlugin forKey:urlSchemeTask];
+ return;
+ }
+ }
+ }
+
+
+ NSURLRequest *req = urlSchemeTask.request;
+ if (![req.URL.scheme isEqualToString:self.viewController.appScheme]) {
+ return;
+ }
+
+ // Indicate that we are handling this task, by adding an entry with a null plugin
+ // We do this so that we can (in future) detect if the task is cancelled before we finished feeding it response data
+ [self.handlerMap setObject:(id)[NSNull null] forKey:urlSchemeTask];
+
+ [self.viewController.commandDelegate runInBackground:^{
+ NSURL *fileURL = [self fileURLForRequestURL:req.URL];
+ NSError *error;
+
+ NSFileHandle *fileHandle = [NSFileHandle fileHandleForReadingFromURL:fileURL error:&error];
+ if (!fileHandle || error) {
+ if ([self taskActive:urlSchemeTask]) {
+ [urlSchemeTask didFailWithError:error];
+ }
+
+ @synchronized(self.handlerMap) {
+ [self.handlerMap removeObjectForKey:urlSchemeTask];
+ }
+ return;
+ }
+
+ NSInteger statusCode = 200; // Default to 200 OK status
+ NSString *mimeType = [self getMimeType:fileURL] ?: @"application/octet-stream";
+ NSNumber *fileLength;
+ [fileURL getResourceValue:&fileLength forKey:NSURLFileSizeKey error:nil];
+
+ NSNumber *responseSize = fileLength;
+ NSUInteger responseSent = 0;
+
+ NSMutableDictionary *headers = [NSMutableDictionary dictionaryWithCapacity:5];
+ headers[@"Content-Type"] = mimeType;
+ headers[@"Cache-Control"] = @"no-cache";
+ headers[@"Content-Length"] = [responseSize stringValue];
+
+ // Check for Range header
+ NSString *rangeHeader = [urlSchemeTask.request valueForHTTPHeaderField:@"Range"];
+ if (rangeHeader) {
+ NSRange range = NSMakeRange(NSNotFound, 0);
+
+ if ([rangeHeader hasPrefix:@"bytes="]) {
+ NSString *byteRange = [rangeHeader substringFromIndex:6];
+ NSArray<NSString *> *rangeParts = [byteRange componentsSeparatedByString:@"-"];
+ NSUInteger start = (NSUInteger)[rangeParts[0] integerValue];
+ NSUInteger end = rangeParts.count > 1 && ![rangeParts[1] isEqualToString:@""] ? (NSUInteger)[rangeParts[1] integerValue] : [fileLength unsignedIntegerValue] - 1;
+ range = NSMakeRange(start, end - start + 1);
+ }
+
+ if (range.location != NSNotFound) {
+ // Ensure range is valid
+ if (range.location >= [fileLength unsignedIntegerValue] && [self taskActive:urlSchemeTask]) {
+ headers[@"Content-Range"] = [NSString stringWithFormat:@"bytes */%@", fileLength];
+ NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:req.URL statusCode:416 HTTPVersion:@"HTTP/1.1" headerFields:headers];
+ [urlSchemeTask didReceiveResponse:response];
+ [urlSchemeTask didFinish];
+
+ @synchronized(self.handlerMap) {
+ [self.handlerMap removeObjectForKey:urlSchemeTask];
+ }
+ return;
+ }
+
+ [fileHandle seekToFileOffset:range.location];
+ responseSize = [NSNumber numberWithUnsignedInteger:range.length];
+ statusCode = 206; // Partial Content
+ headers[@"Content-Range"] = [NSString stringWithFormat:@"bytes %lu-%lu/%@", (unsigned long)range.location, (unsigned long)(range.location + range.length - 1), fileLength];
+ headers[@"Content-Length"] = [NSString stringWithFormat:@"%lu", (unsigned long)range.length];
+ }
+ }
+
+ NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:req.URL statusCode:statusCode HTTPVersion:@"HTTP/1.1" headerFields:headers];
+ if ([self taskActive:urlSchemeTask]) {
+ [urlSchemeTask didReceiveResponse:response];
+ }
+
+ while ([self taskActive:urlSchemeTask] && responseSent < [responseSize unsignedIntegerValue]) {
+ @autoreleasepool {
+ NSData *data = [self readFromFileHandle:fileHandle upTo:FILE_BUFFER_SIZE error:&error];
+ if (!data || error) {
+ if ([self taskActive:urlSchemeTask]) {
+ [urlSchemeTask didFailWithError:error];
+ }
+ break;
+ }
+
+ if ([self taskActive:urlSchemeTask]) {
+ [urlSchemeTask didReceiveData:data];
+ }
+
+ responseSent += data.length;
+ }
+ }
+
+ [fileHandle closeFile];
+
+ if ([self taskActive:urlSchemeTask]) {
+ [urlSchemeTask didFinish];
+ }
+
+ @synchronized(self.handlerMap) {
+ [self.handlerMap removeObjectForKey:urlSchemeTask];
+ }
+ }];
+}
+
+- (void)webView:(WKWebView *)webView stopURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask
+{
+ CDVPlugin <CDVPluginSchemeHandler> *plugin;
+ @synchronized(self.handlerMap) {
+ plugin = [self.handlerMap objectForKey:urlSchemeTask];
+ }
+
+ if (![plugin isEqual:[NSNull null]] && [plugin respondsToSelector:@selector(stopSchemeTask:)]) {
+ [plugin stopSchemeTask:urlSchemeTask];
+ }
+
+ @synchronized(self.handlerMap) {
+ [self.handlerMap removeObjectForKey:urlSchemeTask];
+ }
+}
+
+#pragma mark - Utility methods
+
+- (NSURL *)fileURLForRequestURL:(NSURL *)url
+{
+ NSURL *resDir = [[NSBundle mainBundle] URLForResource:self.viewController.webContentFolderName withExtension:nil];
+ NSURL *filePath;
+
+ if ([url.path hasPrefix:@"/_app_file_"]) {
+ NSString *path = [url.path stringByReplacingOccurrencesOfString:@"/_app_file_" withString:@""];
+ filePath = [resDir URLByAppendingPathComponent:path];
+ } else {
+ if ([url.path isEqualToString:@""] || [url.pathExtension isEqualToString:@""]) {
+ filePath = [resDir URLByAppendingPathComponent:self.viewController.startPage];
+ } else {
+ filePath = [resDir URLByAppendingPathComponent:url.path];
+ }
+ }
+
+ return filePath.URLByStandardizingPath;
+}
+
+-(NSString *)getMimeType:(NSURL *)url
+{
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
+ if (@available(iOS 14.0, *)) {
+ UTType *uti;
+ [url getResourceValue:&uti forKey:NSURLContentTypeKey error:nil];
+ return [uti preferredMIMEType];
+ }
+#endif
+
+ NSString *type;
+ [url getResourceValue:&type forKey:NSURLTypeIdentifierKey error:nil];
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ return (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)type, kUTTagClassMIMEType);
+#pragma clang diagnostic pop
+}
+
+- (nullable NSData *)readFromFileHandle:(NSFileHandle *)handle upTo:(NSUInteger)length error:(NSError **)err
+{
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
+ if (@available(iOS 14.0, *)) {
+ return [handle readDataUpToLength:length error:err];
+ }
+#endif
+
+ @try {
+ return [handle readDataOfLength:length];
+ }
+ @catch (NSError *error) {
+ if (err != nil) {
+ *err = error;
+ }
+ return nil;
+ }
+}
+
+- (BOOL)taskActive:(id <WKURLSchemeTask>)task
+{
+ @synchronized(self.handlerMap) {
+ return [self.handlerMap objectForKey:task] != nil;
+ }
+}
+
+@end
+
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h
similarity index 97%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h
index 47e26d1e3..29e6fd8e1 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.h
@@ -18,7 +18,7 @@
*/
#import <WebKit/WebKit.h>
-#import <Cordova/CDV.h>
+#import <Cordova/CDVPlugin.h>
@interface CDVWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol, WKScriptMessageHandler, WKNavigationDelegate>
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
similarity index 63%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
index a07bf290a..b62f5f818 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
@@ -19,14 +19,14 @@
#import "CDVWebViewEngine.h"
#import "CDVWebViewUIDelegate.h"
-#import "CDVWebViewProcessPoolFactory.h"
-#import <Cordova/NSDictionary+CordovaPreferences.h>
#import "CDVURLSchemeHandler.h"
+#import <Cordova/CDVWebViewProcessPoolFactory.h>
+#import <Cordova/CDVSettingsDictionary.h>
+#import "CDVViewController+Private.h"
#import <objc/message.h>
#define CDV_BRIDGE_NAME @"cordova"
-#define CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR @"loadFileURL:allowingReadAccessToURL:"
@interface CDVWebViewWeakScriptMessageHandler : NSObject <WKScriptMessageHandler>
@@ -45,6 +45,7 @@
@property (nonatomic, strong) CDVURLSchemeHandler * schemeHandler;
@property (nonatomic, readwrite) NSString *CDV_ASSETS_URL;
@property (nonatomic, readwrite) Boolean cdvIsFileScheme;
+@property (nullable, nonatomic, strong, readwrite) WKWebViewConfiguration *configuration;
@end
@@ -55,24 +56,39 @@
@synthesize engineWebView = _engineWebView;
-- (instancetype)initWithFrame:(CGRect)frame
+- (nullable instancetype)initWithFrame:(CGRect)frame configuration:(nullable WKWebViewConfiguration *)configuration
{
self = [super init];
if (self) {
if (NSClassFromString(@"WKWebView") == nil) {
return nil;
}
-
- self.engineWebView = [[WKWebView alloc] initWithFrame:frame];
+
+ self.configuration = configuration;
+ self.engineWebView = configuration ? [[WKWebView alloc] initWithFrame:frame configuration:configuration] : [[WKWebView alloc] initWithFrame:frame];
}
return self;
}
-- (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)settings
+- (nullable instancetype)initWithFrame:(CGRect)frame
+{
+ return [self initWithFrame:frame configuration:nil];
+}
+
+- (WKWebViewConfiguration*) createConfigurationFromSettings:(CDVSettingsDictionary*)settings
{
- WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
- configuration.processPool = [[CDVWebViewProcessPoolFactory sharedFactory] sharedProcessPool];
+ WKWebViewConfiguration* configuration;
+ if (_configuration) {
+ configuration = _configuration;
+ } else {
+ configuration = [[WKWebViewConfiguration alloc] init];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ configuration.processPool = [[CDVWebViewProcessPoolFactory sharedFactory] sharedProcessPool];
+#pragma clang diagnostic pop
+ }
+
if (settings == nil) {
return configuration;
}
@@ -135,36 +151,37 @@
}
configuration.applicationNameForUserAgent = userAgent;
- if (@available(iOS 13.0, *)) {
- NSString *contentMode = [settings cordovaSettingForKey:@"PreferredContentMode"];
- if ([contentMode isEqual: @"mobile"]) {
- configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile;
- } else if ([contentMode isEqual: @"desktop"]) {
- configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeDesktop;
- }
-
+ NSString *contentMode = [settings cordovaSettingForKey:@"PreferredContentMode"];
+ if ([contentMode isEqual: @"mobile"]) {
+ configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile;
+ } else if ([contentMode isEqual: @"desktop"]) {
+ configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeDesktop;
+ }
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000
+ if (@available(iOS 14.0, *)) {
+ configuration.limitsNavigationsToAppBoundDomains = [settings cordovaBoolSettingForKey:@"LimitsNavigationsToAppBoundDomains" defaultValue:NO];
}
+#endif
return configuration;
}
- (void)pluginInitialize
{
- // viewController would be available now. we attempt to set all possible delegates to it, by default
- CDVViewController* vc = (CDVViewController*)self.viewController;
- NSDictionary* settings = self.commandDelegate.settings;
+ CDVSettingsDictionary* settings = self.commandDelegate.settings;
- NSString *scheme = [settings cordovaSettingForKey:@"scheme"];
+ NSString *scheme = self.viewController.appScheme;
// If scheme is file or nil, then default to file scheme
- self.cdvIsFileScheme = [scheme isEqualToString: @"file"] || scheme == nil;
+ self.cdvIsFileScheme = [scheme isEqualToString:@"file"] || scheme == nil;
NSString *hostname = @"";
if(!self.cdvIsFileScheme) {
if(scheme == nil || [WKWebView handlesURLScheme:scheme]){
scheme = @"app";
+ self.viewController.appScheme = scheme;
}
- vc.appScheme = scheme;
hostname = [settings cordovaSettingForKey:@"hostname"];
if(hostname == nil){
@@ -174,7 +191,9 @@
self.CDV_ASSETS_URL = [NSString stringWithFormat:@"%@://%@", scheme, hostname];
}
- CDVWebViewUIDelegate* uiDelegate = [[CDVWebViewUIDelegate alloc] initWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]];
+ CDVWebViewUIDelegate* uiDelegate = [[CDVWebViewUIDelegate alloc] initWithViewController:self.viewController];
+ uiDelegate.title = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
+ uiDelegate.mediaPermissionGrantType = [self parsePermissionGrantType:[settings cordovaSettingForKey:@"MediaPermissionGrantType"]];
uiDelegate.allowNewWindows = [settings cordovaBoolSettingForKey:@"AllowNewWindows" defaultValue:NO];
self.uiDelegate = uiDelegate;
@@ -197,7 +216,7 @@
// Do not configure the scheme handler if the scheme is default (file)
if(!self.cdvIsFileScheme) {
- self.schemeHandler = [[CDVURLSchemeHandler alloc] initWithVC:vc];
+ self.schemeHandler = [[CDVURLSchemeHandler alloc] initWithViewController:self.viewController];
[configuration setURLSchemeHandler:self.schemeHandler forURLScheme:scheme];
}
@@ -205,6 +224,20 @@
WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
wkWebView.UIDelegate = self.uiDelegate;
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
+ // With the introduction of iOS 16.4 the webview is no longer inspectable by default.
+ // We'll honor that change for release builds, but will still allow inspection on debug builds by default.
+ // We also introduce an override option, so consumers can influence this decision in their own build.
+ if (@available(iOS 16.4, *)) {
+#ifdef DEBUG
+ BOOL allowWebviewInspectionDefault = YES;
+#else
+ BOOL allowWebviewInspectionDefault = NO;
+#endif
+ wkWebView.inspectable = [settings cordovaBoolSettingForKey:@"InspectableWebview" defaultValue:allowWebviewInspectionDefault];
+ }
+#endif
+
/*
* This is where the "OverrideUserAgent" is handled. This will replace the entire UserAgent
* with the user defined custom UserAgent.
@@ -213,6 +246,8 @@
wkWebView.customUserAgent = [settings cordovaSettingForKey:@"OverrideUserAgent"];
}
+ [wkWebView addObserver:self forKeyPath:@"themeColor" options:NSKeyValueObservingOptionInitial context:nil];
+
self.engineWebView = wkWebView;
if ([self.viewController conformsToProtocol:@protocol(WKUIDelegate)]) {
@@ -231,73 +266,18 @@
[self updateSettings:settings];
- // check if content thread has died on resume
- NSLog(@"%@", @"CDVWebViewEngine will reload WKWebView if required on resume");
- [[NSNotificationCenter defaultCenter]
- addObserver:self
- selector:@selector(onAppWillEnterForeground:)
- name:UIApplicationWillEnterForegroundNotification object:nil];
-
NSLog(@"Using WKWebView");
-
- [self addURLObserver];
-}
-
-- (void)onReset {
- [self addURLObserver];
-}
-
-static void * KVOContext = &KVOContext;
-
-- (void)addURLObserver {
- if(!IsAtLeastiOSVersion(@"9.0")){
- [self.webView addObserver:self forKeyPath:@"URL" options:0 context:KVOContext];
- }
-}
-
-- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context
-{
- if (context == KVOContext) {
- if (object == [self webView] && [keyPath isEqualToString: @"URL"] && [object valueForKeyPath:keyPath] == nil){
- NSLog(@"URL is nil. Reloading WKWebView");
- [(WKWebView*)_engineWebView reload];
- }
- } else {
- [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
- }
}
-- (void) onAppWillEnterForeground:(NSNotification*)notification {
- if ([self shouldReloadWebView]) {
- NSLog(@"%@", @"CDVWebViewEngine reloading!");
- [(WKWebView*)_engineWebView reload];
- }
-}
-
-- (BOOL)shouldReloadWebView
+- (void)dispose
{
WKWebView* wkWebView = (WKWebView*)_engineWebView;
- return [self shouldReloadWebView:wkWebView.URL title:wkWebView.title];
-}
-
-- (BOOL)shouldReloadWebView:(NSURL*)location title:(NSString*)title
-{
- BOOL title_is_nil = (title == nil);
- BOOL location_is_blank = [[location absoluteString] isEqualToString:@"about:blank"];
+ [wkWebView.configuration.userContentController removeScriptMessageHandlerForName:CDV_BRIDGE_NAME];
+ _engineWebView = nil;
- BOOL reload = (title_is_nil || location_is_blank);
-
-#ifdef DEBUG
- NSLog(@"%@", @"CDVWebViewEngine shouldReloadWebView::");
- NSLog(@"CDVWebViewEngine shouldReloadWebView title: %@", title);
- NSLog(@"CDVWebViewEngine shouldReloadWebView location: %@", [location absoluteString]);
- NSLog(@"CDVWebViewEngine shouldReloadWebView reload: %u", reload);
-#endif
-
- return reload;
+ [super dispose];
}
-
- (id)loadRequest:(NSURLRequest*)request
{
if ([self canLoadRequest:request]) { // can load, differentiate between file urls and other schemes
@@ -305,7 +285,7 @@ static void * KVOContext = &KVOContext;
NSURL* readAccessUrl = [request.URL URLByDeletingLastPathComponent];
return [(WKWebView*)_engineWebView loadFileURL:request.URL allowingReadAccessToURL:readAccessUrl];
} else if (request.URL.fileURL) {
- NSURL* startURL = [NSURL URLWithString:((CDVViewController *)self.viewController).startPage];
+ NSURL* startURL = [NSURL URLWithString:self.viewController.startPage];
NSString* startFilePath = [self.commandDelegate pathForResource:[startURL path]];
NSURL *url = [[NSURL URLWithString:self.CDV_ASSETS_URL] URLByAppendingPathComponent:request.URL.path];
if ([request.URL.path isEqualToString:startFilePath]) {
@@ -317,7 +297,8 @@ static void * KVOContext = &KVOContext;
if(request.URL.fragment) {
url = [NSURL URLWithString:[@"#" stringByAppendingString:request.URL.fragment] relativeToURL:url];
}
- request = [NSURLRequest requestWithURL:url];
+ // We ignore any existing cached data, since we're already loading it from the filesystem
+ request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:request.timeoutInterval];
}
return [(WKWebView*)_engineWebView loadRequest:request];
} else { // can't load, print out error
@@ -348,18 +329,10 @@ static void * KVOContext = &KVOContext;
- (BOOL) canLoadRequest:(NSURLRequest*)request
{
- // See: https://issues.apache.org/jira/browse/CB-9636
- SEL wk_sel = NSSelectorFromString(CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR);
-
- // if it's a file URL, check whether WKWebView has the selector (which is in iOS 9 and up only)
- if (request.URL.fileURL) {
- return [_engineWebView respondsToSelector:wk_sel];
- } else {
- return YES;
- }
+ return YES;
}
-- (void)updateSettings:(NSDictionary*)settings
+- (void)updateSettings:(CDVSettingsDictionary*)settings
{
WKWebView* wkWebView = (WKWebView*)_engineWebView;
@@ -376,7 +349,10 @@ static void * KVOContext = &KVOContext;
// prevent webView from bouncing
if (!bounceAllowed) {
if ([wkWebView respondsToSelector:@selector(scrollView)]) {
- ((UIScrollView*)[wkWebView scrollView]).bounces = NO;
+ UIScrollView* scrollView = [wkWebView scrollView];
+ scrollView.bounces = NO;
+ scrollView.alwaysBounceVertical = NO; /* iOS 16 workaround */
+ scrollView.alwaysBounceHorizontal = NO; /* iOS 16 workaround */
} else {
for (id subview in wkWebView.subviews) {
if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
@@ -401,7 +377,7 @@ static void * KVOContext = &KVOContext;
- (void)updateWithInfo:(NSDictionary*)info
{
NSDictionary* scriptMessageHandlers = [info objectForKey:kCDVWebViewEngineScriptMessageHandlers];
- NSDictionary* settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences];
+ id settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences];
id navigationDelegate = [info objectForKey:kCDVWebViewEngineWKNavigationDelegate];
id uiDelegate = [info objectForKey:kCDVWebViewEngineWKUIDelegate];
@@ -426,8 +402,10 @@ static void * KVOContext = &KVOContext;
wkWebView.UIDelegate = uiDelegate;
}
- if (settings && [settings isKindOfClass:[NSDictionary class]]) {
+ if (settings && [settings isKindOfClass:[CDVSettingsDictionary class]]) {
[self updateSettings:settings];
+ } else if (settings && [settings isKindOfClass:[NSDictionary class]]) {
+ [self updateSettings:[[CDVSettingsDictionary alloc] initWithDictionary:settings]];
}
}
@@ -445,7 +423,41 @@ static void * KVOContext = &KVOContext;
return self.engineWebView;
}
-#pragma mark WKScriptMessageHandler implementation
+- (CDVWebViewPermissionGrantType)parsePermissionGrantType:(NSString*)optionString
+{
+ CDVWebViewPermissionGrantType result = CDVWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt;
+
+ if (optionString != nil){
+ if ([optionString isEqualToString:@"prompt"]) {
+ result = CDVWebViewPermissionGrantType_Prompt;
+ } else if ([optionString isEqualToString:@"deny"]) {
+ result = CDVWebViewPermissionGrantType_Deny;
+ } else if ([optionString isEqualToString:@"grant"]) {
+ result = CDVWebViewPermissionGrantType_Grant;
+ } else if ([optionString isEqualToString:@"grantIfSameHostElsePrompt"]) {
+ result = CDVWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt;
+ } else if ([optionString isEqualToString:@"grantIfSameHostElseDeny"]) {
+ result = CDVWebViewPermissionGrantType_GrantIfSameHost_ElseDeny;
+ } else {
+ NSLog(@"Invalid \"MediaPermissionGrantType\" was detected. Fallback to default value of \"grantIfSameHostElsePrompt\"");
+ }
+ }
+
+ return result;
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+ if ([keyPath isEqualToString:@"themeColor"]) {
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000
+ if (@available(iOS 15.0, *)) {
+ [self.viewController setStatusBarWebViewColor:((WKWebView *)self.engineWebView).themeColor];
+ }
+#endif
+ }
+}
+
+#pragma mark - WKScriptMessageHandler implementation
- (void)userContentController:(WKUserContentController*)userContentController didReceiveScriptMessage:(WKScriptMessage*)message
{
@@ -481,7 +493,7 @@ static void * KVOContext = &KVOContext;
}
}
-#pragma mark WKNavigationDelegate implementation
+#pragma mark - WKNavigationDelegate implementation
- (void)webView:(WKWebView*)webView didStartProvisionalNavigation:(WKNavigation*)navigation
{
@@ -500,23 +512,30 @@ static void * KVOContext = &KVOContext;
- (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigation withError:(NSError*)error
{
- CDVViewController* vc = (CDVViewController*)self.viewController;
-
NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]];
NSLog(@"%@", message);
- NSURL* errorUrl = vc.errorURL;
- if (errorUrl) {
- NSCharacterSet *charSet = [NSCharacterSet URLFragmentAllowedCharacterSet];
- errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:charSet]] relativeToURL:errorUrl];
- NSLog(@"%@", [errorUrl absoluteString]);
- [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
+ if (error.code != NSURLErrorCancelled) {
+ NSURL* errorUrl = self.viewController.errorURL;
+ if (errorUrl) {
+ NSCharacterSet *charSet = [NSCharacterSet URLFragmentAllowedCharacterSet];
+ errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:charSet]] relativeToURL:errorUrl];
+ NSLog(@"%@", [errorUrl absoluteString]);
+ [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]];
+ }
}
}
- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
{
- [webView reload];
+ CDVSettingsDictionary *settings = self.commandDelegate.settings;
+ NSString *recoveryBehavior = [settings cordovaSettingForKey:@"CrashRecoveryBehavior"];
+
+ if ([recoveryBehavior isEqualToString:@"reload"]) {
+ [self.viewController loadStartPage];
+ } else {
+ [webView reload];
+ }
}
- (BOOL)defaultResourcePolicyForURL:(NSURL*)url
@@ -529,46 +548,80 @@ static void * KVOContext = &KVOContext;
return NO;
}
-- (void) webView: (WKWebView *) webView decidePolicyForNavigationAction: (WKNavigationAction*) navigationAction decisionHandler: (void (^)(WKNavigationActionPolicy)) decisionHandler
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
{
- NSURL* url = [navigationAction.request URL];
- CDVViewController* vc = (CDVViewController*)self.viewController;
+ CDVViewController *vc = (CDVViewController *)self.viewController;
- /*
- * Give plugins the chance to handle the url
- */
- BOOL anyPluginsResponded = NO;
- BOOL shouldAllowRequest = NO;
-
- for (NSString* pluginName in vc.pluginObjects) {
- CDVPlugin* plugin = [vc.pluginObjects objectForKey:pluginName];
- SEL selector = NSSelectorFromString(@"shouldOverrideLoadWithRequest:navigationType:");
- if ([plugin respondsToSelector:selector]) {
- anyPluginsResponded = YES;
- // https://issues.apache.org/jira/browse/CB-12497
- int navType = (int)navigationAction.navigationType;
- shouldAllowRequest = (((BOOL (*)(id, SEL, id, int))objc_msgSend)(plugin, selector, navigationAction.request, navType));
- if (!shouldAllowRequest) {
- break;
+ NSURLRequest *request = navigationAction.request;
+ CDVWebViewNavigationType navType = (CDVWebViewNavigationType)navigationAction.navigationType;
+ NSMutableDictionary *info = [NSMutableDictionary dictionary];
+ info[@"sourceFrame"] = navigationAction.sourceFrame;
+ info[@"targetFrame"] = navigationAction.targetFrame;
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500
+ if (@available(iOS 14.5, *)) {
+ info[@"shouldPerformDownload"] = [NSNumber numberWithBool:navigationAction.shouldPerformDownload];
+ }
+#endif
+
+ // Give plugins the chance to handle the url, as long as this WebViewEngine is still the WKNavigationDelegate.
+ // This allows custom delegates to choose to call this method for `default` cordova behavior without querying all plugins.
+ if (webView.navigationDelegate == self) {
+ BOOL anyPluginsResponded = NO;
+ BOOL shouldAllowRequest = NO;
+
+ for (CDVPlugin *plugin in vc.enumerablePlugins) {
+ if ([plugin respondsToSelector:@selector(shouldOverrideLoadWithRequest:navigationType:info:)] || [plugin respondsToSelector:@selector(shouldOverrideLoadWithRequest:navigationType:)]) {
+ CDVPlugin <CDVPluginNavigationHandler> *navPlugin = (CDVPlugin <CDVPluginNavigationHandler> *)plugin;
+ anyPluginsResponded = YES;
+
+ if ([navPlugin respondsToSelector:@selector(shouldOverrideLoadWithRequest:navigationType:info:)]) {
+ shouldAllowRequest = [navPlugin shouldOverrideLoadWithRequest:request navigationType:navType info:info];
+ } else {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ shouldAllowRequest = [navPlugin shouldOverrideLoadWithRequest:request navigationType:navType];
+#pragma clang diagnostic pop
+ }
+
+ if (!shouldAllowRequest) {
+ break;
+ }
}
}
+
+ if (anyPluginsResponded) {
+ return decisionHandler(shouldAllowRequest ? WKNavigationActionPolicyAllow : WKNavigationActionPolicyCancel);
+ }
+ } else {
+ CDVPlugin <CDVPluginNavigationHandler> *intentAndNavFilter = (CDVPlugin <CDVPluginNavigationHandler> *)[vc getCommandInstance:@"IntentAndNavigationFilter"];
+ if (intentAndNavFilter) {
+ BOOL shouldAllowRequest = [intentAndNavFilter shouldOverrideLoadWithRequest:request navigationType:navType info:info];
+ return decisionHandler(shouldAllowRequest ? WKNavigationActionPolicyAllow : WKNavigationActionPolicyCancel);
+ }
}
- if (anyPluginsResponded) {
- return decisionHandler(shouldAllowRequest);
+ // Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview.
+ BOOL shouldAllowNavigation = [self defaultResourcePolicyForURL:request.URL];
+ if (!shouldAllowNavigation) {
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:request.URL userInfo:@{}]];
}
+ return decisionHandler(shouldAllowNavigation ? WKNavigationActionPolicyAllow : WKNavigationActionPolicyCancel);
+}
- /*
- * Handle all other types of urls (tel:, sms:), and requests to load a url in the main webview.
- */
- BOOL shouldAllowNavigation = [self defaultResourcePolicyForURL:url];
- if (shouldAllowNavigation) {
- return decisionHandler(YES);
- } else {
- [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
+- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler
+{
+ CDVViewController* vc = (CDVViewController*)self.viewController;
+
+ for (CDVPlugin *plugin in vc.enumerablePlugins) {
+ if ([plugin respondsToSelector:@selector(willHandleAuthenticationChallenge:completionHandler:)]) {
+ CDVPlugin <CDVPluginAuthenticationHandler> *challengePlugin = (CDVPlugin <CDVPluginAuthenticationHandler> *)plugin;
+ if ([challengePlugin willHandleAuthenticationChallenge:challenge completionHandler:completionHandler]) {
+ return;
+ }
+ }
}
- return decisionHandler(NO);
+ completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
}
#pragma mark - Plugin interface
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h
new file mode 100644
index 000000000..2e4ac894e
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h
@@ -0,0 +1,51 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <WebKit/WebKit.h>
+
+#ifdef NS_SWIFT_UI_ACTOR
+#define CDV_SWIFT_UI_ACTOR NS_SWIFT_UI_ACTOR
+#else
+#define CDV_SWIFT_UI_ACTOR
+#endif
+
+@class CDVViewController;
+
+NS_ASSUME_NONNULL_BEGIN
+
+CDV_SWIFT_UI_ACTOR
+@interface CDVWebViewUIDelegate : NSObject <WKUIDelegate>
+
+typedef NS_ENUM(NSInteger, CDVWebViewPermissionGrantType) {
+ CDVWebViewPermissionGrantType_Prompt,
+ CDVWebViewPermissionGrantType_Deny,
+ CDVWebViewPermissionGrantType_Grant,
+ CDVWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt,
+ CDVWebViewPermissionGrantType_GrantIfSameHost_ElseDeny
+};
+
+@property (nonatomic, nullable, copy) NSString* title;
+@property (nonatomic, assign) BOOL allowNewWindows;
+@property (nonatomic, assign) CDVWebViewPermissionGrantType mediaPermissionGrantType;
+
+- (instancetype)initWithViewController:(CDVViewController*)vc;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m
similarity index 62%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m
index 784af8dfa..b07d7aaee 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.m
@@ -18,22 +18,32 @@
*/
#import "CDVWebViewUIDelegate.h"
+#import <Cordova/CDVViewController.h>
+
+@interface CDVWebViewUIDelegate ()
+
+@property (nonatomic, weak) CDVViewController *viewController;
+
+@end
@implementation CDVWebViewUIDelegate
+{
+ NSMutableArray<UIViewController *> *windows;
+}
-- (instancetype)initWithTitle:(NSString*)title
+- (instancetype)initWithViewController:(CDVViewController *)vc
{
self = [super init];
+
if (self) {
- self.title = title;
+ self.viewController = vc;
+ self.title = vc.title;
windows = [[NSMutableArray alloc] init];
}
-
return self;
}
-- (void) webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message
- initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(void))completionHandler
+- (void)webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message initiatedByFrame:(WKFrameInfo*)frame completionHandler:(CDV_SWIFT_UI_ACTOR void (^)(void))completionHandler
{
UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
message:message
@@ -49,13 +59,10 @@
[alert addAction:ok];
- UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
-
- [rootController presentViewController:alert animated:YES completion:nil];
+ [[self topViewController] presentViewController:alert animated:YES completion:nil];
}
-- (void) webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message
- initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(BOOL result))completionHandler
+- (void)webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message initiatedByFrame:(WKFrameInfo*)frame completionHandler:(CDV_SWIFT_UI_ACTOR void (^)(BOOL result))completionHandler
{
UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
message:message
@@ -80,14 +87,10 @@
}];
[alert addAction:cancel];
- UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
-
- [rootController presentViewController:alert animated:YES completion:nil];
+ [[self topViewController] presentViewController:alert animated:YES completion:nil];
}
-- (void) webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt
- defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame
- completionHandler:(void (^)(NSString* result))completionHandler
+- (void)webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame completionHandler:(CDV_SWIFT_UI_ACTOR void (^)(NSString* result))completionHandler
{
UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
message:prompt
@@ -116,12 +119,10 @@
textField.text = defaultText;
}];
- UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
-
- [rootController presentViewController:alert animated:YES completion:nil];
+ [[self topViewController] presentViewController:alert animated:YES completion:nil];
}
-- (WKWebView*) webView:(WKWebView*)webView createWebViewWithConfiguration:(WKWebViewConfiguration*)configuration forNavigationAction:(WKNavigationAction*)navigationAction windowFeatures:(WKWindowFeatures*)windowFeatures
+- (nullable WKWebView*)webView:(WKWebView*)webView createWebViewWithConfiguration:(WKWebViewConfiguration*)configuration forNavigationAction:(WKNavigationAction*)navigationAction windowFeatures:(WKWindowFeatures*)windowFeatures
{
if (!navigationAction.targetFrame.isMainFrame) {
if (self.allowNewWindows) {
@@ -135,8 +136,7 @@
[windows addObject:vc];
- UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
- [rootController presentViewController:vc animated:YES completion:nil];
+ [[self topViewController] presentViewController:vc animated:YES completion:nil];
return v;
} else {
[webView loadRequest:navigationAction.request];
@@ -159,5 +159,43 @@
// We do not allow closing the primary WebView
}
+- (void)webView:(WKWebView *)webView requestMediaCapturePermissionForOrigin:(nonnull WKSecurityOrigin *)origin initiatedByFrame:(nonnull WKFrameInfo *)frame type:(WKMediaCaptureType)type decisionHandler:(nonnull void (^)(WKPermissionDecision))decisionHandler
+ API_AVAILABLE(ios(15.0))
+{
+ WKPermissionDecision decision;
+
+ if (_mediaPermissionGrantType == CDVWebViewPermissionGrantType_Prompt) {
+ decision = WKPermissionDecisionPrompt;
+ }
+ else if (_mediaPermissionGrantType == CDVWebViewPermissionGrantType_Deny) {
+ decision = WKPermissionDecisionDeny;
+ }
+ else if (_mediaPermissionGrantType == CDVWebViewPermissionGrantType_Grant) {
+ decision = WKPermissionDecisionGrant;
+ }
+ else {
+ if ([origin.host isEqualToString:webView.URL.host]) {
+ decision = WKPermissionDecisionGrant;
+ }
+ else {
+ decision =_mediaPermissionGrantType == CDVWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt ? WKPermissionDecisionPrompt : WKPermissionDecisionDeny;
+ }
+ }
+
+ decisionHandler(decision);
+}
+
+#pragma mark - Utility Methods
+
+- (nullable UIViewController *)topViewController
+{
+ UIViewController *vc = self.viewController;
+
+ while (vc.presentedViewController != nil && ![vc.presentedViewController isBeingDismissed]) {
+ vc = vc.presentedViewController;
+ }
+
+ return vc;
+}
@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.m
new file mode 100644
index 000000000..7dc9c2b1b
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVAppDelegate.m
@@ -0,0 +1,76 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Cordova/CDVAppDelegate.h>
+#import <Cordova/CDVAvailability.h>
+#import <Cordova/CDVPluginNotifications.h>
+#import <Cordova/CDVViewController.h>
+
+@implementation CDVAppDelegate
+
+@synthesize window, viewController;
+
+- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> *)launchOptions
+{
+#if DEBUG
+ NSLog(@"Apache Cordova iOS platform version %@ is starting.", CDV_VERSION);
+#endif
+
+ return YES;
+}
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey, id> *)launchOptions
+{
+ return YES;
+}
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#pragma clang diagnostic ignored "-Wdeprecated-implementations"
+// this happens while we are running ( in the background, or from within our own app )
+// only valid if Info.plist specifies a protocol to handle
+- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
+{
+ if (!url) {
+ return NO;
+ }
+
+ // all plugins will get the notification, and their handlers will be called
+ [[NSNotificationCenter defaultCenter] postNotificationName:CDVPluginHandleOpenURLNotification object:url userInfo:options];
+
+ // TODO: This should be deprecated and removed in Cordova iOS 9, since we're passing this data in the notification userInfo now
+ NSMutableDictionary * openURLData = [[NSMutableDictionary alloc] init];
+
+ [openURLData setValue:url forKey:@"url"];
+
+ if (options[UIApplicationOpenURLOptionsSourceApplicationKey]) {
+ [openURLData setValue:options[UIApplicationOpenURLOptionsSourceApplicationKey] forKey:@"sourceApplication"];
+ }
+
+ if (options[UIApplicationOpenURLOptionsAnnotationKey]) {
+ [openURLData setValue:options[UIApplicationOpenURLOptionsAnnotationKey] forKey:@"annotation"];
+ }
+
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification object:openURLData]];
+
+ return YES;
+}
+#pragma clang diagnostic pop
+
+@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandQueue.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.m
similarity index 95%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandQueue.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.m
index b78ed833e..2b684c593 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandQueue.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVCommandQueue.m
@@ -18,8 +18,10 @@
*/
#include <objc/message.h>
-#import "CDVCommandQueue.h"
-#import "CDVViewController.h"
+#import <Cordova/CDVCommandQueue.h>
+#import <Cordova/CDVViewController.h>
+#import <Cordova/CDVPlugin.h>
+#import <Cordova/NSMutableArray+QueueAdditions.h>
#import "CDVCommandDelegateImpl.h"
#import "CDVJSON_private.h"
#import "CDVDebug.h"
@@ -44,7 +46,12 @@ static const double MAX_EXECUTION_TIME = .008; // Half of a 60fps frame.
return _startExecutionTime > 0;
}
-- (id)initWithViewController:(CDVViewController*)viewController
+- (instancetype)init
+{
+ return [self initWithViewController:nil];
+}
+
+- (instancetype)initWithViewController:(CDVViewController *)viewController
{
self = [super init];
if (self != nil) {
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVConfigParser.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.m
similarity index 62%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVConfigParser.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.m
index ab32b4a76..6f8da6a92 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVConfigParser.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVConfigParser.m
@@ -17,22 +17,50 @@
under the License.
*/
-#import "CDVConfigParser.h"
+#import <Cordova/CDVConfigParser.h>
@interface CDVConfigParser ()
+{
+ NSString *featureName;
+}
-@property (nonatomic, readwrite, strong) NSMutableDictionary* pluginsDict;
-@property (nonatomic, readwrite, strong) NSMutableDictionary* settings;
-@property (nonatomic, readwrite, strong) NSMutableArray* startupPluginNames;
-@property (nonatomic, readwrite, strong) NSString* startPage;
+@property (nonatomic, readwrite, strong) NSMutableDictionary *pluginsDict;
+@property (nonatomic, readwrite, strong) NSMutableDictionary *settings;
+@property (nonatomic, readwrite, strong) NSMutableArray *startupPluginNames;
+@property (nonatomic, readwrite, strong) NSString *startPage;
@end
@implementation CDVConfigParser
-@synthesize pluginsDict, settings, startPage, startupPluginNames;
+@synthesize pluginsDict;
+@synthesize settings;
+@synthesize startPage;
+@synthesize startupPluginNames;
+
++ (instancetype)parseConfigFile:(NSURL *)filePath
+{
+ CDVConfigParser* delegate = [[CDVConfigParser alloc] init];
+ [CDVConfigParser parseConfigFile:filePath withDelegate:delegate];
+ return delegate;
+}
+
++ (BOOL)parseConfigFile:(NSURL *)filePath withDelegate:(id <NSXMLParserDelegate>)delegate
+{
+ NSXMLParser *configParser = [[NSXMLParser alloc] initWithContentsOfURL:filePath];
+
+ if (configParser == nil) {
+ NSLog(@"Failed to initialize XML parser.");
+ return NO;
+ }
+
+ [configParser setDelegate:delegate];
+ [configParser parse];
+
+ return YES;
+}
-- (id)init
+- (instancetype)init
{
self = [super init];
if (self != nil) {
@@ -44,14 +72,14 @@
return self;
}
-- (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName attributes:(NSDictionary*)attributeDict
+- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict
{
if ([elementName isEqualToString:@"preference"]) {
settings[[attributeDict[@"name"] lowercaseString]] = attributeDict[@"value"];
} else if ([elementName isEqualToString:@"feature"]) { // store feature name to use with correct parameter set
featureName = [attributeDict[@"name"] lowercaseString];
} else if ((featureName != nil) && [elementName isEqualToString:@"param"]) {
- NSString* paramName = [attributeDict[@"name"] lowercaseString];
+ NSString *paramName = [attributeDict[@"name"] lowercaseString];
id value = attributeDict[@"value"];
if ([paramName isEqualToString:@"ios-package"]) {
pluginsDict[featureName] = value;
@@ -66,14 +94,14 @@
}
}
-- (void)parser:(NSXMLParser*)parser didEndElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName
+- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName
{
if ([elementName isEqualToString:@"feature"]) { // no longer handling a feature so release
featureName = nil;
}
}
-- (void)parser:(NSXMLParser*)parser parseErrorOccurred:(NSError*)parseError
+- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError
{
NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]);
}
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m
similarity index 87%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m
index 5b4281dfc..aaad4edb5 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m
@@ -17,7 +17,7 @@
under the License.
*/
-#import "CDVInvokedUrlCommand.h"
+#import <Cordova/CDVInvokedUrlCommand.h>
#import "CDVJSON_private.h"
@implementation CDVInvokedUrlCommand
@@ -27,12 +27,17 @@
@synthesize className = _className;
@synthesize methodName = _methodName;
-+ (CDVInvokedUrlCommand*)commandFromJson:(NSArray*)jsonEntry
++ (instancetype)commandFromJson:(NSArray *)jsonEntry
{
return [[CDVInvokedUrlCommand alloc] initFromJson:jsonEntry];
}
-- (id)initFromJson:(NSArray*)jsonEntry
+- (instancetype)init
+{
+ return [self initWithArguments:nil callbackId:nil className:nil methodName:nil];
+}
+
+- (instancetype)initFromJson:(NSArray *)jsonEntry
{
id tmp = [jsonEntry objectAtIndex:0];
NSString* callbackId = tmp == [NSNull null] ? nil : tmp;
@@ -46,10 +51,10 @@
methodName:methodName];
}
-- (id)initWithArguments:(NSArray*)arguments
- callbackId:(NSString*)callbackId
- className:(NSString*)className
- methodName:(NSString*)methodName
+- (instancetype)initWithArguments:(NSArray *)arguments
+ callbackId:(NSString *)callbackId
+ className:(NSString *)className
+ methodName:(NSString *)methodName
{
self = [super init];
if (self != nil) {
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m
similarity index 97%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m
index 56907385f..f18f7429f 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin+Resources.m
@@ -17,7 +17,7 @@
under the License.
*/
-#import "CDVPlugin+Resources.h"
+#import <Cordova/CDVPlugin+Resources.h>
@implementation CDVPlugin (CDVPluginResources)
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.m
similarity index 79%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.m
index 6af03e9cc..52d95d344 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPlugin.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPlugin.m
@@ -17,11 +17,10 @@
under the License.
*/
-#import "CDVPlugin.h"
+#import <Cordova/CDVPlugin.h>
+#import <Cordova/CDVPlugin+Resources.h>
#import "CDVPlugin+Private.h"
-#import "CDVPlugin+Resources.h"
-#import "CDVViewController.h"
-#include <objc/message.h>
+#import <Cordova/CDVViewController.h>
@implementation UIView (org_apache_cordova_UIView_Extension)
@@ -29,28 +28,31 @@
- (UIScrollView*)scrollView
{
- SEL scrollViewSelector = NSSelectorFromString(@"scrollView");
+ static UIView *caller = nil;
- if ([self respondsToSelector:scrollViewSelector]) {
- return ((id (*)(id, SEL))objc_msgSend)(self, scrollViewSelector);
+ if (caller != self && [self respondsToSelector:@selector(scrollView)]) {
+ caller = self;
+ UIScrollView *sv = [self performSelector:@selector(scrollView)];
+ caller = nil;
+ return sv;
}
-
+ caller = nil;
return nil;
}
@end
-NSString* const CDVPageDidLoadNotification = @"CDVPageDidLoadNotification";
-NSString* const CDVPluginHandleOpenURLNotification = @"CDVPluginHandleOpenURLNotification";
-NSString* const CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification = @"CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification";
-NSString* const CDVPluginResetNotification = @"CDVPluginResetNotification";
-NSString* const CDVViewWillAppearNotification = @"CDVViewWillAppearNotification";
-NSString* const CDVViewDidAppearNotification = @"CDVViewDidAppearNotification";
-NSString* const CDVViewWillDisappearNotification = @"CDVViewWillDisappearNotification";
-NSString* const CDVViewDidDisappearNotification = @"CDVViewDidDisappearNotification";
-NSString* const CDVViewWillLayoutSubviewsNotification = @"CDVViewWillLayoutSubviewsNotification";
-NSString* const CDVViewDidLayoutSubviewsNotification = @"CDVViewDidLayoutSubviewsNotification";
-NSString* const CDVViewWillTransitionToSizeNotification = @"CDVViewWillTransitionToSizeNotification";
+const NSNotificationName CDVPageDidLoadNotification = @"CDVPageDidLoadNotification";
+const NSNotificationName CDVPluginHandleOpenURLNotification = @"CDVPluginHandleOpenURLNotification";
+const NSNotificationName CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification = @"CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification";
+const NSNotificationName CDVPluginResetNotification = @"CDVPluginResetNotification";
+const NSNotificationName CDVViewWillAppearNotification = @"CDVViewWillAppearNotification";
+const NSNotificationName CDVViewDidAppearNotification = @"CDVViewDidAppearNotification";
+const NSNotificationName CDVViewWillDisappearNotification = @"CDVViewWillDisappearNotification";
+const NSNotificationName CDVViewDidDisappearNotification = @"CDVViewDidDisappearNotification";
+const NSNotificationName CDVViewWillLayoutSubviewsNotification = @"CDVViewWillLayoutSubviewsNotification";
+const NSNotificationName CDVViewDidLayoutSubviewsNotification = @"CDVViewDidLayoutSubviewsNotification";
+const NSNotificationName CDVViewWillTransitionToSizeNotification = @"CDVViewWillTransitionToSizeNotification";
@interface CDVPlugin ()
@@ -66,14 +68,18 @@ NSString* const CDVViewWillTransitionToSizeNotification = @"CDVViewWillTransitio
// Do not override these methods. Use pluginInitialize instead.
- (instancetype)initWithWebViewEngine:(id <CDVWebViewEngineProtocol>)theWebViewEngine
{
- self = [super init];
+ self = [self init];
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppTerminate) name:UIApplicationWillTerminateNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURL:) name:CDVPluginHandleOpenURLNotification object:nil];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURLWithApplicationSourceAndAnnotation:) name:CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onReset) name:CDVPluginResetNotification object:theWebViewEngine.engineWebView];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURLWithApplicationSourceAndAnnotation:) name:CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification object:nil];
+#pragma clang diagnostic pop
+
self.webViewEngine = theWebViewEngine;
}
return self;
@@ -109,7 +115,7 @@ NSString* const CDVViewWillTransitionToSizeNotification = @"CDVViewWillTransitio
commandDelegate = nil;
}
-- (UIView*)webView
+- (UIView *)webView
{
if (self.webViewEngine != nil) {
return self.webViewEngine.engineWebView;
@@ -127,7 +133,7 @@ NSString* const CDVViewWillTransitionToSizeNotification = @"CDVViewWillTransitio
*/
/* NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts */
-- (void)handleOpenURL:(NSNotification*)notification
+- (void)handleOpenURL:(NSNotification *)notification
{
// override to handle urls sent to your app
// register your url schemes in your App-Info.plist
@@ -142,7 +148,7 @@ NSString* const CDVViewWillTransitionToSizeNotification = @"CDVViewWillTransitio
/*
NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts
*/
-- (void)handleOpenURLWithApplicationSourceAndAnnotation: (NSNotification*)notification
+- (void)handleOpenURLWithApplicationSourceAndAnnotation:(NSNotification *)notification
{
// override to handle urls sent to your app
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.m
similarity index 77%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.m
index 930aeaba7..d79e8bda7 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVPluginResult.m
@@ -17,7 +17,7 @@
under the License.
*/
-#import "CDVPluginResult.h"
+#import <Cordova/CDVPluginResult.h>
#import "CDVJSON_private.h"
#import "CDVDebug.h"
@@ -25,6 +25,7 @@
// using CDVCommandStatus as ObjC-style constants rather than as Swift enum
// values.
// These constants alias the enum values back to their previous names.
+// TODO: Remove in Cordova iOS 9
#define SWIFT_ENUM_COMPAT_HACK(enumVal) const CDVCommandStatus SWIFT_##enumVal NS_SWIFT_NAME(enumVal) = enumVal
SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_NO_RESULT);
SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_OK);
@@ -40,7 +41,7 @@ SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ERROR);
@interface CDVPluginResult ()
-- (CDVPluginResult*)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)theMessage;
+- (instancetype)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)theMessage;
@end
@@ -94,12 +95,12 @@ id messageFromMultipart(NSArray* theMessages)
nil];
}
-- (CDVPluginResult*)init
+- (instancetype)init
{
return [self initWithStatus:CDVCommandStatus_NO_RESULT message:nil];
}
-- (CDVPluginResult*)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)theMessage
+- (instancetype)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)theMessage
{
self = [super init];
if (self) {
@@ -110,62 +111,62 @@ id messageFromMultipart(NSArray* theMessages)
return self;
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal
{
return [[self alloc] initWithStatus:statusOrdinal message:nil];
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsString:(NSString*)theMessage
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsString:(NSString *)theMessage
{
return [[self alloc] initWithStatus:statusOrdinal message:theMessage];
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArray:(NSArray*)theMessage
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArray:(NSArray *)theMessage
{
return [[self alloc] initWithStatus:statusOrdinal message:theMessage];
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsInt:(int)theMessage
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsInt:(int)theMessage
{
return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithInt:theMessage]];
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSInteger:(NSInteger)theMessage
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSInteger:(NSInteger)theMessage
{
return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithInteger:theMessage]];
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSUInteger:(NSUInteger)theMessage
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSUInteger:(NSUInteger)theMessage
{
return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithUnsignedInteger:theMessage]];
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDouble:(double)theMessage
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDouble:(double)theMessage
{
return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithDouble:theMessage]];
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsBool:(BOOL)theMessage
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsBool:(BOOL)theMessage
{
return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithBool:theMessage]];
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary*)theMessage
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary *)theMessage
{
return [[self alloc] initWithStatus:statusOrdinal message:theMessage];
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArrayBuffer:(NSData*)theMessage
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArrayBuffer:(NSData *)theMessage
{
return [[self alloc] initWithStatus:statusOrdinal message:messageFromArrayBuffer(theMessage)];
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsMultipart:(NSArray*)theMessages
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsMultipart:(NSArray *)theMessages
{
return [[self alloc] initWithStatus:statusOrdinal message:messageFromMultipart(theMessages)];
}
-+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageToErrorObject:(int)errorCode
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageToErrorObject:(int)errorCode
{
NSDictionary* errDict = @{@"code" :[NSNumber numberWithInt:errorCode]};
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSceneDelegate.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSceneDelegate.m
new file mode 100644
index 000000000..7492ca1aa
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSceneDelegate.m
@@ -0,0 +1,50 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+#import <Cordova/CDVSceneDelegate.h>
+#import <Cordova/CDVPluginNotifications.h>
+
+@implementation CDVSceneDelegate
+
+- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions
+{
+ // If the app was launched from a URL, that should also fire the CDVPluginOpenURLNotification
+ [self scene:scene openURLContexts:connectionOptions.URLContexts];
+}
+
+- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts
+{
+ for (UIOpenURLContext *context in URLContexts) {
+ NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
+ [options setValue:context.options.sourceApplication forKey:@"sourceApplication"];
+ [options setValue:context.options.annotation forKey:@"annotation"];
+ [options setValue:@(context.options.openInPlace) forKey:@"openInPlace"];
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500
+ if (@available(iOS 14.5, *)) {
+ [options setValue:context.options.eventAttribution forKey:@"eventAttribution"];
+ }
+#endif
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:CDVPluginHandleOpenURLNotification object:context.URL userInfo:options];
+
+ }
+}
+
+@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSettingsDictionary.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSettingsDictionary.m
new file mode 100644
index 000000000..0c9e5059e
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVSettingsDictionary.m
@@ -0,0 +1,159 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+#import <Cordova/CDVSettingsDictionary.h>
+
+@interface CDVSettingsDictionary () {
+ // Ideally this should not be mutable, but we've got legacy API that allows
+ // plugins to set values in here, so this is the world we have to live in
+ NSMutableDictionary *_dict;
+}
+@end
+
+@implementation CDVSettingsDictionary
+
+- (instancetype)init
+{
+ return [self initWithDictionary:@{}];
+}
+
+- (instancetype)initWithDictionary:(NSDictionary *)dict
+{
+ self = [super init];
+ if (self != nil) {
+ if ([dict isKindOfClass:[NSMutableDictionary class]]) {
+ _dict = (NSMutableDictionary *)dict;
+ } else {
+ _dict = [NSMutableDictionary dictionaryWithDictionary:dict];
+ }
+ }
+ return self;
+}
+
+- (instancetype)initWithObjects:(const id _Nonnull [ _Nullable ])objects forKeys:(const id <NSCopying> _Nonnull [ _Nullable ])keys count:(NSUInteger)cnt
+{
+ self = [self init];
+ if (self != nil) {
+ _dict = [NSMutableDictionary dictionaryWithObjects:objects forKeys:keys count:cnt];
+ }
+ return self;
+}
+
+- (instancetype)initWithCoder:(NSCoder *)coder
+{
+ NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCoder:coder];
+
+ if (dict != nil) {
+ self = [self initWithDictionary:dict];
+ } else {
+ self = [self initWithDictionary:@{}];
+ }
+ return self;
+}
+
++ (BOOL)supportsSecureCoding
+{
+ return YES;
+}
+
+- (Class)classForCoder
+{
+ return [self class];
+}
+
+- (id)forwardingTargetForSelector:(SEL)selector
+{
+ return _dict;
+}
+
+- (NSUInteger)count
+{
+ return _dict.count;
+}
+
+- (id)objectForKey:(NSString *)key
+{
+ return [_dict objectForKey:[key lowercaseString]];
+}
+
+- (NSEnumerator *)keyEnumerator
+{
+ return [_dict keyEnumerator];
+}
+
+- (id)cordovaSettingForKey:(NSString *)key
+{
+ return [self objectForKey:key];
+}
+
+- (BOOL)cordovaBoolSettingForKey:(NSString *)key defaultValue:(BOOL)defaultValue
+{
+ BOOL value = defaultValue;
+
+ id prefObj = [self objectForKey:key];
+ if (prefObj == nil) {
+#ifdef DEBUG
+ NSLog(@"The preference key \"%@\" is not defined and will default to \"%@\"", key, (defaultValue ? @"TRUE" : @"FALSE"));
+#endif
+ return value;
+ }
+
+ if ([prefObj isKindOfClass:NSString.class]) {
+ prefObj = [prefObj lowercaseString];
+
+ if ([prefObj isEqualToString:@"true"] || [prefObj isEqualToString:@"1"] || [prefObj isEqualToString:@"yes"]) {
+ return YES;
+ } else if ([prefObj isEqualToString:@"false"] || [prefObj isEqualToString:@"0"] || [prefObj isEqualToString:@"no"]) {
+ return NO;
+ }
+ } else if ([prefObj isKindOfClass:NSNumber.class] && ([prefObj isEqual:@YES] || [prefObj isEqual:@NO])) {
+ return [prefObj isEqual:@YES];
+ }
+
+ return value;
+}
+
+- (CGFloat)cordovaFloatSettingForKey:(NSString *)key defaultValue:(CGFloat)defaultValue
+{
+ CGFloat value = defaultValue;
+
+ id prefObj = [self objectForKey:key];
+ if (prefObj != nil) {
+ value = [prefObj floatValue];
+ }
+
+ return value;
+}
+
+- (void)setObject:(id)value forKey:(NSString *)key
+{
+ [_dict setObject:value forKey:[key lowercaseString]];
+}
+
+- (void)setObject:(id)value forKeyedSubscript:(NSString *)key
+{
+ [_dict setObject:value forKey:[key lowercaseString]];
+}
+
+- (void)setCordovaSetting:(id)value forKey:(NSString *)key
+{
+ [self setObject:value forKey:key];
+}
+
+@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVTimer.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVTimer.m
similarity index 98%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVTimer.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVTimer.m
index 784e94d38..1d62f9520 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVTimer.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVTimer.m
@@ -17,7 +17,7 @@
under the License.
*/
-#import "CDVTimer.h"
+#import <Cordova/CDVTimer.h>
#pragma mark CDVTimerItem
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVViewController.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVViewController.m
new file mode 100644
index 000000000..886f9b001
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVViewController.m
@@ -0,0 +1,895 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <TargetConditionals.h>
+#import <AVFoundation/AVFoundation.h>
+#import <Foundation/Foundation.h>
+#import <WebKit/WebKit.h>
+
+#import <Cordova/CDVAppDelegate.h>
+#import <Cordova/CDVPlugin.h>
+#import "CDVPlugin+Private.h"
+#import <Cordova/CDVConfigParser.h>
+#import <Cordova/CDVSettingsDictionary.h>
+#import <Cordova/CDVTimer.h>
+#import "CDVCommandDelegateImpl.h"
+
+static UIColor *defaultBackgroundColor(void) {
+ return UIColor.systemBackgroundColor;
+}
+
+@interface CDVViewController () <CDVWebViewEngineConfigurationDelegate, UIScrollViewDelegate> {
+ id <CDVWebViewEngineProtocol> _webViewEngine;
+ id <CDVCommandDelegate> _commandDelegate;
+ NSMutableDictionary<NSString *, CDVPlugin *> *_pluginObjects;
+ NSMutableDictionary<NSString *, NSString *> *_pluginsMap;
+ CDVCommandQueue* _commandQueue;
+ UIColor *_backgroundColor;
+ UIColor *_splashBackgroundColor;
+ UIColor *_statusBarBackgroundColor;
+ UIColor *_statusBarWebViewColor;
+ UIColor *_statusBarDefaultColor;
+ CDVSettingsDictionary* _settings;
+}
+
+@property (nonatomic, readwrite, strong) NSMutableArray* startupPluginNames;
+@property (nonatomic, readwrite, strong) UIView *launchView;
+@property (nonatomic, readwrite, strong) UIView *statusBar;
+@property (readwrite, assign) BOOL initialized;
+
+@end
+
+@implementation CDVViewController
+
+@synthesize pluginObjects = _pluginObjects;
+@synthesize pluginsMap = _pluginsMap;
+@synthesize commandDelegate = _commandDelegate;
+@synthesize commandQueue = _commandQueue;
+@synthesize webViewEngine = _webViewEngine;
+@synthesize backgroundColor = _backgroundColor;
+@synthesize splashBackgroundColor = _splashBackgroundColor;
+@synthesize statusBarBackgroundColor = _statusBarBackgroundColor;
+@synthesize settings = _settings;
+@dynamic webView;
+@dynamic enumerablePlugins;
+
+#pragma mark - Initializers
+
+- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self != nil) {
+ [self _cdv_init];
+ }
+ return self;
+}
+
+- (instancetype)initWithCoder:(NSCoder *)aDecoder
+{
+ self = [super initWithCoder:aDecoder];
+ if (self != nil) {
+ [self _cdv_init];
+ }
+ return self;
+}
+
+- (instancetype)init
+{
+ self = [super init];
+ if (self != nil) {
+ [self _cdv_init];
+ }
+ return self;
+}
+
+- (void)_cdv_init
+{
+ if (!self.initialized) {
+ _commandQueue = [[CDVCommandQueue alloc] initWithViewController:self];
+ _commandDelegate = [[CDVCommandDelegateImpl alloc] initWithViewController:self];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillTerminate:)
+ name:UIApplicationWillTerminateNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillResignActive:)
+ name:UIApplicationWillResignActiveNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidBecomeActive:)
+ name:UIApplicationDidBecomeActiveNotification object:nil];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppWillEnterForeground:)
+ name:UIApplicationWillEnterForegroundNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppDidEnterBackground:)
+ name:UIApplicationDidEnterBackgroundNotification object:nil];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onWebViewPageDidLoad:)
+ name:CDVPageDidLoadNotification object:nil];
+
+ // Default property values
+ self.configFile = @"config.xml";
+ self.webContentFolderName = @"www";
+ self.showInitialSplashScreen = YES;
+
+ // Initialize the plugin objects dict.
+ _pluginObjects = [[NSMutableDictionary alloc] initWithCapacity:20];
+
+ // Prevent reinitializing
+ self.initialized = YES;
+ }
+}
+
+#pragma mark -
+
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [_commandQueue dispose];
+
+ [self.webViewEngine loadHTMLString:@"about:blank" baseURL:nil];
+
+ @synchronized(_pluginObjects) {
+ [[_pluginObjects allValues] makeObjectsPerformSelector:@selector(dispose)];
+ [_pluginObjects removeAllObjects];
+ }
+
+ [self.webView removeFromSuperview];
+ [self.launchView removeFromSuperview];
+
+ _webViewEngine = nil;
+}
+
+#pragma mark - Getters & Setters
+
+- (NSArray <CDVPlugin *> *)enumerablePlugins
+{
+ @synchronized(_pluginObjects) {
+ return [_pluginObjects allValues];
+ }
+}
+
+- (NSString *)wwwFolderName
+{
+ return self.webContentFolderName;
+}
+
+- (void)setWwwFolderName:(NSString *)name
+{
+ self.webContentFolderName = name;
+}
+
+- (void)setBackgroundColor:(UIColor *)color
+{
+ _backgroundColor = color ?: defaultBackgroundColor();
+
+ [self.webView setBackgroundColor:self.backgroundColor];
+}
+
+- (void)setSplashBackgroundColor:(UIColor *)color
+{
+ _splashBackgroundColor = color ?: self.backgroundColor;
+
+ [self.launchView setBackgroundColor:self.splashBackgroundColor];
+}
+
+- (UIColor *)statusBarBackgroundColor
+{
+ // If a status bar background color has been explicitly set using the JS API, we always use that.
+ // Otherwise, if the webview reports a themeColor meta tag (iOS 15.4+) we use that.
+ // Otherwise, we use the status bar background color provided in IB (from config.xml).
+ // Otherwise, we use the background color.
+ return _statusBarBackgroundColor ?: _statusBarWebViewColor ?: _statusBarDefaultColor ?: self.backgroundColor;
+}
+
+- (void)setStatusBarBackgroundColor:(UIColor *)color
+{
+ // We want the initial value from IB to set the statusBarDefaultColor and
+ // then all future changes to set the statusBarBackgroundColor.
+ //
+ // The reason for this is that statusBarBackgroundColor is treated like a
+ // forced override when it is set, and we don't want that for the initial
+ // value from config.xml set via IB.
+
+ if (!_statusBarBackgroundColor && !_statusBarWebViewColor && !_statusBarDefaultColor) {
+ _statusBarDefaultColor = color;
+ } else {
+ _statusBarBackgroundColor = color;
+ }
+
+ [self.statusBar setBackgroundColor:self.statusBarBackgroundColor];
+}
+
+- (void)setStatusBarWebViewColor:(UIColor *)color
+{
+ _statusBarWebViewColor = color;
+
+ [self.statusBar setBackgroundColor:self.statusBarBackgroundColor];
+}
+
+// Only for testing
+- (void)setSettings:(CDVSettingsDictionary *)settings
+{
+ _settings = settings;
+}
+
+- (nullable NSURL *)configFilePath
+{
+ NSString* path = self.configFile;
+
+ // if path is relative, resolve it against the main bundle
+ if (![path isAbsolutePath]) {
+ NSString* absolutePath = [[NSBundle mainBundle] pathForResource:path ofType:nil];
+ if(!absolutePath){
+ NSAssert(NO, @"ERROR: %@ not found in the main bundle!", path);
+ }
+ path = absolutePath;
+ }
+
+ // Assert file exists
+ if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
+ NSAssert(NO, @"ERROR: %@ does not exist.", path);
+ return nil;
+ }
+
+ return [NSURL fileURLWithPath:path];
+}
+
+- (NSURL *)appUrl
+{
+ NSURL* appURL = nil;
+
+ if ([self.startPage rangeOfString:@"://"].location != NSNotFound) {
+ appURL = [NSURL URLWithString:self.startPage];
+ } else if ([self.webContentFolderName rangeOfString:@"://"].location != NSNotFound) {
+ appURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", self.webContentFolderName, self.startPage]];
+ } else if([self.webContentFolderName rangeOfString:@".bundle"].location != NSNotFound){
+ // www folder is actually a bundle
+ NSBundle* bundle = [NSBundle bundleWithPath:self.webContentFolderName];
+ appURL = [bundle URLForResource:self.startPage withExtension:nil];
+ } else if([self.webContentFolderName rangeOfString:@".framework"].location != NSNotFound){
+ // www folder is actually a framework
+ NSBundle* bundle = [NSBundle bundleWithPath:self.webContentFolderName];
+ appURL = [bundle URLForResource:self.startPage withExtension:nil];
+ } else {
+ // CB-3005 strip parameters from start page to check if page exists in resources
+ NSURL* startURL = [NSURL URLWithString:self.startPage];
+ NSString* startFilePath = [self.commandDelegate pathForResource:[startURL path]];
+
+ if (startFilePath == nil) {
+ appURL = nil;
+ } else {
+ appURL = [NSURL fileURLWithPath:startFilePath];
+ // CB-3005 Add on the query params or fragment.
+ NSString* startPageNoParentDirs = self.startPage;
+ NSRange r = [startPageNoParentDirs rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"?#"] options:0];
+ if (r.location != NSNotFound) {
+ NSString* queryAndOrFragment = [self.startPage substringFromIndex:r.location];
+ appURL = [NSURL URLWithString:queryAndOrFragment relativeToURL:appURL];
+ }
+ }
+ }
+
+ return appURL;
+}
+
+- (nullable NSURL *)errorURL
+{
+ NSString *setting = [self.settings cordovaSettingForKey:@"ErrorUrl"];
+ if (setting == nil) {
+ return nil;
+ }
+
+ if ([setting rangeOfString:@"://"].location != NSNotFound) {
+ return [NSURL URLWithString:setting];
+ } else {
+ NSURL *url = [NSURL URLWithString:setting];
+ NSString *errorFilePath = [self.commandDelegate pathForResource:[url path]];
+ if (errorFilePath) {
+ return [NSURL fileURLWithPath:errorFilePath];
+ }
+ }
+
+ return nil;
+}
+
+- (nullable UIView *)webView
+{
+ if (_webViewEngine != nil) {
+ return _webViewEngine.engineWebView;
+ }
+
+ return nil;
+}
+
+- (nullable NSString *)appURLScheme
+{
+ NSString* URLScheme = nil;
+
+ NSArray* URLTypes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleURLTypes"];
+
+ if (URLTypes != nil) {
+ NSDictionary* dict = [URLTypes objectAtIndex:0];
+ if (dict != nil) {
+ NSArray* URLSchemes = [dict objectForKey:@"CFBundleURLSchemes"];
+ if (URLSchemes != nil) {
+ URLScheme = [URLSchemes objectAtIndex:0];
+ }
+ }
+ }
+
+ return URLScheme;
+}
+
+#pragma mark - UIViewController & App Lifecycle
+
+// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ // TODO: Remove in Cordova iOS 9
+ if ([UIApplication.sharedApplication.delegate isKindOfClass:[CDVAppDelegate class]]) {
+ CDVAppDelegate *appDelegate = (CDVAppDelegate *)UIApplication.sharedApplication.delegate;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ if (appDelegate.viewController == nil) {
+ appDelegate.viewController = self;
+ }
+#pragma clang diagnostic pop
+ }
+
+ // Load settings
+ [self loadSettings];
+
+ // Instantiate the Launch screen
+ if (!self.launchView) {
+ [self createLaunchView];
+ }
+
+ // Instantiate the WebView
+ if (!self.webView) {
+ [self createGapView];
+ }
+
+ // Instantiate the status bar
+ if (!self.statusBar) {
+ [self createStatusBarView];
+ }
+
+ // /////////////////
+
+ if ([self.startupPluginNames count] > 0) {
+ [CDVTimer start:@"TotalPluginStartup"];
+
+ for (NSString* pluginName in self.startupPluginNames) {
+ [CDVTimer start:pluginName];
+ [self getCommandInstance:pluginName];
+ [CDVTimer stop:pluginName];
+ }
+
+ [CDVTimer stop:@"TotalPluginStartup"];
+ }
+
+ [self loadStartPage];
+
+ [self.webView setBackgroundColor:self.backgroundColor];
+ [self.launchView setBackgroundColor:self.splashBackgroundColor];
+ [self.statusBar setBackgroundColor:self.statusBarBackgroundColor];
+
+ if (self.showInitialSplashScreen) {
+ [self.launchView setAlpha:1];
+ }
+}
+
+-(void)viewWillAppear:(BOOL)animated
+{
+ [super viewWillAppear:animated];
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillAppearNotification object:nil]];
+}
+
+-(void)viewDidAppear:(BOOL)animated
+{
+ [super viewDidAppear:animated];
+
+#if TARGET_OS_MACCATALYST
+ BOOL hideTitlebar = [self.settings cordovaBoolSettingForKey:@"HideDesktopTitlebar" defaultValue:NO];
+ if (hideTitlebar) {
+ UIWindowScene *scene = self.view.window.windowScene;
+ if (scene) {
+ scene.titlebar.titleVisibility = UITitlebarTitleVisibilityHidden;
+ scene.titlebar.toolbar = nil;
+ }
+ } else {
+ // We need to fix the web content going behind the title bar
+ self.webView.translatesAutoresizingMaskIntoConstraints = NO;
+ [self.webView.topAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor].active = YES;
+ [self.webView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor].active = YES;
+ [self.webView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor].active = YES;
+ [self.webView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor].active = YES;
+
+ if ([self.webView respondsToSelector:@selector(scrollView)]) {
+ UIScrollView *scrollView = [self.webView performSelector:@selector(scrollView)];
+ scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
+ }
+ }
+#endif
+
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidAppearNotification object:nil]];
+}
+
+-(void)viewWillDisappear:(BOOL)animated
+{
+ [super viewWillDisappear:animated];
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillDisappearNotification object:nil]];
+}
+
+-(void)viewDidDisappear:(BOOL)animated
+{
+ [super viewDidDisappear:animated];
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidDisappearNotification object:nil]];
+}
+
+-(void)viewWillLayoutSubviews
+{
+ [super viewWillLayoutSubviews];
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillLayoutSubviewsNotification object:nil]];
+}
+
+-(void)viewDidLayoutSubviews
+{
+ [super viewDidLayoutSubviews];
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewDidLayoutSubviewsNotification object:nil]];
+}
+
+-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator
+{
+ [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
+ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillTransitionToSizeNotification object:[NSValue valueWithCGSize:size]]];
+}
+
+/*
+ This method lets your application know that it is about to be terminated and purged from memory entirely
+ */
+- (void)onAppWillTerminate:(NSNotification *)notification
+{
+ // empty the tmp directory
+ NSFileManager* fileMgr = [[NSFileManager alloc] init];
+ NSError* __autoreleasing err = nil;
+
+ // clear contents of NSTemporaryDirectory
+ NSString* tempDirectoryPath = NSTemporaryDirectory();
+ NSDirectoryEnumerator* directoryEnumerator = [fileMgr enumeratorAtPath:tempDirectoryPath];
+ NSString* fileName = nil;
+ BOOL result;
+
+ while ((fileName = [directoryEnumerator nextObject])) {
+ NSString* filePath = [tempDirectoryPath stringByAppendingPathComponent:fileName];
+ result = [fileMgr removeItemAtPath:filePath error:&err];
+ if (!result && err) {
+ NSLog(@"Failed to delete: %@ (error: %@)", filePath, err);
+ }
+ }
+}
+
+/*
+ This method is called to let your application know that it is about to move from the active to inactive state.
+ You should use this method to pause ongoing tasks, disable timer, ...
+ */
+- (void)onAppWillResignActive:(NSNotification *)notification
+{
+ [self checkAndReinitViewUrl];
+ // NSLog(@"%@",@"applicationWillResignActive");
+ [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('resign');" scheduledOnRunLoop:NO];
+}
+
+/*
+ In iOS 4.0 and later, this method is called instead of the applicationWillTerminate: method
+ when the user quits an application that supports background execution.
+ */
+- (void)onAppDidEnterBackground:(NSNotification *)notification
+{
+ [self checkAndReinitViewUrl];
+ // NSLog(@"%@",@"applicationDidEnterBackground");
+ [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('pause', null, true);" scheduledOnRunLoop:NO];
+}
+
+/*
+ In iOS 4.0 and later, this method is called as part of the transition from the background to the inactive state.
+ You can use this method to undo many of the changes you made to your application upon entering the background.
+ invariably followed by applicationDidBecomeActive
+ */
+- (void)onAppWillEnterForeground:(NSNotification *)notification
+{
+ [self checkAndReinitViewUrl];
+ // NSLog(@"%@",@"applicationWillEnterForeground");
+ [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('resume');"];
+}
+
+// This method is called to let your application know that it moved from the inactive to active state.
+- (void)onAppDidBecomeActive:(NSNotification *)notification
+{
+ [self checkAndReinitViewUrl];
+ // NSLog(@"%@",@"applicationDidBecomeActive");
+ [self.commandDelegate evalJs:@"cordova.fireDocumentEvent('active');"];
+}
+
+- (void)didReceiveMemoryWarning
+{
+ BOOL doPurge = YES;
+
+ // iterate through all the plugin objects, and call hasPendingOperation
+ // if at least one has a pending operation, we don't call [super didReceiveMemoryWarning]
+ for (CDVPlugin *plugin in self.enumerablePlugins) {
+ if (plugin.hasPendingOperation) {
+ NSLog(@"Plugin '%@' has a pending operation, memory purge is delayed for didReceiveMemoryWarning.", NSStringFromClass([plugin class]));
+ doPurge = NO;
+ }
+ }
+
+ if (doPurge) {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+ }
+
+ // Release any cached data, images, etc. that aren't in use.
+}
+
+/**
+ Show the webview and fade out the intermediary view
+ This is to prevent the flashing of the mainViewController
+ */
+- (void)onWebViewPageDidLoad:(NSNotification*)notification
+{
+ self.webView.hidden = NO;
+
+ if ([self.webView respondsToSelector:@selector(scrollView)]) {
+ UIScrollView *scrollView = [self.webView performSelector:@selector(scrollView)];
+ [self scrollViewDidChangeAdjustedContentInset:scrollView];
+ }
+
+ if ([self.settings cordovaBoolSettingForKey:@"AutoHideSplashScreen" defaultValue:YES]) {
+ CGFloat splashScreenDelaySetting = [self.settings cordovaFloatSettingForKey:@"SplashScreenDelay" defaultValue:0];
+
+ if (splashScreenDelaySetting == 0) {
+ [self showSplashScreen:NO];
+ } else {
+ // Divide by 1000 because config returns milliseconds and NSTimer takes seconds
+ CGFloat splashScreenDelay = splashScreenDelaySetting / 1000;
+
+ [NSTimer scheduledTimerWithTimeInterval:splashScreenDelay repeats:NO block:^(NSTimer * _Nonnull timer) {
+ [self showSplashScreen:NO];
+ }];
+ }
+ }
+}
+
+- (void)scrollViewDidChangeAdjustedContentInset:(UIScrollView *)scrollView
+{
+ if (self.webView.hidden) {
+ self.statusBar.hidden = true;
+ return;
+ }
+
+ self.statusBar.hidden = (scrollView.contentInsetAdjustmentBehavior == UIScrollViewContentInsetAdjustmentNever);
+}
+
+- (BOOL)prefersStatusBarHidden
+{
+ // The CDVStatusBar plugin overrides this in a category extension, and
+ // should bypass this implementation entirely
+ return self.statusBar.alpha < 0.0001f;
+}
+
+#pragma mark - View Setup
+
+- (void)loadSettings
+{
+ CDVConfigParser *parser = [CDVConfigParser parseConfigFile:self.configFilePath];
+
+ // Get the plugin dictionary, allowList and settings from the delegate.
+ _pluginsMap = parser.pluginsDict;
+ self.startupPluginNames = parser.startupPluginNames;
+ self.settings = [[CDVSettingsDictionary alloc] initWithDictionary:parser.settings];
+
+ // And the start page
+ if(parser.startPage && self.startPage == nil){
+ self.startPage = parser.startPage;
+ }
+ if (self.startPage == nil) {
+ self.startPage = @"index.html";
+ }
+
+ self.appScheme = [self.settings cordovaSettingForKey:@"Scheme"] ?: @"app";
+}
+
+/// Retrieves the view from a newwly initialized webViewEngine
+/// @param bounds The bounds with which the webViewEngine will be initialized
+- (nonnull UIView*)newCordovaViewWithFrame:(CGRect)bounds
+{
+ NSString* defaultWebViewEngineClassName = [self.settings cordovaSettingForKey:@"CordovaDefaultWebViewEngine"];
+ NSString* webViewEngineClassName = [self.settings cordovaSettingForKey:@"CordovaWebViewEngine"];
+
+ if (!defaultWebViewEngineClassName) {
+ defaultWebViewEngineClassName = @"CDVWebViewEngine";
+ }
+ if (!webViewEngineClassName) {
+ webViewEngineClassName = defaultWebViewEngineClassName;
+ }
+
+ // Determine if a provided custom web view engine is sufficient
+ id <CDVWebViewEngineProtocol> engine;
+ Class customWebViewEngineClass = NSClassFromString(webViewEngineClassName);
+ if (customWebViewEngineClass) {
+ id customWebViewEngine = [self initWebViewEngine:customWebViewEngineClass bounds:bounds];
+ BOOL customConformsToProtocol = [customWebViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)];
+ BOOL customCanLoad = [customWebViewEngine canLoadRequest:[NSURLRequest requestWithURL:self.appUrl]];
+ if (customConformsToProtocol && customCanLoad) {
+ engine = customWebViewEngine;
+ }
+ }
+
+ // Otherwise use the default web view engine
+ if (!engine) {
+ Class defaultWebViewEngineClass = NSClassFromString(defaultWebViewEngineClassName);
+ id defaultWebViewEngine = [self initWebViewEngine:defaultWebViewEngineClass bounds:bounds];
+ NSAssert([defaultWebViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)],
+ @"we expected the default web view engine to conform to the CDVWebViewEngineProtocol");
+ engine = defaultWebViewEngine;
+ }
+
+ if ([engine isKindOfClass:[CDVPlugin class]]) {
+ [self registerPlugin:(CDVPlugin*)engine withClassName:webViewEngineClassName];
+ }
+
+ _webViewEngine = engine;
+ return _webViewEngine.engineWebView;
+}
+
+/// Initialiizes the webViewEngine, with config, if supported and provided
+/// @param engineClass A class that must conform to the `CDVWebViewEngineProtocol`
+/// @param bounds with which the webview will be initialized
+- (id _Nullable) initWebViewEngine:(nonnull Class)engineClass bounds:(CGRect)bounds {
+ WKWebViewConfiguration *config = [self respondsToSelector:@selector(configuration)] ? [self configuration] : nil;
+ if (config && [engineClass instancesRespondToSelector:@selector(initWithFrame:configuration:)]) {
+ return [[engineClass alloc] initWithFrame:bounds configuration:config];
+ } else {
+ return [[engineClass alloc] initWithFrame:bounds];
+ }
+}
+
+- (void)createLaunchView
+{
+ CGRect webViewBounds = self.view.bounds;
+ webViewBounds.origin = self.view.bounds.origin;
+
+ UIView* view = [[UIView alloc] initWithFrame:webViewBounds];
+ view.translatesAutoresizingMaskIntoConstraints = NO;
+ [view setAlpha:0];
+
+ NSString* launchStoryboardName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
+ if (launchStoryboardName != nil) {
+ UIStoryboard* storyboard = [UIStoryboard storyboardWithName:launchStoryboardName bundle:[NSBundle mainBundle]];
+ UIViewController* vc = [storyboard instantiateInitialViewController];
+ [self addChildViewController:vc];
+
+ UIView* imgView = vc.view;
+ imgView.translatesAutoresizingMaskIntoConstraints = NO;
+ [view addSubview:imgView];
+
+ [NSLayoutConstraint activateConstraints:@[
+ [NSLayoutConstraint constraintWithItem:imgView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeWidth multiplier:1 constant:0],
+ [NSLayoutConstraint constraintWithItem:imgView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeHeight multiplier:1 constant:0],
+ [NSLayoutConstraint constraintWithItem:imgView attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterY multiplier:1 constant:0],
+ [NSLayoutConstraint constraintWithItem:imgView attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:view attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]
+ ]];
+ }
+
+ self.launchView = view;
+ [self.view addSubview:view];
+
+ [NSLayoutConstraint activateConstraints:@[
+ [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeWidth multiplier:1 constant:0],
+ [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeHeight multiplier:1 constant:0],
+ [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterY multiplier:1 constant:0],
+ [NSLayoutConstraint constraintWithItem:view attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]
+ ]];
+}
+
+- (void)createGapView
+{
+ CGRect webViewBounds = self.view.bounds;
+ webViewBounds.origin = self.view.bounds.origin;
+
+ UIView* view = [self newCordovaViewWithFrame:webViewBounds];
+ view.hidden = YES;
+ view.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
+
+ [self.view addSubview:view];
+ [self.view sendSubviewToBack:view];
+
+ if ([self.webView respondsToSelector:@selector(scrollView)]) {
+ UIScrollView *scrollView = [self.webView performSelector:@selector(scrollView)];
+ scrollView.delegate = self;
+ }
+}
+
+- (void)createStatusBarView
+{
+ // If cordova-plugin-statusbar is loaded, we'll let it handle the status
+ // bar to avoid introducing conflict
+ if (NSClassFromString(@"CDVStatusBar") != nil)
+ return;
+
+ self.statusBar = [[UIView alloc] init];
+ self.statusBar.translatesAutoresizingMaskIntoConstraints = NO;
+
+ [self.view addSubview:self.statusBar];
+
+ [self.statusBar.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor].active = YES;
+ [self.statusBar.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor].active = YES;
+ [self.statusBar.topAnchor constraintEqualToAnchor:self.view.topAnchor].active = YES;
+ [self.statusBar.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor].active = YES;
+
+ self.statusBar.hidden = YES;
+}
+
+- (void)loadStartPage
+{
+ NSURL *appURL = [self appUrl];
+
+ if (appURL) {
+ NSURLRequest *appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
+ [_webViewEngine loadRequest:appReq];
+ } else {
+ NSString *loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.webContentFolderName, self.startPage];
+ NSLog(@"%@", loadErr);
+
+ NSURL *errorUrl = [self errorURL];
+ if (errorUrl) {
+ errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [loadErr stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl];
+ NSLog(@"%@", [errorUrl absoluteString]);
+ [_webViewEngine loadRequest:[NSURLRequest requestWithURL:errorUrl]];
+ } else {
+ NSString *html = [NSString stringWithFormat:@"<html><body> %@ </body></html>", loadErr];
+ [_webViewEngine loadHTMLString:html baseURL:nil];
+ }
+ }
+}
+
+#pragma mark CordovaCommands
+
+- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className
+{
+ plugin.viewController = self;
+ plugin.commandDelegate = _commandDelegate;
+
+ @synchronized(_pluginObjects) {
+ [_pluginObjects setObject:plugin forKey:className];
+ }
+ [plugin pluginInitialize];
+}
+
+- (void)registerPlugin:(CDVPlugin*)plugin withPluginName:(NSString*)pluginName
+{
+ plugin.viewController = self;
+ plugin.commandDelegate = _commandDelegate;
+
+ NSString* className = NSStringFromClass([plugin class]);
+
+ @synchronized(_pluginObjects) {
+ [_pluginObjects setObject:plugin forKey:className];
+ }
+ [_pluginsMap setValue:className forKey:[pluginName lowercaseString]];
+ [plugin pluginInitialize];
+}
+
+/**
+ Returns an instance of a CordovaCommand object, based on its name. If one exists already, it is returned.
+ */
+- (nullable CDVPlugin *)getCommandInstance:(NSString *)pluginName
+{
+ // first, we try to find the pluginName in the pluginsMap
+ // (acts as a allowList as well) if it does not exist, we return nil
+ // NOTE: plugin names are matched as lowercase to avoid problems - however, a
+ // possible issue is there can be duplicates possible if you had:
+ // "org.apache.cordova.Foo" and "org.apache.cordova.foo" - only the lower-cased entry will match
+ NSString* className = [_pluginsMap objectForKey:[pluginName lowercaseString]];
+
+ if (className == nil) {
+ return nil;
+ }
+
+ id obj = nil;
+ @synchronized(_pluginObjects) {
+ obj = [_pluginObjects objectForKey:className];
+ }
+
+ if (!obj) {
+ obj = [[NSClassFromString(className) alloc] initWithWebViewEngine:_webViewEngine];
+ if (!obj) {
+ NSString* fullClassName = [NSString stringWithFormat:@"%@.%@",
+ NSBundle.mainBundle.infoDictionary[@"CFBundleExecutable"],
+ className];
+ obj = [[NSClassFromString(fullClassName)alloc] initWithWebViewEngine:_webViewEngine];
+ }
+
+ if (obj != nil) {
+ [self registerPlugin:obj withClassName:className];
+ } else {
+ NSLog(@"CDVPlugin class %@ (pluginName: %@) does not exist.", className, pluginName);
+ }
+ }
+ return obj;
+}
+
+#pragma mark -
+
+- (bool)isUrlEmpty:(NSURL *)url
+{
+ if (!url || (url == (id) [NSNull null])) {
+ return true;
+ }
+ NSString *urlAsString = [url absoluteString];
+ return (urlAsString == (id) [NSNull null] || [urlAsString length]==0 || [urlAsString isEqualToString:@"about:blank"]);
+}
+
+- (bool)checkAndReinitViewUrl
+{
+ NSURL* appURL = [self appUrl];
+ if ([self isUrlEmpty: [_webViewEngine URL]] && ![self isUrlEmpty: appURL]) {
+ [self loadStartPage];
+ return true;
+ }
+ return false;
+}
+
+#pragma mark - API Methods for Plugins
+
+- (void)showLaunchScreen:(BOOL)visible
+{
+ [self showSplashScreen:visible];
+}
+
+- (void)showSplashScreen:(BOOL)visible
+{
+ CGFloat fadeSplashScreenDuration = [self.settings cordovaFloatSettingForKey:@"FadeSplashScreenDuration" defaultValue:250.f];
+
+ // Setting minimum value for fade to 0.25 seconds
+ fadeSplashScreenDuration = fadeSplashScreenDuration < 250 ? 250 : fadeSplashScreenDuration;
+
+ // AnimateWithDuration takes seconds but cordova documentation specifies milliseconds
+ CGFloat fadeDuration = fadeSplashScreenDuration/1000;
+
+ [UIView animateWithDuration:fadeDuration animations:^{
+ [self.launchView setAlpha:(visible ? 1 : 0)];
+
+ if (!visible) {
+ [self.webView becomeFirstResponder];
+ }
+ }];
+}
+
+- (void)showStatusBar:(BOOL)visible
+{
+ [self.statusBar setAlpha:(visible ? 1 : 0)];
+ [self setNeedsStatusBarAppearanceUpdate];
+}
+
+- (void)parseSettingsWithParser:(id <NSXMLParserDelegate>)delegate
+{
+ [CDVConfigParser parseConfigFile:self.configFilePath withDelegate:delegate];
+}
+
+@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.m
similarity index 84%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.m
index 577624e0f..b4107e64f 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.m
@@ -17,9 +17,12 @@
under the License.
*/
-#import <Foundation/Foundation.h>
#import <WebKit/WebKit.h>
-#import "CDVWebViewProcessPoolFactory.h"
+#import <Cordova/CDVWebViewProcessPoolFactory.h>
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#pragma clang diagnostic ignored "-Wdeprecated-implementations"
static CDVWebViewProcessPoolFactory *factory = nil;
@@ -47,3 +50,5 @@ static CDVWebViewProcessPoolFactory *factory = nil;
return _sharedPool;
}
@end
+
+#pragma clang diagnostic pop
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m
similarity index 94%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m
index 1266ba20f..c508e8417 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.m
@@ -17,9 +17,12 @@
under the License.
*/
-#import "NSDictionary+CordovaPreferences.h"
#import <Foundation/Foundation.h>
+#define __CORDOVA_SILENCE_HEADER_DEPRECATIONS
+#import <Cordova/NSDictionary+CordovaPreferences.h>
+#undef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
+
@implementation NSDictionary (CordovaPreferences)
- (id)cordovaSettingForKey:(NSString*)key
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m
similarity index 96%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m
index 2b3acdc0f..65b97a0e7 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.m
@@ -17,7 +17,7 @@
under the License.
*/
-#import "NSMutableArray+QueueAdditions.h"
+#import <Cordova/NSMutableArray+QueueAdditions.h>
@implementation NSMutableArray (QueueAdditions)
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/CordovaLib.md b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/CordovaLib.md
new file mode 100644
index 000000000..eaf8a5648
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/CordovaLib.md
@@ -0,0 +1,83 @@
+# ``Cordova``
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+-->
+
+Build your app using web technologies
+
+## Overview
+
+For more information about Apache Cordova, visit [https://cordova.apache.org](https://cordova.apache.org).
+
+## Topics
+
+### Using Cordova in your app
+
+- ``CDVAppDelegate``
+- ``CDVSceneDelegate``
+- ``CDVViewController``
+
+### Cordova plugins
+
+- ``CDVPlugin``
+
+### Plugin communication
+
+- ``CDVPluginResult``
+- ``CDVCommandStatus``
+- ``CDVInvokedUrlCommand``
+
+### Plugin Protocols
+
+- ``CDVPluginAuthenticationHandler``
+- ``CDVPluginNavigationHandler``
+- ``CDVPluginSchemeHandler``
+
+### Web View plugins
+
+- ``CDVWebViewEngineProtocol``
+- ``CDVWebViewEngineConfigurationDelegate``
+
+### Utilities
+
+- ``CDVSettingsDictionary``
+- ``CDVCommandDelegate``
+- ``CDVCommandQueue``
+- ``CDVConfigParser``
+- ``CDVTimer``
+
+### Upgrade Guides
+- <doc:upgrading-8>
+
+### Deprecated
+
+- ``IsAtLeastiOSVersion``
+- ``CDVScreenOrientationDelegate``
+- ``CDVWebViewProcessPoolFactory``
+- ``CDVCommandStatus_NO_RESULT`` <!-- Swift alias -->
+- ``CDVCommandStatus_OK`` <!-- Swift alias -->
+- ``CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION`` <!-- Swift alias -->
+- ``CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION`` <!-- Swift alias -->
+- ``CDVCommandStatus_INSTANTIATION_EXCEPTION`` <!-- Swift alias -->
+- ``CDVCommandStatus_MALFORMED_URL_EXCEPTION`` <!-- Swift alias -->
+- ``CDVCommandStatus_IO_EXCEPTION`` <!-- Swift alias -->
+- ``CDVCommandStatus_INVALID_ACTION`` <!-- Swift alias -->
+- ``CDVCommandStatus_JSON_EXCEPTION`` <!-- Swift alias -->
+- ``CDVCommandStatus_ERROR`` <!-- Swift alias -->
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/upgrading-8.md b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/upgrading-8.md
new file mode 100644
index 000000000..a17529054
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.docc/upgrading-8.md
@@ -0,0 +1,349 @@
+# Upgrading Plugins to Cordova iOS 8.x
+<!--
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+-->
+
+A guide for plugin authors to understand the API changes in Cordova iOS 8.
+
+Cordova iOS 8 introduces some significant changes to the exposed API for plugin authors and framework consumers. Many of these changes have been made to better align the framework with modern iOS development practices, such as adopting the `UIScene` APIs and fixing conflicts with SwiftUI projects, as well as work to improve the API experience for apps that consume Cordova as a framework (sometimes called the "platform centric workflow"). In all cases, great care has been taken to try to minimize the risk of breakage to existing 3rd party plugins.
+
+Many plugins will notice new deprecation warnings when built against Cordova iOS 8, rather than outright breaking changes. This document aims to explain the changes, the rationale behind the changes, and offer sample code for plugin authors to ensure their plugin code is compatible with future versions of Cordova iOS.
+
+In cases where different behavior is required for different Cordova versions, the ``CORDOVA_VERSION_MIN_REQUIRED`` macro can be used in Objective-C code to test the current Cordova version:
+
+```objc
+#if defined(__CORDOVA_8_0_0) && CORDOVA_VERSION_MIN_REQUIRED >= __CORDOVA_8_0_0
+ // Code for Cordova iOS 8 goes here
+#else
+ // Code for older versions goes here
+#endif
+```
+
+## Major Breaking Changes
+### Minimum iOS version update
+The Cordova iOS framework has increased the minimum supported iOS version from 11.0 to 13.0.
+
+The minimum supported Xcode version for the Cordova tooling and generated template app is now Xcode 15.
+
+### Change to the generated app project naming
+
+The generated app template is now consistently named "App", including "App.xcodeproj", and "App.xcworkspace". The Xcode build target for the app is also named "App". If you are expecting the name of the Xcode project or target to match the name specified in config.xml, it will now fail to find the project.
+
+Use the cordova-ios nodeJS API to retrieve the Xcode project path and other project details:
+
+```js
+// Old code
+const projectRoot = context.opts.projectRoot;
+const platformPath = path.join(projectRoot, 'platforms', 'ios');
+
+const config = getConfigParser(context, path.join(projectRoot, 'config.xml'));
+const projectName = config.name();
+
+const pbxprojPath = path.join(platformPath, `${projectName}.xcodeproj`, 'project.pbxproj');
+const xcodeProject = xcode.project(pbxprojPath);
+```
+
+```js
+// New code
+const projectRoot = context.opts.projectRoot;
+const platformPath = path.join(projectRoot, 'platforms', 'ios');
+
+const cordova_ios = require('cordova-ios');
+const iosProject = new cordova_ios('ios', platformPath);
+
+const xcodeProject = xcode.project(iosProject.locations.pbxproj);
+```
+
+This updated pattern is backwards compatible with existing versions of Cordova iOS 5.0.0 and newer.
+
+Moving to a consistent name for the Xcode project and target resolves a number of issues around dynamic file lookups, Xcode projects with multiple targets, and Unicode compatibility with other tools such as CocoaPods that have issues with non-ASCII project names. Beyond fixing those issues, it was never actually safe to use the `name` from config.xml directly, because even in previous versions of Cordova iOS the project name could be normalized to remove Unicode characters.
+
+Using the cordova-ios JavaScript API ensures that plugins and the Cordova tooling treat projects the same way. The `locations` object contains properties for several useful paths:
+
+* `root` - The platform root directory
+* `www` - The platform's generated web content folder
+* `pbxproj` - The Xcode project file (the project.pbxproj file)
+* `xcodeProjDir` - The Xcode project path (the .xcodeproj directory)
+* `xcodeCordovaProj` - The platform folder containing the Cordova iOS app code
+
+You can find the app's Info.plist file in a backwards-compatible way by doing something like this:
+
+```javascript
+const projName = path.basename(iosProject.locations.xcodeCordovaProj);
+const infoPlistPath = path.join(iosProject.locations.xcodeCordovaProj, `${projName}-Info.plist`);
+```
+
+### CDVAppDelegate window deprecation
+
+The generated app template now uses the iOS scene API (using `UISceneDelegate`) to support multiple windows, which means that it's no longer a safe assumption that an app has only a single window.
+
+The ``CDVAppDelegate/window`` property of ``CDVAppDelegate`` is deprecated as a result. This property will always have a `nil` value.
+
+In a plugin class, you should retrieve the `UIWindow` for the current view controller:
+
+```objc
+// Old code
+CDVAppDelegate *delegate = (CDVAppDelegate *)[[UIApplication sharedApplication] delegate];
+UIWindow *currentWindow = delegate.window;
+```
+
+```objc
+// New code
+UIWindow *currentWindow = self.viewController.view.window;
+```
+
+There may be other cases where things that previously assumed a single window (such as `UIScreen` bounds) require updating to support iOS scenes.
+
+### CDVAppDelegate viewController deprecation
+
+The ``CDVAppDelegate/viewController`` property of ``CDVAppDelegate`` is deprecated, and may return `nil` if a `CDVViewController` has not yet been initialized.
+
+Plugins should prefer accessing the view controller using their ``CDVPlugin/viewController`` property (which is now typed as ``CDVViewController``).
+
+### UIView scrollView property deprecation
+
+The `scrollView` property added as a global category extension to `UIView` by Cordova is now deprecated in Objective C code and **removed entirely in Swift code**. This is to prevent conflicts with other Swift classes that extend `UIView` and have their own `scrollView` properties. You can read more about the scrollView property in the Cordova discussion [Cordova iOS 8.x Upgrade Guide: UIView scrollView property deprecation](https://github.com/apache/cordova/discussions/565#discussioncomment-14621123).
+
+You can still access the `scrollView` property of the web view by dynamically invoking the method:
+
+```objc
+// Old code
+UIScrollView *scrollView = self.webView.scrollView;
+```
+
+```objc
+// New code (Objective-C)
+if ([self.webView respondsToSelector:@selector(scrollView)]) {
+ UIScrollView *scrollView = [self.webView performSelector:@selector(scrollView)];
+}
+```
+
+```swift
+// New code (Swift)
+var scroller : UIScrollView?
+let scrollViewSelector = NSSelectorFromString("scrollView")
+
+if webView.responds(to: scrollViewSelector) {
+ scroller = webView.perform(scrollViewSelector)?.takeUnretainedValue() as? UIScrollView
+}
+```
+
+This updated code is compatible with existing versions of Cordova iOS.
+
+### Precompiled prefix header removal
+
+Previously, Cordova projects included a precompiled prefix header that automatically imported the `Foundation` and `UIKit` frameworks. This made these frameworks available globally, without requiring explicit imports in each Objective-C file.
+
+While this may have offered convenience, it also introduced an implicit dependency on the Cordova-managed prefix header and prefix headers have gradually been replaced with module imports in Objective-C and were never supported in Swift.
+
+To align with Xcode defaults and improve long-term maintainability, the precompiled prefix header has been removed from generated Cordova app projects. While this may be a breaking change for some plugins, developers are now expected to explicitly declare the frameworks their code depends on by adding the appropriate import statements directly in their source files.
+
+```objc
+// New code (Objective-C)
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+```
+
+```swift
+// New code (Swift)
+import Foundation
+import UIKit
+```
+
+### `CDVPluginResult` Swift optionality
+
+The `CDVPluginResult` constructors have been annotated as returning a non-null object, which means the constructor in Swift no longer returns an optional value that needs to be unwrapped. However, this means that attempts to unwrap the value will now be errors.
+
+In most cases, you shouldn't need to worry about the optionality of the result before passing it to `commandDelegate.send` but if you are setting other options then you might need to explicitly store as an optional for backwards compatibility:
+
+```swift
+// Old code (Swift)
+let result = CDVPluginResult(status: .ok, messageAs: "some value")!
+result.setKeepCallbackAs(true)
+self.commandDelegate.send(result, callbackId: callback)
+```
+
+```swift
+// New code (Swift)
+let result: CDVPluginResult? = CDVPluginResult(status: .ok, messageAs: "some value")
+result?.setKeepCallbackAs(true)
+self.commandDelegate.send(result, callbackId: callback)
+```
+
+## Other Major Changes
+### Deprecating AppDelegate category extensions
+
+Please extend the ``CDVAppDelegate`` base class instead:
+
+```objc
+// Old code
+#import "AppDelegate.h"
+
+@interface AppDelegate (myplugin)
+ // Added extension methods here
+@end
+```
+
+```objc
+// New code
+#import <Cordova/CDVAppDelegate.h>
+
+@interface CDVAppDelegate (myplugin)
+ // Added extension methods here
+@end
+```
+
+It was never a completely safe assumption that an app using Cordova would include a class named `AppDelegate` that was a subclass of `CDVAppDelegate` due to the ability to embed CordovaLib in an existing iOS app project as a library. If your plugin needs to add behaviour to the app delegate, it should do so to the ``CDVAppDelegate`` base class.
+
+The updated code is backwards compatible with several existing Cordova iOS versions.
+
+### Deprecating MainViewController category extensions
+
+Please extend the ``CDVViewController`` base class instead:
+
+```objc
+// Old code
+#import "MainViewController.h"
+
+@interface MainViewController (myplugin)
+ // Added extension methods here
+@end
+```
+
+```objc
+// New code
+#import <Cordova/CDVViewController.h>
+
+@interface CDVViewController (myplugin)
+ // Added extension methods here
+@end
+```
+
+It was never a completely safe assumption that an app using Cordova would include a class named `MainViewController` that was a subclass of `CDVViewController` due to the ability to embed CordovaLib in an existing iOS app project as a library. If your plugin needs to add behaviour to the Cordova view controller, it should do so to the ``CDVViewController`` base class.
+
+This updated code is backwards compatible with several existing Cordova iOS versions.
+
+### Deprecating CDVCommandStatus constants in Swift
+
+For plugins written in Swift, the old `CDVCommandStatus_*` constants are deprecated in favour of the enum based aliases:
+
+```swift
+// Old code
+self.commandDelegate.send(CDVPluginResult(status: CDVCommandStatus_OK), callbackId: command.callbackId);
+```
+
+```swift
+// New code
+self.commandDelegate.send(CDVPluginResult(status: .ok), callbackId: command.callbackId);
+```
+
+These aliases were introduced in and are backwards compatible with all existing versions since Cordova iOS 5.0.0. See ``CDVCommandStatus`` for a list of the enum values.
+
+### Deprecating CDVWebViewProcessPoolFactory
+
+Apple has deprecated the `WKProcessPool` API, saying that it has no effect in iOS 15 and newer. As such, the `CDVWebViewProcessPoolFactory` API is marked as deprecated, but still exists to support iOS 13 and 14.
+
+The `CDVWebViewProcessPoolFactory` API was also problematic because it exposed WebKit-specific API types to the public API interface of Cordova, potentially causing issues if those APIs need to change in the future. With this deprecation and eventual removal, Cordova is better insulated from upstream WebView changes.
+
+## Public API Removals
+The following classes were previously exposed as part of the Cordova iOS public API, but were only used as internal implementation details. To better establish the public/private API boundary within Cordova iOS, they have been removed from the public API in Cordova iOS 8.
+
+* `CDVAllowList`
+* `CDVURLSchemeHandler`
+
+The following headers are deprecated due to adding global category extensions to system classes and will be removed in a future version of Cordova iOS:
+
+* `<Cordova/NSDictionary+CordovaPreferences.h>`
+ Use the new ``CDVSettingsDictionary`` class, which provides all the same methods.
+
+* `<Cordova/NSMutableArray+QueueAdditions.h>`
+ This was only ever intended as an internal implementation detail.
+
+* `<Cordova/CDV.h>`
+ Use `<Cordova/Cordova.h>` instead.
+
+## Other Changes
+* ``CDVCommandDelegate``
+ * The ``CDVCommandDelegate/urlTransformer`` property is deprecated.
+ This property was never used, and does not need to be a required part of the protocol.
+
+ * The ``CDVCommandDelegate/settings`` property is now typed as ``CDVSettingsDictionary``.
+
+* ``CDVConfigParser``
+ * Added a ``CDVConfigParser/parseConfigFile:`` class method.
+
+ * Added a ``CDVConfigParser/parseConfigFile:withDelegate:`` class method.
+
+* ``CDVPlugin``
+ * The ``CDVPlugin/viewController`` property is now typed as ``CDVViewController``.
+ Previously this was typed as the more generic `UIViewController`.
+
+ * Plugin classes that intend to override WebKit scheme handling should implement the ``CDVPluginSchemeHandler`` protocol to ensure compliance with the required methods.
+
+ * The ``CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification`` notification is now deprecated.
+ The existing ``CDVPluginHandleOpenURLNotification`` notification now includes the source and annotation in its `userInfo` dictionary.
+
+* ``CDVPluginAuthenticationHandler``
+ * Newly added protocol for plugins wishing to handle server authentication requests.
+
+* ``CDVPluginNavigationHandler``
+ * Newly added protocol for plugins wishing to handle navigation request permitting or denying within the webview.
+
+* ``CDVPluginSchemeHandler``
+ * Newly added protocol for plugins wishing to override WebKit scheme handling for web requests.
+
+* ``CDVScreenOrientationDelegate``
+ * This protocol is now deprecated and no longer used.
+
+* ``CDVSettingsDictionary``
+ * Newly added class to provide `NSDictionary`-like access to config.xml preferences, without relying on global category extensions to `NSDictionary`.
+
+* ``CDVViewController``
+ * The ``CDVViewController/settings`` property is now typed as ``CDVSettingsDictionary``.
+
+ * The ``CDVViewController/wwwFolderName`` property is deprecated.
+ This property has been renamed to ``CDVViewController/webContentFolderName``.
+
+ * The ``CDVViewController/appURLScheme`` property is deprecated.
+ This property was not used internally by Cordova iOS and should not be used by plugins.
+
+ * The ``CDVViewController/pluginsMap`` and ``CDVViewController/pluginObjects`` properties are deprecated.
+ These were internal implementation details that should not have been exposed.
+
+ * Added an ``CDVViewController/enumerablePlugins`` property that can safely be iterated to loop over all loaded plugins.
+
+ * The ``CDVViewController/configParser`` property is deprecated due to not being used.
+
+ * The ``CDVViewController/parseSettingsWithParser:`` method is deprecated.
+ Use the ``CDVConfigParser/parseConfigFile:withDelegate:`` class method on ``CDVConfigParser`` instead.
+
+ * Added a new ``CDVViewController/showInitialSplashScreen`` property.
+ This property is inspectable in Interface Builder for embedding apps to indicate if the splash screen should be displayed during web content loading.
+
+ * Added a new ``CDVViewController/backgroundColor`` property.
+ This property is inspectable in Interface Builder for embedding apps to set the view controller background color.
+
+ * Added a new ``CDVViewController/splashBackgroundColor`` property.
+ This property is inspectable in Interface Builder for embedding apps to set the splash screen background color.
+
+ * The ``CDVViewController/showLaunchScreen:`` method is deprecated.
+ This method has been renamed to ``CDVViewController/showSplashScreen:``.
+
+ * Added a new ``CDVViewController/loadStartPage`` method to load the initial starting page in the web view, replacing any existing content.
diff --git a/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
similarity index 78%
rename from cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
index f0958e478..47c5a5ca6 100644
--- a/cordova/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@ -1,35 +1,50 @@
// !$*UTF8*$!
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
{
archiveVersion = 1;
classes = {
};
- objectVersion = 52;
+ objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BFF9121F355A4E00DDF01A /* CDVLogger.h */; };
28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 28BFF9131F355A4E00DDF01A /* CDVLogger.m */; };
- 2F4D42BC23F218BA00501999 /* CDVURLSchemeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F4D42BA23F218BA00501999 /* CDVURLSchemeHandler.h */; };
- 2F4D42BD23F218BA00501999 /* CDVURLSchemeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F4D42BB23F218BA00501999 /* CDVURLSchemeHandler.m */; };
2FCCEA17247E7366007276A8 /* CDVLaunchScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */; };
2FCCEA18247E7366007276A8 /* CDVLaunchScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */; };
3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; };
3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; };
4E23F8FB23E16E96006CD852 /* CDVWebViewProcessPoolFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */; };
- 4E23F8FC23E16E96006CD852 /* CDVWebViewUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4E23F8FC23E16E96006CD852 /* CDVWebViewUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */; };
4E23F8FD23E16E96006CD852 /* CDVWebViewUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */; };
4E23F8FE23E16E96006CD852 /* CDVWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */; };
4E23F8FF23E16E96006CD852 /* CDVWebViewProcessPoolFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */; settings = {ATTRIBUTES = (Public, ); }; };
4E23F90023E16E96006CD852 /* CDVWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */; };
- 4E23F90323E17FFA006CD852 /* CDVWebViewUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4E23F90323E17FFA006CD852 /* CDVWebViewUIDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */; };
4E714D3623F535B500A321AF /* CDVLaunchScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */; };
4E714D3823F535B500A321AF /* CDVLaunchScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */; };
4F56D82D254A2EB50063F1D6 /* CDVWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */; };
4F56D830254A2ED70063F1D6 /* CDVWebViewUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */; };
4F56D833254A2ED90063F1D6 /* CDVWebViewProcessPoolFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */; };
4F56D836254A2EE10063F1D6 /* CDVWebViewEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */; };
- 4F56D839254A2EE40063F1D6 /* CDVWebViewProcessPoolFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */; };
- 4F56D83C254A2F2F0063F1D6 /* CDVURLSchemeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F4D42BB23F218BA00501999 /* CDVURLSchemeHandler.m */; };
+ 4F56D839254A2EE40063F1D6 /* CDVWebViewProcessPoolFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */; settings = {ATTRIBUTES = (Public, ); }; };
7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; };
7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; };
7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; };
@@ -42,7 +57,7 @@
7ED95D381AB9029B008C4574 /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D121AB9029B008C4574 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D391AB9029B008C4574 /* CDVAvailabilityDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */; };
7ED95D3C1AB9029B008C4574 /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */; };
7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D3E1AB9029B008C4574 /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */; };
@@ -62,12 +77,32 @@
7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; };
7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D531AB9029B008C4574 /* CDVWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 7ED95D541AB9029B008C4574 /* CDVWhitelist.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */; };
7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; };
7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */; };
+ 90227B4C2D499A1B005DB74E /* CDVViewController+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 90227B4B2D499A1B005DB74E /* CDVViewController+Private.h */; };
+ 90227B4D2D499A1B005DB74E /* CDVViewController+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 90227B4B2D499A1B005DB74E /* CDVViewController+Private.h */; };
+ 90227B512D49A042005DB74E /* CDVStatusBarInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 90227B4E2D49A042005DB74E /* CDVStatusBarInternal.h */; };
+ 90227B522D49A042005DB74E /* CDVStatusBarInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 90227B4F2D49A042005DB74E /* CDVStatusBarInternal.m */; };
+ 90227B532D49A042005DB74E /* CDVStatusBarInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 90227B4E2D49A042005DB74E /* CDVStatusBarInternal.h */; };
+ 90227B542D49A042005DB74E /* CDVStatusBarInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 90227B4F2D49A042005DB74E /* CDVStatusBarInternal.m */; };
+ 902B30742C6C5A7E00C6804C /* CordovaLib.docc in Sources */ = {isa = PBXBuildFile; fileRef = 902B30732C6C5A7E00C6804C /* CordovaLib.docc */; };
+ 902B30752C6C5A7E00C6804C /* CordovaLib.docc in Sources */ = {isa = PBXBuildFile; fileRef = 902B30732C6C5A7E00C6804C /* CordovaLib.docc */; };
+ 9036843D2C6EB06500A3338C /* CDVAllowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9036843B2C6EB06500A3338C /* CDVAllowList.h */; };
+ 9036843E2C6EB06500A3338C /* CDVAllowList.m in Sources */ = {isa = PBXBuildFile; fileRef = 9036843C2C6EB06500A3338C /* CDVAllowList.m */; };
+ 9036843F2C6EB06500A3338C /* CDVAllowList.m in Sources */ = {isa = PBXBuildFile; fileRef = 9036843C2C6EB06500A3338C /* CDVAllowList.m */; };
+ 903684402C6EB06500A3338C /* CDVAllowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9036843B2C6EB06500A3338C /* CDVAllowList.h */; };
+ 9044ED4C2E67F80E003B58ED /* CDVSceneDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9044ED4B2E67F80E003B58ED /* CDVSceneDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9044ED4D2E67F80E003B58ED /* CDVSceneDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 9044ED4B2E67F80E003B58ED /* CDVSceneDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9044ED4F2E67F821003B58ED /* CDVSceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9044ED4E2E67F821003B58ED /* CDVSceneDelegate.m */; };
+ 9044ED502E67F821003B58ED /* CDVSceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9044ED4E2E67F821003B58ED /* CDVSceneDelegate.m */; };
+ 9044ED532E67FEBB003B58ED /* CDVPluginNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 9044ED522E67FEBB003B58ED /* CDVPluginNotifications.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9044ED542E67FEBB003B58ED /* CDVPluginNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 9044ED522E67FEBB003B58ED /* CDVPluginNotifications.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9047732F2C7A57E900373636 /* CDVURLSchemeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9047732D2C7A57E900373636 /* CDVURLSchemeHandler.h */; };
+ 904773302C7A57E900373636 /* CDVURLSchemeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9047732E2C7A57E900373636 /* CDVURLSchemeHandler.m */; };
+ 904773312C7A57E900373636 /* CDVURLSchemeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9047732D2C7A57E900373636 /* CDVURLSchemeHandler.h */; };
+ 904773322C7A57E900373636 /* CDVURLSchemeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 9047732E2C7A57E900373636 /* CDVURLSchemeHandler.m */; };
9052DE712150D040008E83D4 /* CDVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */; };
9052DE722150D040008E83D4 /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */; };
9052DE732150D040008E83D4 /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */; };
@@ -78,7 +113,6 @@
9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */; };
9052DE792150D040008E83D4 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; };
9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */; };
- 9052DE7D2150D040008E83D4 /* CDVWhitelist.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */; };
9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */; };
9052DE7F2150D040008E83D4 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */; };
9052DE802150D040008E83D4 /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */; };
@@ -93,6 +127,12 @@
9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; };
9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */; };
9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */; };
+ 9068B5332C6DFE2000B13532 /* CDVSettingsDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 9068B5322C6DFE2000B13532 /* CDVSettingsDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9068B5342C6DFE2000B13532 /* CDVSettingsDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 9068B5322C6DFE2000B13532 /* CDVSettingsDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9068B5362C6E007400B13532 /* CDVSettingsDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 9068B5352C6E007400B13532 /* CDVSettingsDictionary.m */; };
+ 9068B5372C6E007400B13532 /* CDVSettingsDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 9068B5352C6E007400B13532 /* CDVSettingsDictionary.m */; };
+ 90B382512AEB72DD00F3F4D7 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 902D0BC12AEB64EB009C68E5 /* PrivacyInfo.xcprivacy */; };
+ 90DE61742B8F11D300810C2E /* Cordova.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C01EB41E3911D50056E6CB /* Cordova.h */; settings = {ATTRIBUTES = (Public, ); }; };
A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; };
A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; };
C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C01EB41E3911D50056E6CB /* Cordova.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -101,7 +141,7 @@
C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D121AB9029B008C4574 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */; };
C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01EC31E39131A0056E6CB /* CDVInvokedUrlCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -112,7 +152,6 @@
C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; };
- C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
@@ -120,8 +159,6 @@
/* Begin PBXFileReference section */
28BFF9121F355A4E00DDF01A /* CDVLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLogger.h; sourceTree = "<group>"; };
28BFF9131F355A4E00DDF01A /* CDVLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLogger.m; sourceTree = "<group>"; };
- 2F4D42BA23F218BA00501999 /* CDVURLSchemeHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVURLSchemeHandler.h; sourceTree = "<group>"; };
- 2F4D42BB23F218BA00501999 /* CDVURLSchemeHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVURLSchemeHandler.m; sourceTree = "<group>"; };
3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVIntentAndNavigationFilter.h; sourceTree = "<group>"; };
3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVIntentAndNavigationFilter.m; sourceTree = "<group>"; };
4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewProcessPoolFactory.m; sourceTree = "<group>"; };
@@ -165,15 +202,26 @@
7ED95D2A1AB9029B008C4574 /* CDVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVViewController.h; sourceTree = "<group>"; };
7ED95D2B1AB9029B008C4574 /* CDVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVViewController.m; sourceTree = "<group>"; };
7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewEngineProtocol.h; sourceTree = "<group>"; };
- 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWhitelist.h; sourceTree = "<group>"; };
- 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWhitelist.m; sourceTree = "<group>"; };
7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+CordovaPreferences.h"; sourceTree = "<group>"; };
7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+CordovaPreferences.m"; sourceTree = "<group>"; };
7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+QueueAdditions.h"; sourceTree = "<group>"; };
7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+QueueAdditions.m"; sourceTree = "<group>"; };
+ 90227B4B2D499A1B005DB74E /* CDVViewController+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CDVViewController+Private.h"; sourceTree = "<group>"; };
+ 90227B4E2D49A042005DB74E /* CDVStatusBarInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVStatusBarInternal.h; sourceTree = "<group>"; };
+ 90227B4F2D49A042005DB74E /* CDVStatusBarInternal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVStatusBarInternal.m; sourceTree = "<group>"; };
+ 902B30732C6C5A7E00C6804C /* CordovaLib.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = CordovaLib.docc; sourceTree = "<group>"; };
+ 902D0BC12AEB64EB009C68E5 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
+ 9036843B2C6EB06500A3338C /* CDVAllowList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVAllowList.h; sourceTree = "<group>"; };
+ 9036843C2C6EB06500A3338C /* CDVAllowList.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVAllowList.m; sourceTree = "<group>"; };
+ 9044ED4B2E67F80E003B58ED /* CDVSceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVSceneDelegate.h; sourceTree = "<group>"; };
+ 9044ED4E2E67F821003B58ED /* CDVSceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVSceneDelegate.m; sourceTree = "<group>"; };
+ 9044ED522E67FEBB003B58ED /* CDVPluginNotifications.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVPluginNotifications.h; sourceTree = "<group>"; };
+ 9047732D2C7A57E900373636 /* CDVURLSchemeHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVURLSchemeHandler.h; sourceTree = "<group>"; };
+ 9047732E2C7A57E900373636 /* CDVURLSchemeHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVURLSchemeHandler.m; sourceTree = "<group>"; };
+ 9068B5322C6DFE2000B13532 /* CDVSettingsDictionary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CDVSettingsDictionary.h; sourceTree = "<group>"; };
+ 9068B5352C6E007400B13532 /* CDVSettingsDictionary.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CDVSettingsDictionary.m; sourceTree = "<group>"; };
A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVGestureHandler.h; sourceTree = "<group>"; };
A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVGestureHandler.m; sourceTree = "<group>"; };
- AA747D9E0F9514B9006C5449 /* CordovaLib_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CordovaLib_Prefix.pch; sourceTree = SOURCE_ROOT; };
C0C01EB21E3911D50056E6CB /* Cordova.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cordova.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C0C01EB41E3911D50056E6CB /* Cordova.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Cordova.h; sourceTree = "<group>"; };
C0C01EB51E3911D50056E6CB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -209,9 +257,12 @@
0867D691FE84028FC02AAC07 = {
isa = PBXGroup;
children = (
+ 902B30732C6C5A7E00C6804C /* CordovaLib.docc */,
+ 9064EF5E26FAB74200C9D65B /* include */,
7ED95D0E1AB9029B008C4574 /* Public */,
7ED95CF11AB9028C008C4574 /* Private */,
- C0C01EB31E3911D50056E6CB /* Cordova */,
+ C0C01EB51E3911D50056E6CB /* Info.plist */,
+ 902D0BC12AEB64EB009C68E5 /* PrivacyInfo.xcprivacy */,
034768DFFF38A50411DB9C8B /* Products */,
);
sourceTree = "<group>";
@@ -228,6 +279,8 @@
3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */ = {
isa = PBXGroup;
children = (
+ 9036843B2C6EB06500A3338C /* CDVAllowList.h */,
+ 9036843C2C6EB06500A3338C /* CDVAllowList.m */,
3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */,
3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */,
);
@@ -237,6 +290,8 @@
4E23F8F423E16D30006CD852 /* CDVWebViewEngine */ = {
isa = PBXGroup;
children = (
+ 9047732D2C7A57E900373636 /* CDVURLSchemeHandler.h */,
+ 9047732E2C7A57E900373636 /* CDVURLSchemeHandler.m */,
4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */,
4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */,
4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */,
@@ -257,11 +312,13 @@
7ED95CF11AB9028C008C4574 /* Private */ = {
isa = PBXGroup;
children = (
- AA747D9E0F9514B9006C5449 /* CordovaLib_Prefix.pch */,
+ 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */,
+ 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */,
7ED95CF21AB9028C008C4574 /* CDVDebug.h */,
7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */,
7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */,
7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */,
+ 90227B4B2D499A1B005DB74E /* CDVViewController+Private.h */,
7ED95CF61AB9028C008C4574 /* Plugins */,
);
name = Private;
@@ -271,6 +328,7 @@
7ED95CF61AB9028C008C4574 /* Plugins */ = {
isa = PBXGroup;
children = (
+ 90227B502D49A042005DB74E /* CDVStatusBarInternal */,
4E714D3123F5356700A321AF /* CDVLaunchScreen */,
4E23F8F423E16D30006CD852 /* CDVWebViewEngine */,
28BFF9111F355A1D00DDF01A /* CDVLogger */,
@@ -293,45 +351,69 @@
7ED95D0E1AB9029B008C4574 /* Public */ = {
isa = PBXGroup;
children = (
+ 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */,
+ 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */,
+ 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */,
+ 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */,
+ 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */,
+ 7ED95D201AB9029B008C4574 /* CDVPlugin.m */,
+ 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */,
+ 9044ED4E2E67F821003B58ED /* CDVSceneDelegate.m */,
+ 9068B5352C6E007400B13532 /* CDVSettingsDictionary.m */,
+ 7ED95D251AB9029B008C4574 /* CDVTimer.m */,
+ 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */,
+ 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */,
+ 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */,
+ 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */,
+ );
+ name = Public;
+ path = Classes/Public;
+ sourceTree = "<group>";
+ };
+ 90227B502D49A042005DB74E /* CDVStatusBarInternal */ = {
+ isa = PBXGroup;
+ children = (
+ 90227B4E2D49A042005DB74E /* CDVStatusBarInternal.h */,
+ 90227B4F2D49A042005DB74E /* CDVStatusBarInternal.m */,
+ );
+ path = CDVStatusBarInternal;
+ sourceTree = "<group>";
+ };
+ 9064EF5E26FAB74200C9D65B /* include */ = {
+ isa = PBXGroup;
+ children = (
+ 9064EF5F26FAB74800C9D65B /* Cordova */,
+ );
+ path = include;
+ sourceTree = "<group>";
+ };
+ 9064EF5F26FAB74800C9D65B /* Cordova */ = {
+ isa = PBXGroup;
+ children = (
+ C0C01EB41E3911D50056E6CB /* Cordova.h */,
7ED95D0F1AB9029B008C4574 /* CDV.h */,
7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */,
- 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */,
7ED95D121AB9029B008C4574 /* CDVAvailability.h */,
7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */,
7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */,
- 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */,
- 7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */,
7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */,
- 7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */,
7ED95D191AB9029B008C4574 /* CDVConfigParser.h */,
- 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */,
7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */,
- 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */,
7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */,
- 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */,
7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */,
- 7ED95D201AB9029B008C4574 /* CDVPlugin.m */,
+ 9044ED522E67FEBB003B58ED /* CDVPluginNotifications.h */,
7ED95D211AB9029B008C4574 /* CDVPluginResult.h */,
- 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */,
+ 9044ED4B2E67F80E003B58ED /* CDVSceneDelegate.h */,
7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */,
+ 9068B5322C6DFE2000B13532 /* CDVSettingsDictionary.h */,
7ED95D241AB9029B008C4574 /* CDVTimer.h */,
- 7ED95D251AB9029B008C4574 /* CDVTimer.m */,
7ED95D2A1AB9029B008C4574 /* CDVViewController.h */,
4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */,
- 4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */,
- 7ED95D2B1AB9029B008C4574 /* CDVViewController.m */,
7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */,
- 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */,
- 7ED95D2E1AB9029B008C4574 /* CDVWhitelist.m */,
7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */,
- 7ED95D321AB9029B008C4574 /* NSDictionary+CordovaPreferences.m */,
7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */,
- 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */,
- 2F4D42BA23F218BA00501999 /* CDVURLSchemeHandler.h */,
- 2F4D42BB23F218BA00501999 /* CDVURLSchemeHandler.m */,
);
- name = Public;
- path = Classes/Public;
+ path = Cordova;
sourceTree = "<group>";
};
A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */ = {
@@ -343,15 +425,6 @@
path = CDVGestureHandler;
sourceTree = "<group>";
};
- C0C01EB31E3911D50056E6CB /* Cordova */ = {
- isa = PBXGroup;
- children = (
- C0C01EB41E3911D50056E6CB /* Cordova.h */,
- C0C01EB51E3911D50056E6CB /* Info.plist */,
- );
- path = Cordova;
- sourceTree = "<group>";
- };
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
@@ -360,9 +433,13 @@
buildActionMask = 2147483647;
files = (
C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */,
+ 90227B4C2D499A1B005DB74E /* CDVViewController+Private.h in Headers */,
C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */,
C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */,
+ 9068B5332C6DFE2000B13532 /* CDVSettingsDictionary.h in Headers */,
+ 9044ED532E67FEBB003B58ED /* CDVPluginNotifications.h in Headers */,
C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */,
+ 9044ED4D2E67F80E003B58ED /* CDVSceneDelegate.h in Headers */,
C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */,
C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */,
C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */,
@@ -378,7 +455,6 @@
C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */,
C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */,
C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */,
- C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */,
C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */,
4E23F90323E17FFA006CD852 /* CDVWebViewUIDelegate.h in Headers */,
C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */,
@@ -387,8 +463,11 @@
9052DE8B2150D06B008E83D4 /* CDVPlugin+Private.h in Headers */,
9052DE8C2150D06B008E83D4 /* CDVLogger.h in Headers */,
9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */,
+ 903684402C6EB06500A3338C /* CDVAllowList.h in Headers */,
9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */,
9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */,
+ 9047732F2C7A57E900373636 /* CDVURLSchemeHandler.h in Headers */,
+ 90227B532D49A042005DB74E /* CDVStatusBarInternal.h in Headers */,
2FCCEA18247E7366007276A8 /* CDVLaunchScreen.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -398,18 +477,22 @@
buildActionMask = 2147483647;
files = (
7ED95D351AB9029B008C4574 /* CDV.h in Headers */,
+ 90227B4D2D499A1B005DB74E /* CDVViewController+Private.h in Headers */,
7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */,
7ED95D381AB9029B008C4574 /* CDVAvailability.h in Headers */,
+ 9068B5342C6DFE2000B13532 /* CDVSettingsDictionary.h in Headers */,
+ 9044ED542E67FEBB003B58ED /* CDVPluginNotifications.h in Headers */,
7ED95D391AB9029B008C4574 /* CDVAvailabilityDeprecated.h in Headers */,
+ 9044ED4C2E67F80E003B58ED /* CDVSceneDelegate.h in Headers */,
7ED95D3A1AB9029B008C4574 /* CDVCommandDelegate.h in Headers */,
7ED95D3B1AB9029B008C4574 /* CDVCommandDelegateImpl.h in Headers */,
7ED95D3D1AB9029B008C4574 /* CDVCommandQueue.h in Headers */,
4E23F8FF23E16E96006CD852 /* CDVWebViewProcessPoolFactory.h in Headers */,
7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */,
- 2F4D42BC23F218BA00501999 /* CDVURLSchemeHandler.h in Headers */,
7ED95D411AB9029B008C4574 /* CDVInvokedUrlCommand.h in Headers */,
7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */,
7ED95D451AB9029B008C4574 /* CDVPlugin.h in Headers */,
+ 90DE61742B8F11D300810C2E /* Cordova.h in Headers */,
7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */,
7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */,
4E23F8FC23E16E96006CD852 /* CDVWebViewUIDelegate.h in Headers */,
@@ -417,7 +500,6 @@
7ED95D501AB9029B008C4574 /* CDVViewController.h in Headers */,
7ED95D521AB9029B008C4574 /* CDVWebViewEngineProtocol.h in Headers */,
4E23F90023E16E96006CD852 /* CDVWebViewEngine.h in Headers */,
- 7ED95D531AB9029B008C4574 /* CDVWhitelist.h in Headers */,
7ED95D571AB9029B008C4574 /* NSDictionary+CordovaPreferences.h in Headers */,
7ED95D591AB9029B008C4574 /* NSMutableArray+QueueAdditions.h in Headers */,
7ED95D021AB9028C008C4574 /* CDVDebug.h in Headers */,
@@ -425,8 +507,11 @@
7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */,
28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */,
A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */,
+ 9036843D2C6EB06500A3338C /* CDVAllowList.h in Headers */,
3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */,
7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */,
+ 904773312C7A57E900373636 /* CDVURLSchemeHandler.h in Headers */,
+ 90227B512D49A042005DB74E /* CDVStatusBarInternal.h in Headers */,
4E714D3623F535B500A321AF /* CDVLaunchScreen.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -438,10 +523,10 @@
isa = PBXNativeTarget;
buildConfigurationList = C0C01EB91E3911D50056E6CB /* Build configuration list for PBXNativeTarget "Cordova" */;
buildPhases = (
+ C0C01EAF1E3911D50056E6CB /* Headers */,
C0C01EAD1E3911D50056E6CB /* Sources */,
C0C01EAE1E3911D50056E6CB /* Frameworks */,
- C0C01EAF1E3911D50056E6CB /* Headers */,
- CEDDBB5523948D4C00506451 /* ShellScript */,
+ 90B382502AEB72D300F3F4D7 /* Resources */,
);
buildRules = (
);
@@ -475,7 +560,8 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1010;
+ BuildIndependentTargetsInParallel = YES;
+ LastUpgradeCheck = 1540;
TargetAttributes = {
C0C01EB11E3911D50056E6CB = {
CreatedOnToolsVersion = 10.1;
@@ -506,50 +592,45 @@
};
/* End PBXProject section */
-/* Begin PBXShellScriptBuildPhase section */
- CEDDBB5523948D4C00506451 /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
+/* Begin PBXResourcesBuildPhase section */
+ 90B382502AEB72D300F3F4D7 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- );
- inputFileListPaths = (
- );
- inputPaths = (
- );
- outputFileListPaths = (
- );
- outputPaths = (
+ 90B382512AEB72DD00F3F4D7 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "\"${PROJECT_DIR}/../update_podspec.sh\" -s cordova\n";
};
-/* End PBXShellScriptBuildPhase section */
+/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
C0C01EAD1E3911D50056E6CB /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 90227B542D49A042005DB74E /* CDVStatusBarInternal.m in Sources */,
9052DE712150D040008E83D4 /* CDVAppDelegate.m in Sources */,
9052DE722150D040008E83D4 /* CDVCommandDelegateImpl.m in Sources */,
9052DE732150D040008E83D4 /* CDVCommandQueue.m in Sources */,
+ 902B30742C6C5A7E00C6804C /* CordovaLib.docc in Sources */,
9052DE742150D040008E83D4 /* CDVConfigParser.m in Sources */,
9052DE752150D040008E83D4 /* CDVInvokedUrlCommand.m in Sources */,
+ 9044ED502E67F821003B58ED /* CDVSceneDelegate.m in Sources */,
9052DE762150D040008E83D4 /* CDVPlugin+Resources.m in Sources */,
+ 9068B5362C6E007400B13532 /* CDVSettingsDictionary.m in Sources */,
9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */,
9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */,
+ 9036843F2C6EB06500A3338C /* CDVAllowList.m in Sources */,
4F56D830254A2ED70063F1D6 /* CDVWebViewUIDelegate.m in Sources */,
9052DE792150D040008E83D4 /* CDVTimer.m in Sources */,
4F56D833254A2ED90063F1D6 /* CDVWebViewProcessPoolFactory.m in Sources */,
4F56D82D254A2EB50063F1D6 /* CDVWebViewEngine.m in Sources */,
9052DE7C2150D040008E83D4 /* CDVViewController.m in Sources */,
- 4F56D83C254A2F2F0063F1D6 /* CDVURLSchemeHandler.m in Sources */,
- 9052DE7D2150D040008E83D4 /* CDVWhitelist.m in Sources */,
9052DE7E2150D040008E83D4 /* NSDictionary+CordovaPreferences.m in Sources */,
9052DE7F2150D040008E83D4 /* NSMutableArray+QueueAdditions.m in Sources */,
9052DE802150D040008E83D4 /* CDVJSON_private.m in Sources */,
9052DE812150D040008E83D4 /* CDVLogger.m in Sources */,
+ 904773302C7A57E900373636 /* CDVURLSchemeHandler.m in Sources */,
9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */,
9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */,
9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */,
@@ -561,25 +642,29 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 90227B522D49A042005DB74E /* CDVStatusBarInternal.m in Sources */,
7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */,
7ED95D3C1AB9029B008C4574 /* CDVCommandDelegateImpl.m in Sources */,
7ED95D3E1AB9029B008C4574 /* CDVCommandQueue.m in Sources */,
+ 902B30752C6C5A7E00C6804C /* CordovaLib.docc in Sources */,
7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */,
7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */,
+ 9044ED4F2E67F821003B58ED /* CDVSceneDelegate.m in Sources */,
7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */,
- 2F4D42BD23F218BA00501999 /* CDVURLSchemeHandler.m in Sources */,
+ 9068B5372C6E007400B13532 /* CDVSettingsDictionary.m in Sources */,
7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */,
+ 9036843E2C6EB06500A3338C /* CDVAllowList.m in Sources */,
7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */,
7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */,
4E23F8FE23E16E96006CD852 /* CDVWebViewEngine.m in Sources */,
4E23F8FB23E16E96006CD852 /* CDVWebViewProcessPoolFactory.m in Sources */,
7ED95D511AB9029B008C4574 /* CDVViewController.m in Sources */,
- 7ED95D541AB9029B008C4574 /* CDVWhitelist.m in Sources */,
7ED95D581AB9029B008C4574 /* NSDictionary+CordovaPreferences.m in Sources */,
7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */,
7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */,
4E23F8FD23E16E96006CD852 /* CDVWebViewUIDelegate.m in Sources */,
28BFF9151F355A4E00DDF01A /* CDVLogger.m in Sources */,
+ 904773322C7A57E900373636 /* CDVURLSchemeHandler.m in Sources */,
A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */,
3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */,
7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */,
@@ -593,16 +678,28 @@
1DEB921F08733DC00010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ENABLE_MODULE_VERIFIER = YES;
+ MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
+ MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
- TARGETED_DEVICE_FAMILY = "1,2";
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
+ SUPPORTS_MACCATALYST = YES;
+ TARGETED_DEVICE_FAMILY = "1,2,7";
+ XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Debug;
};
1DEB922008733DC00010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ENABLE_MODULE_VERIFIER = YES;
+ MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
+ MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
- TARGETED_DEVICE_FAMILY = "1,2";
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
+ SUPPORTS_MACCATALYST = YES;
+ TARGETED_DEVICE_FAMILY = "1,2,7";
+ XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Release;
};
@@ -610,6 +707,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -632,6 +730,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -641,14 +740,17 @@
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
+ DEFINES_MODULE = YES;
+ DOCC_EXTRACT_SWIFT_INFO_FOR_OBJC_SYMBOLS = YES;
+ ENABLE_MODULE_VERIFIER = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = CordovaLib_Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
@@ -659,7 +761,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ MERGEABLE_LIBRARY = YES;
+ MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
+ MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
@@ -667,6 +772,7 @@
PRODUCT_NAME = Cordova;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
};
name = Debug;
};
@@ -674,6 +780,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -696,6 +803,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -705,12 +813,15 @@
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DEFINES_MODULE = YES;
+ DOCC_EXTRACT_SWIFT_INFO_FOR_OBJC_SYMBOLS = YES;
+ ENABLE_MODULE_VERIFIER = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = CordovaLib_Prefix.pch;
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@@ -718,13 +829,17 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+ MERGEABLE_LIBRARY = YES;
+ MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
+ MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = Cordova;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
+ STRING_CATALOG_GENERATE_SYMBOLS = YES;
VALIDATE_PRODUCT = YES;
};
name = Release;
@@ -732,38 +847,52 @@
C0C01EB71E3911D50056E6CB /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- DEFINES_MODULE = YES;
+ BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
DYLIB_INSTALL_NAME_BASE = "@rpath";
- INFOPLIST_FILE = Cordova/Info.plist;
+ ENABLE_MODULE_VERIFIER = YES;
+ INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
+ MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
+ MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
- TARGETED_DEVICE_FAMILY = "1,2";
+ SKIP_INSTALL = NO;
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
+ SUPPORTS_MACCATALYST = YES;
+ TARGETED_DEVICE_FAMILY = "1,2,7";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
+ XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Debug;
};
C0C01EB81E3911D50056E6CB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- DEFINES_MODULE = YES;
+ BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
DYLIB_INSTALL_NAME_BASE = "@rpath";
- INFOPLIST_FILE = Cordova/Info.plist;
+ ENABLE_MODULE_VERIFIER = YES;
+ INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
+ MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
+ MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
- TARGETED_DEVICE_FAMILY = "1,2";
+ SKIP_INSTALL = NO;
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator xros xrsimulator";
+ SUPPORTS_MACCATALYST = YES;
+ TARGETED_DEVICE_FAMILY = "1,2,7";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
+ XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Release;
};
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 000000000..38402560b
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<Workspace
+ version = "1.0">
+ <FileRef
+ location = "self:CordovaLib.xcodeproj">
+ </FileRef>
+</Workspace>
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 000000000..18d981003
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IDEDidComputeMac32BitWarning</key>
+ <true/>
+</dict>
+</plist>
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/xcshareddata/xcschemes/Cordova.xcscheme b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/xcshareddata/xcschemes/Cordova.xcscheme
new file mode 100644
index 000000000..0c8724e2d
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/CordovaLib.xcodeproj/xcshareddata/xcschemes/Cordova.xcscheme
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<Scheme
+ LastUpgradeVersion = "1540"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ <BuildActionEntries>
+ <BuildActionEntry
+ buildForTesting = "YES"
+ buildForRunning = "YES"
+ buildForProfiling = "YES"
+ buildForArchiving = "YES"
+ buildForAnalyzing = "YES">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C0C01EB11E3911D50056E6CB"
+ BuildableName = "Cordova.framework"
+ BlueprintName = "Cordova"
+ ReferencedContainer = "container:CordovaLib.xcodeproj">
+ </BuildableReference>
+ </BuildActionEntry>
+ </BuildActionEntries>
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ </Testables>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C0C01EB11E3911D50056E6CB"
+ BuildableName = "Cordova.framework"
+ BlueprintName = "Cordova"
+ ReferencedContainer = "container:CordovaLib.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "C0C01EB11E3911D50056E6CB"
+ BuildableName = "Cordova.framework"
+ BlueprintName = "Cordova"
+ ReferencedContainer = "container:CordovaLib.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Info.plist b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Info.plist
new file mode 100644
index 000000000..22d6e2a57
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/Info.plist
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>$(DEVELOPMENT_LANGUAGE)</string>
+ <key>CFBundleDisplayName</key>
+ <string>CordovaLib</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
+ <key>CFBundleShortVersionString</key>
+ <string>8.0.0</string>
+ <key>CFBundleVersion</key>
+ <string>$(CURRENT_PROJECT_VERSION)</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright 2012 The Apache Software Foundation</string>
+</dict>
+</plist>
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/PrivacyInfo.xcprivacy b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/PrivacyInfo.xcprivacy
new file mode 100644
index 000000000..4b2e70fdd
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/PrivacyInfo.xcprivacy
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>NSPrivacyTracking</key>
+ <false/>
+ <key>NSPrivacyCollectedDataTypes</key>
+ <array/>
+ <key>NSPrivacyAccessedAPITypes</key>
+ <array/>
+ <key>NSPrivacyTrackingDomains</key>
+ <array/>
+</dict>
+</plist>
diff --git a/cordova/platforms/ios/TagSpaces/TagSpaces-Prefix.pch b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDV.h
similarity index 81%
rename from cordova/platforms/ios/TagSpaces/TagSpaces-Prefix.pch
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDV.h
index 208a69339..24ed1e5e8 100644
--- a/cordova/platforms/ios/TagSpaces/TagSpaces-Prefix.pch
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDV.h
@@ -16,11 +16,9 @@
specific language governing permissions and limitations
under the License.
*/
-//
-// Prefix header for all source files of the 'TagSpaces' target in the 'TagSpaces' project
-//
-#ifdef __OBJC__
- #import <Foundation/Foundation.h>
- #import <UIKit/UIKit.h>
+#ifndef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
+ #warning Import <Cordova/Cordova.h> rather than <Cordova/CDV.h>
#endif
+
+#import <Cordova/Cordova.h>
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAppDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAppDelegate.h
new file mode 100644
index 000000000..86665c6ea
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAppDelegate.h
@@ -0,0 +1,72 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <UIKit/UIKit.h>
+#import <Cordova/CDVAvailabilityDeprecated.h>
+
+@class CDVViewController;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ App delegate class with some additional Cordova-specific behavior.
+
+ The app delegate object manages your app’s shared behaviors. Your app should
+ include its own AppDelegate class which is a subclass of `CDVAppDelegate`.
+
+ `CDVAppDelegate` provides an extension point for Cordova plugins to safely add
+ behavior to the app by building on system events such as URL handling, push
+ notification registration, and deep linking.
+
+ See `UIApplicationDelegate` for more details about app delegates.
+
+ @Metadata {
+ @Available(Cordova, introduced: "4.0.0")
+ }
+ */
+@interface CDVAppDelegate : UIResponder <UIApplicationDelegate>
+
+/**
+ The application window.
+
+ @Metadata {
+ @Available(iOS, introduced: "2.0", deprecated: "13.0")
+ @Available(iPadOS, introduced: "2.0", deprecated: "13.0")
+ @Available(MacCatalyst, introduced: "2.0", deprecated: "13.0")
+ @Available(Cordova, introduced: "4.0.0", deprecated: "8.0.0")
+ }
+ @DeprecationSummary {
+ Deprecated in Cordova 8 in favour of UIScene protocols.
+ }
+ */
+@property (nullable, nonatomic, strong) IBOutlet UIWindow *window API_DEPRECATED_WITH_REPLACEMENT("SceneDelegate:window", ios(2.0, 13.0));
+
+// TODO: Remove in Cordova iOS 9
+/**
+ The ``CDVViewController`` instance.
+
+ @Metadata {
+ @Available(Cordova, introduced: "4.0.0", deprecated: "8.0.0")
+ }
+ */
+@property (nullable, nonatomic, strong) IBOutlet CDVViewController *viewController CDV_DEPRECATED(8.0.0, "");
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailability.h
similarity index 88%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailability.h
index 8b1ab479b..8af746e21 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailability.h
@@ -17,7 +17,7 @@
under the License.
*/
-#import "CDVAvailabilityDeprecated.h"
+#import <Cordova/CDVAvailabilityDeprecated.h>
#define __CORDOVA_IOS__
@@ -78,6 +78,12 @@
#define __CORDOVA_6_0_0 60000
#define __CORDOVA_6_1_0 60100
#define __CORDOVA_6_2_0 60200
+#define __CORDOVA_6_3_0 60300
+#define __CORDOVA_7_0_0 70000
+#define __CORDOVA_7_0_1 70001
+#define __CORDOVA_7_1_0 70100
+#define __CORDOVA_7_1_1 70101
+#define __CORDOVA_8_0_0 80000
/* coho:next-version,insert-before */
#define __CORDOVA_NA 99999 /* not available */
@@ -90,10 +96,11 @@
*/
#ifndef CORDOVA_VERSION_MIN_REQUIRED
/* coho:next-version-min-required,replace-after */
- #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_6_2_0
+ #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_8_0_0
#endif
-/*
+// TODO: Remove in Cordova iOS 9
+/**
Returns YES if it is at least version specified as NSString(X)
Usage:
if (IsAtLeastiOSVersion(@"5.1")) {
@@ -101,8 +108,9 @@
}
*/
#define IsAtLeastiOSVersion(X) ([[[UIDevice currentDevice] systemVersion] compare:X options:NSNumericSearch] != NSOrderedAscending)
+#pragma clang deprecated(IsAtLeastiOSVersion, "Use the built-in #available syntax")
-/* Return the string version of the decimal version */
+/** Return the string version of the decimal version */
#define CDV_VERSION [NSString stringWithFormat:@"%d.%d.%d", \
(CORDOVA_VERSION_MIN_REQUIRED / 10000), \
(CORDOVA_VERSION_MIN_REQUIRED % 10000) / 100, \
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAvailabilityDeprecated.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailabilityDeprecated.h
similarity index 75%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVAvailabilityDeprecated.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailabilityDeprecated.h
index abf7a16ad..407641b24 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVAvailabilityDeprecated.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVAvailabilityDeprecated.h
@@ -17,10 +17,5 @@
under the License.
*/
-#import <UIKit/UIKit.h>
-
-#ifdef __clang__
- #define CDV_DEPRECATED(version, msg) __attribute__((deprecated("Deprecated in Cordova " #version ". " msg)))
-#else
- #define CDV_DEPRECATED(version, msg) __attribute__((deprecated()))
-#endif
+#define CDV_DEPRECATED(version, msg) __attribute__((deprecated("Deprecated in Cordova " #version ". " msg)))
+#define CDV_DEPRECATED_WITH_REPLACEMENT(version, msg, repl) __attribute__((deprecated("Deprecated in Cordova " #version ". " msg, repl)))
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandDelegate.h
new file mode 100644
index 000000000..10cd12d74
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandDelegate.h
@@ -0,0 +1,97 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Cordova/CDVAvailability.h>
+#import <Cordova/CDVInvokedUrlCommand.h>
+
+@class CDVPlugin;
+@class CDVPluginResult;
+@class CDVSettingsDictionary;
+
+NS_ASSUME_NONNULL_BEGIN
+
+@protocol CDVCommandDelegate <NSObject>
+
+@optional
+
+@property (nonatomic, nullable, copy) NSURL *(^urlTransformer)(NSURL *) CDV_DEPRECATED(8.0.0, "");
+
+@required
+/**
+ The Cordova preferences for the web view.
+
+ This is a dictionary populated from the preference key/value pairs in the
+ Cordova XML configuration file.
+ */
+@property (nonatomic, readonly) CDVSettingsDictionary* settings;
+
+- (NSString *)pathForResource:(NSString *)resourcepath;
+
+/**
+ Returns the CDVPlugin instance of the given plugin name.
+
+ - Parameters:
+ - pluginName: The name of the plugin to return.
+ - Returns: The ``CDVPlugin`` instance, or `nil` if no plugin instance was
+ found with the given name.
+ */
+- (nullable CDVPlugin *)getCommandInstance:(NSString *)pluginName;
+
+/**
+ Sends a plugin result to the web view. This is thread-safe.
+
+ - Parameters:
+ - result: The plugin result to send to the web view.
+ - callbackId: The ID of the JavaScript callback to invoke.
+ */
+- (void)sendPluginResult:(CDVPluginResult *)result callbackId:(NSString *)callbackId;
+
+/**
+ Evaluates the given JavaScript string in the web view. This is thread-safe.
+
+ - Parameters:
+ - js: The string of JavaScript code to run.
+ */
+- (void)evalJs:(NSString *)js;
+
+/**
+ Evaluates the given JavaScript string right away instead of scheduling it on
+ the run-loop.
+
+ This is required for dispatching `resign` and `pause` events, but should not
+ be used without reason. Without the run-loop delay, alerts used in JS callbacks
+ may result in dead-lock. This method must be called from the UI thread.
+
+ - Parameters:
+ - js: The string of JavaScript code to run.
+ - scheduledOnRunLoop: Whether to schedule the code to run on the run-loop.
+ */
+- (void)evalJs:(NSString *)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop;
+
+/**
+ Runs the given block on a background thread using a shared thread-pool.
+
+ - Parameters:
+ - block: The block to be run.
+ */
+- (void)runInBackground:(void (^)(void))block;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandQueue.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandQueue.h
similarity index 91%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandQueue.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandQueue.h
index cb7bd6e4b..fbf36f6ea 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVCommandQueue.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVCommandQueue.h
@@ -26,7 +26,8 @@
@property (nonatomic, readonly) BOOL currentlyExecuting;
-- (id)initWithViewController:(CDVViewController*)viewController;
+- (instancetype)init NS_UNAVAILABLE;
+- (instancetype)initWithViewController:(CDVViewController *)viewController;
- (void)dispose;
- (void)resetRequestId;
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVConfigParser.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVConfigParser.h
new file mode 100644
index 000000000..84350c27e
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVConfigParser.h
@@ -0,0 +1,112 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ An object that handles parsing Cordova XML configuration files.
+
+ ## Overview
+ The `CDVConfigParser` class provides methods to parse a Cordova XML
+ configuration file and then access the resulting configuration data.
+
+ Use ``parseConfigFile:`` to load data from a file path.
+
+ Use ``parseConfigFile:withDelegate:`` if you need to intercept the XML parsing
+ and handle the data yourself with an `NSXMLParserDelegate`.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.3.0")
+ }
+ */
+@interface CDVConfigParser : NSObject <NSXMLParserDelegate>
+
+/**
+ A dictionary mapping Cordova plugin name keys to the plugin classes that implement them.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.3.0")
+ }
+ */
+@property (nonatomic, readonly, strong) NSMutableDictionary *pluginsDict;
+
+/**
+ A dictionary of Cordova preference keys and their values.
+
+ This should not be used directly, you should only use it to initialize a
+ ``CDVSettingsDictionary`` object.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.3.0")
+ }
+ */
+@property (nonatomic, readonly, strong) NSMutableDictionary *settings;
+
+/**
+ An array of plugin names to load immediately when Cordova initializes.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.5.0")
+ }
+ */
+@property (nonatomic, readonly, strong) NSMutableArray *startupPluginNames;
+
+/**
+ The path to the HTML page to display when the web view loads.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.4.0")
+ }
+ */
+@property (nonatomic, nullable, readonly, strong) NSString *startPage;
+
+/**
+ Parses the given path as a Cordova XML configuration file.
+
+ If the file could not be loaded or parsed, the resulting ``CDVConfigParser``
+ object will have empty values.
+
+ - Parameters:
+ - filePath: The file path URL to the configuration file.
+ - Returns: A ``CDVConfigParser`` with the parsed result.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
++ (instancetype)parseConfigFile:(NSURL *)filePath;
+
+/**
+ Parses the given path as a Cordova XML configuration file using the given delegate.
+
+ - Parameters:
+ - filePath: The file path URL to the configuration file.
+ - delegate: The delegate to handle the parsed XML data.
+ - Returns: Whether the given file was successfully parsed.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
++ (BOOL)parseConfigFile:(NSURL *)filePath withDelegate:(id <NSXMLParserDelegate>)delegate;
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVInvokedUrlCommand.h
similarity index 82%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVInvokedUrlCommand.h
index 993e0a285..64637560d 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVInvokedUrlCommand.h
@@ -31,14 +31,14 @@
@property (nonatomic, readonly) NSString* className;
@property (nonatomic, readonly) NSString* methodName;
-+ (CDVInvokedUrlCommand*)commandFromJson:(NSArray*)jsonEntry;
++ (instancetype)commandFromJson:(NSArray *)jsonEntry;
-- (id)initWithArguments:(NSArray*)arguments
- callbackId:(NSString*)callbackId
- className:(NSString*)className
- methodName:(NSString*)methodName;
+- (instancetype)initWithArguments:(NSArray *)arguments
+ callbackId:(NSString *)callbackId
+ className:(NSString *)className
+ methodName:(NSString *)methodName NS_DESIGNATED_INITIALIZER;
-- (id)initFromJson:(NSArray*)jsonEntry;
+- (instancetype)initFromJson:(NSArray *)jsonEntry;
// Returns the argument at the given index.
// If index >= the number of arguments, returns nil.
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin+Resources.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin+Resources.h
new file mode 100644
index 000000000..16019adf1
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin+Resources.h
@@ -0,0 +1,67 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <UIKit/UIKit.h>
+#import <Cordova/CDVPlugin.h>
+
+@interface CDVPlugin (CDVPluginResources)
+
+/**
+ Returns the localized string with the given key from a plugin bundle.
+
+ The plugin bundle must be named the same as the plugin class.
+
+ For example, if your plugin class was called `Foo`, and you have a Spanish
+ localized strings file, this method will try to load the desired key from
+ `Foo.bundle/es.lproj/Localizable.strings`.
+
+ - Parameters:
+ - key: The key of the localized string to retrieve.
+
+ - Returns: The localized string, or an empty string if the key could not be
+ found.
+
+ @Metadata {
+ @Available(Cordova, introduced: "4.0.0")
+ }
+ */
+- (NSString *)pluginLocalizedString:(NSString *)key;
+
+/**
+ Returns the image with the given name from a plugin bundle.
+
+ The plugin bundle must be named the same as the plugin class.
+
+ For example, if your plugin class was called `Foo`, and you have an image
+ called `"bar"`, this method will try to load the image from
+ `Foo.bundle/bar.png` (and appropriately named retina versions).
+
+ - Parameters:
+ - name: The file name of the image resource to retrieve.
+
+ - Returns: The image, or `nil` if an image with the provided name could not be
+ found.
+
+ @Metadata {
+ @Available(Cordova, introduced: "4.0.0")
+ }
+ */
+- (UIImage *)pluginImageResource:(NSString *)name;
+
+@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin.h
new file mode 100644
index 000000000..1e5f10bbe
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPlugin.h
@@ -0,0 +1,352 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+#import <Cordova/CDVAvailabilityDeprecated.h>
+#import <Cordova/CDVPluginNotifications.h>
+#import <Cordova/CDVPluginResult.h>
+#import <Cordova/CDVCommandDelegate.h>
+#import <Cordova/CDVSettingsDictionary.h>
+#import <Cordova/CDVViewController.h>
+#import <Cordova/CDVWebViewEngineProtocol.h>
+#import <Cordova/CDVInvokedUrlCommand.h>
+
+// Forward declaration to avoid bringing WebKit API into public headers
+@protocol WKURLSchemeTask;
+
+typedef int CDVWebViewNavigationType;
+
+NS_ASSUME_NONNULL_BEGIN
+
+#ifndef __swift__
+// This global extension to the UIView class causes issues for Swift subclasses
+// of UIView with their own scrollView properties, so we're removing it from
+// the exposed Swift API and marking it as deprecated
+// TODO: Remove in Cordova iOS 9
+@interface UIView (org_apache_cordova_UIView_Extension)
+@property (nonatomic, weak, nullable) UIScrollView *scrollView CDV_DEPRECATED(8.0.0, "Check for a scrollView property on the view object at runtime and invoke it dynamically.");
+@end
+#endif
+
+NS_ASSUME_NONNULL_END
+
+/**
+ The base class for all Cordova plugins.
+
+ @Metadata {
+ @Available("Cordova", introduced: "1.0.0")
+ }
+ */
+@interface CDVPlugin : NSObject {}
+
+/**
+ The web view engine that manages the web view displaying the Cordova
+ application's content.
+
+ By default, this will be a `CDVWebViewEngine` instance, but could also be a
+ custom implementation as well.
+
+ @Metadata {
+ @Available("Cordova", introduced: "4.0.0")
+ }
+ */
+@property (nonatomic, readonly, weak) id <CDVWebViewEngineProtocol> webViewEngine;
+
+/**
+ The web view that displays the Cordova application's content.
+
+ This is a shortcode for the `webView` property of the plugin's
+ ``webViewEngine``. If the `webViewEngine` is a `CDVWebViewEngine`, this can
+ safely be cast to a `WKWebView`.
+
+ @Metadata {
+ @Available("Cordova", introduced: "1.0.0")
+ }
+ */
+@property (nonatomic, readonly, weak) UIView *webView;
+
+/**
+ The application view controller the owns the Cordova web view to which this
+ plugin belongs.
+
+ @Metadata {
+ @Available("Cordova", introduced: "1.4.0")
+ }
+*/
+@property (nonatomic, weak) CDVViewController *viewController;
+
+/**
+ The application's Cordova command delegate instance.
+
+ @Metadata {
+ @Available("Cordova", introduced: "1.4.0")
+ }
+*/
+@property (nonatomic, weak) id <CDVCommandDelegate> commandDelegate;
+
+/**
+ Flag for pending plugin work that requires keeping the web view alive.
+
+ This flag is used during low memory situations to check if any plugins have
+ active work ongoing that prevents jettisoning the web view and associated view
+ controller from memory.
+
+ @Metadata {
+ @Available("Cordova", introduced: "1.7.0")
+ }
+ */
+@property (readonly, assign) BOOL hasPendingOperation;
+
+/**
+ Plugin initializer method. Override this method with your plugin initialization
+ logic.
+
+ ``CDVPlugin`` objects are constructed by the plugin manager, so it's not safe
+ to override the standard `init` method. Instead, use the ``pluginInitialize``
+ method to do any initialization logic needed by your plugin.
+
+ @Metadata {
+ @Available("Cordova", introduced: "2.5.0")
+ }
+ */
+- (void)pluginInitialize;
+
+/**
+ @Metadata {
+ @Available("Cordova", introduced: "1.0.0")
+ }
+ */
+- (void)handleOpenURL:(nonnull NSNotification *)notification;
+
+/**
+ @Metadata {
+ @Available("Cordova", introduced: "4.5.0", deprecated: "8.0.0")
+ }
+ @DeprecationSummary {
+ Use ``handleOpenURL:`` instead with the notification `userData`.
+ }
+ */
+- (void)handleOpenURLWithApplicationSourceAndAnnotation:(nonnull NSNotification *)notification CDV_DEPRECATED(8.0.0, "Use the handleOpenUrl method and the notification userInfo data.");
+
+/**
+ @Metadata {
+ @Available("Cordova", introduced: "1.0.0")
+ }
+ */
+- (void)onAppTerminate;
+
+/**
+ @Metadata {
+ @Available("Cordova", introduced: "1.0.0")
+ }
+ */
+- (void)onMemoryWarning;
+
+/**
+ @Metadata {
+ @Available("Cordova", introduced: "2.2.0")
+ }
+ */
+- (void)onReset;
+
+/**
+ @Metadata {
+ @Available("Cordova", introduced: "2.2.0")
+ }
+ */
+- (void)dispose;
+
+/*
+ // see initWithWebView implementation
+ - (void) onPause {}
+ - (void) onResume {}
+ - (void) onOrientationWillChange {}
+ - (void) onOrientationDidChange {}
+ */
+
+/**
+ The application delegate.
+
+ @Metadata {
+ @Available("Cordova", introduced: "1.0.0")
+ }
+ */
+- (nonnull id)appDelegate;
+
+@end
+
+#pragma mark - Plugin protocols
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ A protocol for Cordova plugins to intercept and respond to server
+ authentication challenges through WebKit.
+
+ Your plugin should implement this protocol and the
+ ``willHandleAuthenticationChallenge:completionHandler:`` method to return
+ `YES` if it wants to support responses to server-side authentication
+ challenges, otherwise the default NSURLSession handling for authentication
+ challenges will be used.
+
+ @Metadata {
+ @Available("Cordova", introduced: "8.0.0")
+ }
+ */
+@protocol CDVPluginAuthenticationHandler <NSObject>
+
+/**
+ Asks your plugin to respond to an authentication challenge.
+
+ Return `YES` if the plugin is handling the challenge, and `NO` to fallback to
+ the default handling.
+
+ - Parameters:
+ - challenge: The authentication challenge.
+ - completionHandler: A completion handler block to execute with the response.
+ This handler has no return value and takes the following parameters:
+ - disposition: The option to use to handle the challenge. For a list of
+ options, see `NSURLSessionAuthChallengeDisposition`.
+ - credential: The credential to use for authentication when the
+ `disposition` parameter contains the value
+ `NSURLSessionAuthChallengeUseCredential`. Specify `nil` to continue
+ without a credential.
+ - Returns: A Boolean value indicating if the plugin is handling the request.
+
+ @Metadata {
+ @Available("Cordova", introduced: "8.0.0")
+ }
+ */
+- (BOOL)willHandleAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler;
+
+@end
+
+
+/**
+ A protocol for Cordova plugins to manage permitting and denying of webview
+ navigations.
+
+ You plugin should implement this protocol if it wants to control whether the
+ webview is allowed to navigate to a requested URL.
+
+ @Metadata {
+ @Available("Cordova", introduced: "8.0.0")
+ }
+ */
+@protocol CDVPluginNavigationHandler <NSObject>
+
+/**
+ Asks your plugin to decide whether a navigation request should be permitted or
+ denied.
+
+ - Parameters:
+ - request: The navigation request.
+ - navigationType: The type of action triggering the navigation.
+ - navInfo: Descriptive information about the action triggering the navigation.
+
+ - Returns: A Boolean representing whether the navigation should be allowed or not.
+
+ @Metadata {
+ @Available("Cordova", introduced: "8.0.0")
+ }
+ */
+- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest *)request navigationType:(CDVWebViewNavigationType)navigationType info:(NSDictionary *)navInfo;
+
+@optional
+/**
+ Asks your plugin to decide whether a navigation request should be permitted or
+ denied.
+
+ - Parameters:
+ - request: The navigation request.
+ - navigationType: The type of action triggering the navigation.
+ - navInfo: Descriptive information about the action triggering the navigation.
+
+ - Returns: A Boolean representing whether the navigation should be allowed or not.
+
+ @Metadata {
+ @Available("Cordova", introduced: "4.0.0", deprecated: "8.0.0")
+ }
+ @DeprecationSummary {
+ Use ``shouldOverrideLoadWithRequest:navigationType:info:`` instead.
+ }
+ */
+- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest *)request navigationType:(CDVWebViewNavigationType)navigationType CDV_DEPRECATED_WITH_REPLACEMENT(8.0.0, "Use shouldOverrideLoadWithRequest:navigationType:info: instead", "shouldOverrideLoadWithRequest:navigationType:info:");
+
+@end
+
+
+/**
+ A protocol for Cordova plugins to intercept handling of WebKit resource
+ loading for a custom URL scheme.
+
+ Your plugin should implement this protocol if it wants to intercept requests
+ to a custom URL scheme and provide its own resource loading. Otherwise,
+ Cordova will use its default resource loading behavior from the app bundle.
+
+ When a WebKit-based web view encounters a resource that uses a custom scheme,
+ it creates a WKURLSchemeTask object and Cordova passes it to the methods of
+ your scheme handler plugin for processing. Use the ``overrideSchemeTask:``
+ method to indicate that your plugin will handle the request and to begin
+ loading the resource. While your handler loads the object, Cordova may call
+ your plugin’s ``stopSchemeTask:`` method to notify you that the resource is no
+ longer needed.
+
+ @Metadata {
+ @Available("Cordova", introduced: "8.0.0")
+ }
+ */
+@protocol CDVPluginSchemeHandler <NSObject>
+
+/**
+ Asks your plugin to handle the specified request and begin loading data.
+
+ If your plugin intends to handle the request and return data, this method
+ should return `YES` as soon as possible to prevent the default request
+ handling. If this method returns `NO`, Cordova will handle the resource
+ loading using its default behavior.
+
+ - Parameters:
+ - task: The task object that identifies the resource to load. You also use
+ this object to report the progress of the load operation back to the web
+ view.
+ - Returns: A Boolean value indicating if the plugin is handling the request.
+
+ @Metadata {
+ @Available("Cordova", introduced: "6.2.0")
+ }
+ */
+- (BOOL)overrideSchemeTask:(id <WKURLSchemeTask>)task;
+
+/**
+ Asks your plugin to stop loading the data for the specified resource.
+
+ - Parameters:
+ - task: The task object that identifies the resource the web view no
+ longer needs.
+
+ @Metadata {
+ @Available("Cordova", introduced: "6.2.0")
+ }
+ */
+- (void)stopSchemeTask:(id <WKURLSchemeTask>)task;
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginNotifications.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginNotifications.h
new file mode 100644
index 000000000..bcdf0979d
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginNotifications.h
@@ -0,0 +1,34 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import <Cordova/CDVAvailabilityDeprecated.h>
+
+extern const NSNotificationName CDVPageDidLoadNotification;
+extern const NSNotificationName CDVPluginHandleOpenURLNotification;
+extern const NSNotificationName CDVPluginResetNotification;
+extern const NSNotificationName CDVViewWillAppearNotification;
+extern const NSNotificationName CDVViewDidAppearNotification;
+extern const NSNotificationName CDVViewWillDisappearNotification;
+extern const NSNotificationName CDVViewDidDisappearNotification;
+extern const NSNotificationName CDVViewWillLayoutSubviewsNotification;
+extern const NSNotificationName CDVViewDidLayoutSubviewsNotification;
+extern const NSNotificationName CDVViewWillTransitionToSizeNotification;
+
+extern const NSNotificationName CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification CDV_DEPRECATED(8.0.0, "Find sourceApplication and annotations in the userInfo of the CDVPluginHandleOpenURLNotification notification.");
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginResult.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginResult.h
new file mode 100644
index 000000000..81a5039e2
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVPluginResult.h
@@ -0,0 +1,119 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import <Cordova/CDVAvailability.h>
+
+/**
+ An enumeration that describes the result of handling a plugin command.
+
+ ## See Also
+
+ - ``CDVPluginResult``
+
+ @Metadata {
+ @Available(Cordova, introduced: "5.0.0")
+ }
+ */
+typedef NS_ENUM(NSUInteger, CDVCommandStatus) {
+ /** Status code indicating no command result. */
+ CDVCommandStatus_NO_RESULT NS_SWIFT_NAME(noResult) = 0,
+
+ /** Status code indicating successful handling of the command. */
+ CDVCommandStatus_OK NS_SWIFT_NAME(ok),
+
+ /** Status code indicating the command's plugin class could not be found. */
+ CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION NS_SWIFT_NAME(classNotFoundException),
+
+ /** Status code indicating there was an illegal access exception while handling the command. */
+ CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION NS_SWIFT_NAME(illegalAccessException),
+
+ /** Status code indicating the command's plugin class could not be instantiated. */
+ CDVCommandStatus_INSTANTIATION_EXCEPTION NS_SWIFT_NAME(instantiationException),
+
+ /** Status code indicating the command included a malformed URL. */
+ CDVCommandStatus_MALFORMED_URL_EXCEPTION NS_SWIFT_NAME(malformedUrlException),
+
+ /** Status code indicating there was an I/O exception while handling the command. */
+ CDVCommandStatus_IO_EXCEPTION NS_SWIFT_NAME(ioException),
+
+ /** Status code indicating the command's action was not valid. */
+ CDVCommandStatus_INVALID_ACTION NS_SWIFT_NAME(invalidAction),
+
+ /** Status code indicating the command's JSON data was invalid. */
+ CDVCommandStatus_JSON_EXCEPTION NS_SWIFT_NAME(jsonException),
+
+ /** Status code indicating there was an error handling the command. */
+ CDVCommandStatus_ERROR NS_SWIFT_NAME(error)
+};
+
+#ifdef __swift__
+// This exists to preserve compatibility with early Swift plugins, who are
+// using CDVCommandStatus as ObjC-style constants rather than as Swift enum
+// values.
+// This declares extern'ed constants (implemented in CDVPluginResult.m)
+// TODO: Remove this in Cordova iOS 9
+#define SWIFT_ENUM_COMPAT_HACK(enumVal, replacement) extern const CDVCommandStatus SWIFT_##enumVal NS_SWIFT_NAME(enumVal) CDV_DEPRECATED_WITH_REPLACEMENT(8.0.0, "Use the CDVCommandStatus." #replacement " enum value instead", "CDVCommandStatus." #replacement)
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_NO_RESULT, noResult);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_OK, ok);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_CLASS_NOT_FOUND_EXCEPTION, classNotFoundException);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION, illegalAccessException);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INSTANTIATION_EXCEPTION, instantiationException);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_MALFORMED_URL_EXCEPTION, malformedUrlException);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_IO_EXCEPTION, ioException);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_INVALID_ACTION, invalidAction);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_JSON_EXCEPTION, jsonException);
+SWIFT_ENUM_COMPAT_HACK(CDVCommandStatus_ERROR, error);
+#undef SWIFT_ENUM_COMPAT_HACK
+#endif
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface CDVPluginResult : NSObject {}
+
+@property (nonatomic, strong, readonly) NSNumber *status;
+@property (nonatomic, nullable, strong, readonly) id message;
+@property (nonatomic, strong) NSNumber *keepCallback;
+@property (nonatomic, strong) id associatedObject CDV_DEPRECATED(8.0.0, "");
+
+- (instancetype)init;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsString:(NSString *)theMessage;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArray:(NSArray *)theMessage;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsInt:(int)theMessage;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSInteger:(NSInteger)theMessage;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSUInteger:(NSUInteger)theMessage;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDouble:(double)theMessage;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsBool:(BOOL)theMessage;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary *)theMessage;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArrayBuffer:(NSData *)theMessage;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsMultipart:(NSArray *)theMessages;
++ (instancetype)resultWithStatus:(CDVCommandStatus)statusOrdinal messageToErrorObject:(int)errorCode;
+
++ (void)setVerbose:(BOOL)verbose CDV_DEPRECATED(8.0.0, "");
++ (BOOL)isVerbose CDV_DEPRECATED(8.0.0, "");
+
+- (void)setKeepCallbackAsBool:(BOOL)bKeepCallback;
+
+- (NSString*)argumentsAsJSON;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSceneDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSceneDelegate.h
new file mode 100644
index 000000000..565e6ad98
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSceneDelegate.h
@@ -0,0 +1,53 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ UI scene delegate class with some additional Cordova-specific behavior.
+
+ The scene delegate object manages your app’s window behaviors. Your app should
+ include its own SceneDelegate class which is a subclass of `CDVSceneDelegate`.
+
+ `CDVSceneDelegate` provides an extension point for Cordova plugins to safely
+ add behavior to the app by building on system events such as URL handling and
+ scene/window management.
+
+ See `UIWindowSceneDelegate` for more details about app delegates.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+*/
+@interface CDVSceneDelegate : UIResponder <UIWindowSceneDelegate>
+
+/**
+ The application window for the current UI scene.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+*/
+@property (strong, nonatomic) UIWindow *window;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVScreenOrientationDelegate.h
similarity index 85%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVScreenOrientationDelegate.h
index 49c3c2707..b55a41bd1 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVScreenOrientationDelegate.h
@@ -18,7 +18,14 @@
*/
#import <Foundation/Foundation.h>
+#import <Cordova/CDVAvailabilityDeprecated.h>
+/**
+ @Metadata {
+ @Available(Cordova, introduced: "2.3.0", deprecated: "8.0.0")
+ }
+ */
+CDV_DEPRECATED(8.0.0, "")
@protocol CDVScreenOrientationDelegate <NSObject>
- (UIInterfaceOrientationMask)supportedInterfaceOrientations;
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSettingsDictionary.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSettingsDictionary.h
new file mode 100644
index 000000000..66cafe26b
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVSettingsDictionary.h
@@ -0,0 +1,180 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ A dictionary-like interface providing access to the preference settings for a Cordova web view.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+@interface CDVSettingsDictionary : NSDictionary
+
+/**
+ The number of entries in the dictionary.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+@property(readonly) NSUInteger count;
+
+/**
+ Initializes a newly allocated dictionary by placing in it the keys and values
+ contained in another given dictionary.
+
+ - Parameters:
+ - dict: A dictionary containing the keys and values with which to initialize
+ the new dictionary.
+ - Returns: An initialized dictionary containing the keys and values found in `dict`.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+- (instancetype)initWithDictionary:(NSDictionary *)dict NS_DESIGNATED_INITIALIZER;
+
+/**
+ Returns the value associated with a given key.
+
+ - Parameters:
+ - key: The key for which to return the corresponding value.
+ - Returns: The value associated with `key`, or `nil` if no value is associated with `key`.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+- (id)objectForKey:(NSString *)key;
+
+/**
+ Provides an enumerator to access the keys in the dictionary.
+
+ - Returns: An enumerator object that lets you access each key in the dictionary.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+- (NSEnumerator *)keyEnumerator;
+
+/**
+ Returns the value associated with a given key.
+
+ - Parameters:
+ - key: The key for which to return the corresponding value.
+ - Returns: The value associated with `key`, or `nil` if no value is associated with `key`.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+- (id)cordovaSettingForKey:(NSString *)key;
+
+/**
+ Returns the boolean value associated with a given key, or the given default
+ value if the key is not found.
+
+ - Parameters:
+ - key: The key for which to return the corresponding value.
+ - defaultValue: The default value to return if the key is missing.
+ - Returns: The value associated with `key`, or the provided default value.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+- (BOOL)cordovaBoolSettingForKey:(NSString *)key defaultValue:(BOOL)defaultValue;
+
+/**
+ Returns the floating-point numeric value associated with a given key, or the
+ given default value if the key is not found.
+
+ - Parameters:
+ - key: The key for which to return the corresponding value.
+ - defaultValue: The default value to return if the key is missing.
+ - Returns: The value associated with `key`, or the provided default value.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+- (CGFloat)cordovaFloatSettingForKey:(NSString *)key defaultValue:(CGFloat)defaultValue;
+
+/**
+ Adds a preference with the given name and value to the dictionary.
+
+ > Warning: Use of this method is highly discouraged. Preferences should be set
+ > and customized by app authors in the Cordova XML configuration file, not
+ > changed at runtime by plugins.
+
+ - Parameters:
+ - value: The value to be stored with the given key.
+ - key: The preference name.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+- (void)setObject:(id)value forKey:(NSString *)key;
+
+/**
+ Adds a preference with the given name and value to the dictionary.
+
+ You shouldn’t need to call this method directly. Instead, this method is called
+ when setting an object for a key using subscripting.
+
+ > Warning: Use of this method is highly discouraged. Preferences should be set
+ > and customized by app authors in the Cordova XML configuration file, not
+ > changed at runtime by plugins.
+
+ - Parameters:
+ - value: The value to be stored with the given key.
+ - key: The preference name.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+- (void)setObject:(id)value forKeyedSubscript:(NSString *)key;
+
+/**
+ Adds a preference with the given name and value to the dictionary.
+
+ > Warning: Use of this method is highly discouraged. Preferences should be set
+ > and customized by app authors in the Cordova XML configuration file, not
+ > changed at runtime by plugins.
+
+ - Parameters:
+ - value: The value to be stored with the given key.
+ - key: The preference name.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+- (void)setCordovaSetting:(id)value forKey:(NSString *)key;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVTimer.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVTimer.h
new file mode 100644
index 000000000..5be94a187
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVTimer.h
@@ -0,0 +1,85 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+/**
+ Utility class for measuring the time spent on an operation.
+
+ You can use `CDVTimer` to measure named operations, and it will print the
+ elapsed time to the application log upon completion of the operation. This
+ allows for simple benchmarking of potentially expensive operations like plugin
+ loading and initialization.
+
+ At the start of an operation, call ``start:`` with a unique name, then when the
+ operation finishes, call ``stop:`` with the same name:
+
+ @TabNavigator {
+ @Tab("Swift") {
+ ```swift
+ CDVTimer.start("ExpensiveOperation")
+
+ doExpensiveOperation();
+
+ CDVTimer.stop("ExpensiveOperation")
+ ```
+ }
+ @Tab("Objective-C") {
+ ```objc
+ [CDVTimer start:@"ExpensiveOperation"];
+
+ doExpensiveOperation();
+
+ [CDVTimer stop:@"ExpensiveOperation"];
+ ```
+ }
+ }
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.7.0")
+ }
+ */
+@interface CDVTimer : NSObject
+
+/**
+ Begins measuring elapsed time for the named operation.
+
+ - Parameters:
+ - name: A unique name to identify the timed operation.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.7.0")
+ }
+ */
++ (void)start:(NSString *)name;
+
+/**
+ Stops measuring elapsed time for the named operation, and prints the elapsed
+ time to the log.
+
+ - Parameters:
+ - name: The unique name to identify the timed operation.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.7.0")
+ }
+ */
++ (void)stop:(NSString *)name;
+
+@end
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVViewController.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVViewController.h
new file mode 100644
index 000000000..00cc9e201
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVViewController.h
@@ -0,0 +1,390 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <UIKit/UIKit.h>
+#import <Cordova/CDVAvailability.h>
+#import <Cordova/CDVInvokedUrlCommand.h>
+#import <Cordova/CDVCommandDelegate.h>
+#import <Cordova/CDVCommandQueue.h>
+#import <Cordova/CDVSettingsDictionary.h>
+#import <Cordova/CDVScreenOrientationDelegate.h>
+#import <Cordova/CDVWebViewEngineProtocol.h>
+
+@class CDVPlugin;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ A view controller that specializes in displaying Cordova web content.
+
+ ## Overview
+ `CDVViewController` presents a view that displays Cordova web content in a
+ web view. Although often presented as the root view controller for an app,
+ a `CDVViewController` can safely be placed within view controller
+ hierarchies—such as navigation and tabbed controllers—or presented modally.
+
+ The behavior preferences and web content to be loaded are defined in a Cordova
+ XML configuration file, for which a separate [reference
+ guide](https://cordova.apache.org/docs/en/latest/config_ref/index.html)
+ exists. The web content displayed within the view has access to Cordova
+ plugins via their exposed JavaScript APIs.
+
+ > Important: In accordance with [App Store review
+ > guidelines](https://developer.apple.com/app-store/review/guidelines/), you
+ > must not expose Apple device APIs to web content that is not bundled within
+ > the app.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.0.0")
+ }
+ */
+@interface CDVViewController : UIViewController
+
+#pragma mark - Properties
+
+/**
+ The view displaying web content for this Cordova controller.
+
+ The exact type of this UIView subclass varies based on which
+ plugin is being used to provide the web view implementation. Interactions
+ with the web view and its content should be done through the ``webViewEngine``
+ property.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.0.0")
+ }
+ */
+@property (nonatomic, readonly, nullable, weak) IBOutlet UIView *webView;
+
+/**
+ An array of loaded Cordova plugin instances.
+
+ This array is safe to iterate using a `for...in` loop.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+@property (nonatomic, readonly, copy) NSArray <CDVPlugin *> *enumerablePlugins;
+
+/**
+ The scheme being used to load web content from the app bundle into the Cordova
+ web view.
+
+ The default value is `app` but can be customized via the `Scheme` preference
+ in the Cordova XML configuration file. Setting this to `file` will results in
+ web content being loaded using the File URL protocol, which has inherent
+ security limitations. It is encouraged that you use a custom scheme to load
+ your app content.
+
+ It is not valid to set this to an existing protocol scheme such as `http` or
+ `https`.
+
+ @Metadata {
+ @Available(Cordova, introduced: "6.0.0")
+ }
+ */
+@property (nonatomic, nullable, readwrite, copy) NSString *appScheme;
+
+/**
+ @Metadata {
+ @Available(Cordova, introduced: "3.0.0")
+ }
+ */
+@property (nonatomic, readonly, strong) CDVCommandQueue *commandQueue;
+
+/**
+ @Metadata {
+ @Available(Cordova, introduced: "2.0.0")
+ }
+ */
+@property (nonatomic, readonly, strong) id <CDVCommandDelegate> commandDelegate;
+
+/**
+ The associated web view engine implementation.
+
+ This provides a reference to the web view plugin class, which
+ implements ``CDVWebViewEngineProtocol`` and allows for interaction with the
+ web view.
+
+ @Metadata {
+ @Available(Cordova, introduced: "4.0.0")
+ }
+ */
+@property (nonatomic, readonly, strong) id <CDVWebViewEngineProtocol> webViewEngine;
+
+/**
+ The Cordova preferences for this view.
+
+ This is a dictionary populated from the preference key/value pairs in the
+ Cordova XML configuration file.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.0.0")
+ }
+ */
+@property (nonatomic, readonly, strong) CDVSettingsDictionary *settings;
+
+/**
+ The filename of the Cordova XML configuration file.
+
+ The default value is `"config.xml"`.
+
+ This can be set in the storyboard file as a view controller attribute.
+
+ @Metadata {
+ @Available(Cordova, introduced: "5.0.0")
+ }
+ */
+@property (nonatomic, readwrite, copy) IBInspectable NSString *configFile;
+
+/**
+ The file path to the Cordova XML configuration file.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+@property (nonatomic, nullable, readonly, copy) NSURL *configFilePath;
+
+/**
+ The file path to the HTML error fallback page, if one has been provided.
+
+ @Metadata {
+ @Available(Cordova, introduced: "4.0.0")
+ }
+ */
+@property (nonatomic, nullable, readonly, copy) NSURL *errorURL;
+
+/**
+ The folder path containing the web content to be displayed.
+
+ The default value is `"www"`.
+
+ This can be set in the storyboard file as a view controller attribute.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+@property (nonatomic, readwrite, copy) IBInspectable NSString *webContentFolderName;
+
+/**
+ The filename of the HTML file to load into the web view.
+
+ The default value will be read from the Cordova XML configuration file, and
+ fall back to `"index.html"` if not specified.
+
+ This can be set in the storyboard file as a view controller attribute.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.0.0")
+ }
+ */
+@property (nonatomic, nullable, readwrite, copy) IBInspectable NSString *startPage;
+
+/**
+ A boolean value indicating whether to show the splash screen while the web view
+ is initially loading.
+
+ The default value is `YES`.
+
+ This can be set in the storyboard file as a view controller attribute.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+@property (nonatomic) IBInspectable BOOL showInitialSplashScreen;
+
+/**
+ The color drawn behind the web content.
+
+ This is used as the background color for the web view behind any HTML content
+ and during loading before web content has been rendered. The default value is
+ the system background color.
+
+ This can be set in the storyboard file as a view controller attribute.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+@property (nonatomic, null_resettable, copy) IBInspectable UIColor *backgroundColor;
+
+/**
+ The color drawn behind the splash screen content.
+
+ This is used as the background color for the splash screen while the web
+ content is loading. If a page background color has been specified, that will
+ be used as the default value, otherwise the system background color is used.
+
+ This can be set in the storyboard file as a view controller attribute.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+@property (nonatomic, null_resettable, copy) IBInspectable UIColor *splashBackgroundColor;
+
+/**
+ The color drawn behind the status bar.
+
+ This can be set in the storyboard file as a view controller attribute.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+@property (nonatomic, null_resettable, copy) IBInspectable UIColor *statusBarBackgroundColor;
+
+#pragma mark - Methods
+
+/**
+ @Metadata {
+ @Available(Cordova, introduced: "2.0.0")
+ }
+ */
+- (UIView*)newCordovaViewWithFrame:(CGRect)bounds;
+
+/**
+ Loads the starting page in the web view, replacing any existing content.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+- (void)loadStartPage;
+
+/**
+ Returns the ``CDVPlugin`` instance of the given plugin name, creating the
+ instance if one does not exist.
+
+ - Parameters:
+ - pluginName: The name of the plugin to return.
+ - Returns: The ``CDVPlugin`` instance, or `nil` if no plugin exists with the
+ given name.
+
+ @Metadata {
+ @Available(Cordova, introduced: "3.0.0")
+ }
+ */
+- (nullable CDVPlugin *)getCommandInstance:(NSString *)pluginName;
+
+/**
+ @Metadata {
+ @Available(Cordova, introduced: "3.0.0")
+ }
+ */
+- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className;
+
+/**
+ @Metadata {
+ @Available(Cordova, introduced: "3.0.0")
+ }
+ */
+- (void)registerPlugin:(CDVPlugin*)plugin withPluginName:(NSString*)pluginName;
+
+/**
+ Toggles the display of the splash screen overtop of the web view.
+
+ - Parameters:
+ - visible: Whether to make the splash screen visible or not.
+
+ @Metadata {
+ @Available(Cordova, introduced: "8.0.0")
+ }
+ */
+- (void)showSplashScreen:(BOOL)visible;
+
+
+#pragma mark - Deprecated
+
+/**
+ @Metadata {
+ @Available(Cordova, introduced: "3.0.0", deprecated: "8.0.0")
+ }
+ */
+@property (nonatomic, nullable, readonly, strong) NSXMLParser *configParser CDV_DEPRECATED(8.0.0, "");
+
+/**
+ @Metadata {
+ @Available(Cordova, introduced: "2.0.0", deprecated: "8.0.0")
+ }
+ */
+@property (nonatomic, nullable, readonly, copy) NSString *appURLScheme CDV_DEPRECATED(8.0.0, "");
+
+/**
+ @Metadata {
+ @Available(Cordova, introduced: "2.0.0", deprecated: "8.0.0")
+ }
+ */
+@property (nonatomic, readonly, strong) NSDictionary<NSString *, CDVPlugin *> *pluginObjects CDV_DEPRECATED(8.0.0, "Internal implementation detail, should not be used");
+
+/**
+ @Metadata {
+ @Available(Cordova, introduced: "2.0.0", deprecated: "8.0.0")
+ }
+ */
+@property (nullable, nonatomic, readonly, strong) NSDictionary<NSString *, NSString *> *pluginsMap CDV_DEPRECATED(8.0.0, "Internal implementation detail, should not be used");
+
+/**
+ The folder path containing the web content to be displayed.
+
+ The default value is `"www"`.
+
+ @Metadata {
+ @Available(Cordova, introduced: "2.0.0", deprecated: "8.0.0")
+ }
+ @DeprecationSummary {
+ Use ``webContentFolderName`` instead.
+ }
+ */
+@property (nonatomic, readwrite, copy) NSString *wwwFolderName CDV_DEPRECATED_WITH_REPLACEMENT(8.0.0, "Use webContentFolderName instead", "webContentFolderName");
+
+/**
+ Toggles the display of the splash screen overtop of the web view.
+
+ - Parameters:
+ - visible: Whether to make the splash screen visible or not.
+
+ @Metadata {
+ @Available(Cordova, introduced: "6.0.0", deprecated: "8.0.0")
+ }
+ @DeprecationSummary {
+ Use ``showSplashScreen:`` instead.
+ }
+ */
+- (void)showLaunchScreen:(BOOL)visible CDV_DEPRECATED_WITH_REPLACEMENT(8.0.0, "Use showSplashScreen: instead", "showSplashScreen");
+
+/**
+ Parses the Cordova XML configuration file using the given delegate.
+
+ @Metadata {
+ @Available(Cordova, introduced: "4.0.0", deprecated: "8.0.0")
+ }
+ @DeprecationSummary {
+ Use `CDVConfigParser` ``CDVConfigParser/parseConfigFile:withDelegate:`` instead.
+ }
+ */
+- (void)parseSettingsWithParser:(id <NSXMLParserDelegate>)delegate CDV_DEPRECATED(8.0.0, "Use CDVConfigParser parseConfigFile:withDelegate: instead");
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewEngineProtocol.h
similarity index 56%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewEngineProtocol.h
index e6126a4b4..d7110536f 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewEngineProtocol.h
@@ -24,18 +24,52 @@
#define kCDVWebViewEngineWKUIDelegate @"kCDVWebViewEngineWKUIDelegate"
#define kCDVWebViewEngineWebViewPreferences @"kCDVWebViewEngineWebViewPreferences"
+@class WKWebViewConfiguration;
+
@protocol CDVWebViewEngineProtocol <NSObject>
+NS_ASSUME_NONNULL_BEGIN
+
@property (nonatomic, strong, readonly) UIView* engineWebView;
- (id)loadRequest:(NSURLRequest*)request;
-- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL;
-- (void)evaluateJavaScript:(NSString*)javaScriptString completionHandler:(void (^)(id, NSError*))completionHandler;
+- (id)loadHTMLString:(NSString*)string baseURL:(nullable NSURL*)baseURL;
+- (void)evaluateJavaScript:(NSString*)javaScriptString completionHandler:(void (^_Nullable)(id, NSError*))completionHandler;
- (NSURL*)URL;
- (BOOL)canLoadRequest:(NSURLRequest*)request;
+- (nullable instancetype)initWithFrame:(CGRect)frame;
+
+/// Convenience Initializer
+/// @param frame The frame for the new web view.
+/// @param configuration The configuration for the new web view.
+- (nullable instancetype)initWithFrame:(CGRect)frame configuration:(nullable WKWebViewConfiguration *)configuration;
-- (instancetype)initWithFrame:(CGRect)frame;
- (void)updateWithInfo:(NSDictionary*)info;
+NS_ASSUME_NONNULL_END
+
+@end
+
+
+@protocol CDVWebViewEngineConfigurationDelegate <NSObject>
+
+@optional
+/**
+ Provides a fully configured WKWebViewConfiguration which will be overridden
+ with any related settings you add to config.xml (e.g., `PreferredContentMode`).
+ This is useful for more complex configuration, including `websiteDataStore`.
+
+ ## Example usage
+
+ ```swift
+ extension CDVViewController: CDVWebViewEngineConfigurationDelegate {
+ public func configuration() -> WKWebViewConfiguration {
+ // return your config here
+ }
+ }
+ ```
+ */
+- (nonnull WKWebViewConfiguration*)configuration;
+
@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewProcessPoolFactory.h
similarity index 80%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewProcessPoolFactory.h
index b15628914..cfdec1989 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/CDVWebViewProcessPoolFactory.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/CDVWebViewProcessPoolFactory.h
@@ -17,8 +17,16 @@
under the License.
*/
-#import <WebKit/WebKit.h>
+#import <Cordova/CDVAvailabilityDeprecated.h>
+@class WKProcessPool;
+
+/**
+ @Metadata {
+ @Available(Cordova, introduced: "6.2.0", deprecated: "8.0.0")
+ }
+ */
+CDV_DEPRECATED(8.0.0, "WebKit WKProcessPool is deprecated in iOS")
@interface CDVWebViewProcessPoolFactory : NSObject
@property (nonatomic, retain) WKProcessPool* sharedPool;
diff --git a/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/Cordova.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/Cordova.h
new file mode 100644
index 000000000..321b29483
--- /dev/null
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/Cordova.h
@@ -0,0 +1,46 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#define __CORDOVA_SILENCE_HEADER_DEPRECATIONS
+
+#import <Cordova/CDVAvailability.h>
+#import <Cordova/CDVAvailabilityDeprecated.h>
+#import <Cordova/CDVAppDelegate.h>
+#import <Cordova/CDVSceneDelegate.h>
+#import <Cordova/CDVPlugin.h>
+#import <Cordova/CDVPluginNotifications.h>
+#import <Cordova/CDVPluginResult.h>
+#import <Cordova/CDVViewController.h>
+#import <Cordova/CDVCommandDelegate.h>
+#import <Cordova/CDVCommandQueue.h>
+#import <Cordova/CDVConfigParser.h>
+#import <Cordova/CDVInvokedUrlCommand.h>
+#import <Cordova/CDVPlugin+Resources.h>
+#import <Cordova/CDVSettingsDictionary.h>
+#import <Cordova/CDVWebViewEngineProtocol.h>
+#import <Cordova/CDVWebViewProcessPoolFactory.h>
+#import <Cordova/CDVScreenOrientationDelegate.h>
+#import <Cordova/CDVTimer.h>
+
+// Deprecated
+#import <Cordova/CDV.h>
+#import <Cordova/NSDictionary+CordovaPreferences.h>
+#import <Cordova/NSMutableArray+QueueAdditions.h>
+
+#undef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSDictionary+CordovaPreferences.h
similarity index 66%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSDictionary+CordovaPreferences.h
index 9be2be2dc..894508911 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSDictionary+CordovaPreferences.h
@@ -18,18 +18,22 @@
*/
#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
+#import <Cordova/CDVAvailabilityDeprecated.h>
+
+#ifndef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
+#warning "Use CDVSettingsDictionary.h and the CDVSettingsDictionary class instead"
+#endif
@interface NSDictionary (CordovaPreferences)
-- (id)cordovaSettingForKey:(NSString*)key;
-- (BOOL)cordovaBoolSettingForKey:(NSString*)key defaultValue:(BOOL)defaultValue;
-- (CGFloat)cordovaFloatSettingForKey:(NSString*)key defaultValue:(CGFloat)defaultValue;
+- (id)cordovaSettingForKey:(NSString*)key CDV_DEPRECATED(8.0.0, "Use CDVSettingsDictionary");
+- (BOOL)cordovaBoolSettingForKey:(NSString*)key defaultValue:(BOOL)defaultValue CDV_DEPRECATED(8.0.0, "Use CDVSettingsDictionary");
+- (CGFloat)cordovaFloatSettingForKey:(NSString*)key defaultValue:(CGFloat)defaultValue CDV_DEPRECATED(8.0.0, "Use CDVSettingsDictionary");
@end
@interface NSMutableDictionary (CordovaPreferences)
-- (void)setCordovaSetting:(id)value forKey:(NSString*)key;
+- (void)setCordovaSetting:(id)value forKey:(NSString*)key CDV_DEPRECATED(8.0.0, "Use CDVSettingsDictionary");
@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.h b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSMutableArray+QueueAdditions.h
similarity index 75%
rename from cordova/platforms/ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.h
rename to cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSMutableArray+QueueAdditions.h
index 79e65164e..df471f968 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.h
+++ b/cordova/platforms/ios/packages/cordova-ios/CordovaLib/include/Cordova/NSMutableArray+QueueAdditions.h
@@ -18,12 +18,17 @@
*/
#import <Foundation/Foundation.h>
+#import <Cordova/CDVAvailabilityDeprecated.h>
+
+#ifndef __CORDOVA_SILENCE_HEADER_DEPRECATIONS
+//#warning "This should not be used"
+#endif
@interface NSMutableArray (QueueAdditions)
-- (id)cdv_pop;
-- (id)cdv_queueHead;
+- (id)cdv_pop CDV_DEPRECATED(8.0.0, "");
+- (id)cdv_queueHead CDV_DEPRECATED(8.0.0, "");
- (id)cdv_dequeue;
-- (void)cdv_enqueue:(id)obj;
+- (void)cdv_enqueue:(id)obj CDV_DEPRECATED(8.0.0, "");
@end
diff --git a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m b/cordova/platforms/ios/packages/cordova-ios/Package.swift
similarity index 56%
rename from cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m
rename to cordova/platforms/ios/packages/cordova-ios/Package.swift
index 9ff062af3..6571d093c 100644
--- a/cordova/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVLaunchScreen/CDVLaunchScreen.m
+++ b/cordova/platforms/ios/packages/cordova-ios/Package.swift
@@ -1,3 +1,5 @@
+// swift-tools-version:5.5
+
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -17,23 +19,29 @@
under the License.
*/
-#import "CDVLaunchScreen.h"
-#import <Cordova/CDVViewController.h>
-
-@implementation CDVLaunchScreen
-
-- (void)show:(CDVInvokedUrlCommand*)command
-{
- if ([self.viewController isKindOfClass:[CDVViewController class]]) {
- [(CDVViewController*)self.viewController showLaunchScreen:YES];
- }
-}
-
-- (void)hide:(CDVInvokedUrlCommand*)command
-{
- if ([self.viewController isKindOfClass:[CDVViewController class]]) {
- [(CDVViewController*)self.viewController showLaunchScreen:NO];
- }
-}
+import PackageDescription
-@end
+let package = Package(
+ name: "Cordova",
+ platforms: [
+ .iOS(.v13),
+ .macCatalyst(.v13)
+ ],
+ products: [
+ .library(name: "Cordova", targets: ["Cordova"])
+ ],
+ dependencies: [],
+ targets: [
+ .target(
+ name: "Cordova",
+ path: "CordovaLib/",
+ exclude: ["Info.plist"],
+ resources: [
+ .copy("PrivacyInfo.xcprivacy")
+ ],
+ cSettings: [
+ .headerSearchPath("Classes/Private")
+ ]
+ )
+ ]
+)
diff --git a/cordova/platforms/ios/platform_www/cordova-js-src/exec.js b/cordova/platforms/ios/platform_www/cordova-js-src/exec.js
deleted file mode 100644
index 466220d83..000000000
--- a/cordova/platforms/ios/platform_www/cordova-js-src/exec.js
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Creates the exec bridge used to notify the native code of
- * commands.
- */
-var cordova = require('cordova');
-var utils = require('cordova/utils');
-var base64 = require('cordova/base64');
-
-function massageArgsJsToNative (args) {
- if (!args || utils.typeName(args) !== 'Array') {
- return args;
- }
- var ret = [];
- args.forEach(function (arg, i) {
- if (utils.typeName(arg) === 'ArrayBuffer') {
- ret.push({
- CDVType: 'ArrayBuffer',
- data: base64.fromArrayBuffer(arg)
- });
- } else {
- ret.push(arg);
- }
- });
- return ret;
-}
-
-function massageMessageNativeToJs (message) {
- if (message.CDVType === 'ArrayBuffer') {
- var stringToArrayBuffer = function (str) {
- var ret = new Uint8Array(str.length);
- for (var i = 0; i < str.length; i++) {
- ret[i] = str.charCodeAt(i);
- }
- return ret.buffer;
- };
- var base64ToArrayBuffer = function (b64) {
- return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef
- };
- message = base64ToArrayBuffer(message.data);
- }
- return message;
-}
-
-function convertMessageToArgsNativeToJs (message) {
- var args = [];
- if (!message || !Object.prototype.hasOwnProperty.call(message, 'CDVType')) {
- args.push(message);
- } else if (message.CDVType === 'MultiPart') {
- message.messages.forEach(function (e) {
- args.push(massageMessageNativeToJs(e));
- });
- } else {
- args.push(massageMessageNativeToJs(message));
- }
- return args;
-}
-
-var iOSExec = function () {
- var successCallback, failCallback, service, action, actionArgs;
- var callbackId = null;
- if (typeof arguments[0] !== 'string') {
- // FORMAT ONE
- successCallback = arguments[0];
- failCallback = arguments[1];
- service = arguments[2];
- action = arguments[3];
- actionArgs = arguments[4];
-
- // Since we need to maintain backwards compatibility, we have to pass
- // an invalid callbackId even if no callback was provided since plugins
- // will be expecting it. The Cordova.exec() implementation allocates
- // an invalid callbackId and passes it even if no callbacks were given.
- callbackId = 'INVALID';
- } else {
- throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line
- 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);');
- }
-
- // If actionArgs is not provided, default to an empty array
- actionArgs = actionArgs || [];
-
- // Register the callbacks and add the callbackId to the positional
- // arguments if given.
- if (successCallback || failCallback) {
- callbackId = service + cordova.callbackId++;
- cordova.callbacks[callbackId] =
- { success: successCallback, fail: failCallback };
- }
-
- actionArgs = massageArgsJsToNative(actionArgs);
-
- // CB-10133 DataClone DOM Exception 25 guard (fast function remover)
- var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))];
- window.webkit.messageHandlers.cordova.postMessage(command);
-};
-
-iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
- var success = status === 0 || status === 1;
- var args = convertMessageToArgsNativeToJs(message);
- Promise.resolve().then(function () {
- cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line
- });
-};
-
-// for backwards compatibility
-iOSExec.nativeEvalAndFetch = function (func) {
- try {
- func();
- } catch (e) {
- console.log(e);
- }
-};
-
-// Proxy the exec for bridge changes. See CB-10106
-
-function cordovaExec () {
- var cexec = require('cordova/exec');
- var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function');
- return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec;
-}
-
-function execProxy () {
- cordovaExec().apply(null, arguments);
-}
-
-execProxy.nativeFetchMessages = function () {
- return cordovaExec().nativeFetchMessages.apply(null, arguments);
-};
-
-execProxy.nativeEvalAndFetch = function () {
- return cordovaExec().nativeEvalAndFetch.apply(null, arguments);
-};
-
-execProxy.nativeCallback = function () {
- return cordovaExec().nativeCallback.apply(null, arguments);
-};
-
-module.exports = execProxy;
diff --git a/cordova/platforms/ios/platform_www/cordova-js-src/platform.js b/cordova/platforms/ios/platform_www/cordova-js-src/platform.js
deleted file mode 100644
index 83868c81b..000000000
--- a/cordova/platforms/ios/platform_www/cordova-js-src/platform.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
- id: 'ios',
- bootstrap: function () {
- // Attach the console polyfill that is iOS-only to window.console
- // see the file under plugin/ios/console.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console');
-
- // Attach the wkwebkit utility to window.WkWebView
- // see the file under plugin/ios/wkwebkit.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/wkwebkit', 'window.WkWebView');
-
- // Attach the splashscreen utility to window.navigator.splashscreen
- // see the file under plugin/ios/launchscreen.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/launchscreen', 'navigator.splashscreen');
-
- require('cordova/channel').onNativeReady.fire();
- }
-};
diff --git a/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/console.js b/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/console.js
deleted file mode 100644
index 0a4820ede..000000000
--- a/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/console.js
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// ------------------------------------------------------------------------------
-
-var logger = require('cordova/plugin/ios/logger');
-
-// ------------------------------------------------------------------------------
-// object that we're exporting
-// ------------------------------------------------------------------------------
-var console = module.exports;
-
-// ------------------------------------------------------------------------------
-// copy of the original console object
-// ------------------------------------------------------------------------------
-var WinConsole = window.console;
-
-// ------------------------------------------------------------------------------
-// whether to use the logger
-// ------------------------------------------------------------------------------
-var UseLogger = false;
-
-// ------------------------------------------------------------------------------
-// Timers
-// ------------------------------------------------------------------------------
-var Timers = {};
-
-// ------------------------------------------------------------------------------
-// used for unimplemented methods
-// ------------------------------------------------------------------------------
-function noop () {}
-
-// ------------------------------------------------------------------------------
-// used for unimplemented methods
-// ------------------------------------------------------------------------------
-console.useLogger = function (value) {
- if (arguments.length) UseLogger = !!value;
-
- if (UseLogger) {
- if (logger.useConsole()) {
- throw new Error('console and logger are too intertwingly');
- }
- }
-
- return UseLogger;
-};
-
-// ------------------------------------------------------------------------------
-console.log = function () {
- if (logger.useConsole()) return;
- logger.log.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.error = function () {
- if (logger.useConsole()) return;
- logger.error.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.warn = function () {
- if (logger.useConsole()) return;
- logger.warn.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.info = function () {
- if (logger.useConsole()) return;
- logger.info.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.debug = function () {
- if (logger.useConsole()) return;
- logger.debug.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.assert = function (expression) {
- if (expression) return;
-
- var message = logger.format.apply(logger.format, [].slice.call(arguments, 1));
- console.log('ASSERT: ' + message);
-};
-
-// ------------------------------------------------------------------------------
-console.clear = function () {};
-
-// ------------------------------------------------------------------------------
-console.dir = function (object) {
- console.log('%o', object);
-};
-
-// ------------------------------------------------------------------------------
-console.dirxml = function (node) {
- console.log(node.innerHTML);
-};
-
-// ------------------------------------------------------------------------------
-console.trace = noop;
-
-// ------------------------------------------------------------------------------
-console.group = console.log;
-
-// ------------------------------------------------------------------------------
-console.groupCollapsed = console.log;
-
-// ------------------------------------------------------------------------------
-console.groupEnd = noop;
-
-// ------------------------------------------------------------------------------
-console.time = function (name) {
- Timers[name] = new Date().valueOf();
-};
-
-// ------------------------------------------------------------------------------
-console.timeEnd = function (name) {
- var timeStart = Timers[name];
- if (!timeStart) {
- console.warn('unknown timer: ' + name);
- return;
- }
-
- var timeElapsed = new Date().valueOf() - timeStart;
- console.log(name + ': ' + timeElapsed + 'ms');
-};
-
-// ------------------------------------------------------------------------------
-console.timeStamp = noop;
-
-// ------------------------------------------------------------------------------
-console.profile = noop;
-
-// ------------------------------------------------------------------------------
-console.profileEnd = noop;
-
-// ------------------------------------------------------------------------------
-console.count = noop;
-
-// ------------------------------------------------------------------------------
-console.exception = console.log;
-
-// ------------------------------------------------------------------------------
-console.table = function (data, columns) {
- console.log('%o', data);
-};
-
-// ------------------------------------------------------------------------------
-// return a new function that calls both functions passed as args
-// ------------------------------------------------------------------------------
-function wrappedOrigCall (orgFunc, newFunc) {
- return function () {
- var args = [].slice.call(arguments);
- try { orgFunc.apply(WinConsole, args); } catch (e) {}
- try { newFunc.apply(console, args); } catch (e) {}
- };
-}
-
-// ------------------------------------------------------------------------------
-// For every function that exists in the original console object, that
-// also exists in the new console object, wrap the new console method
-// with one that calls both
-// ------------------------------------------------------------------------------
-for (var key in console) {
- if (typeof WinConsole[key] === 'function') {
- console[key] = wrappedOrigCall(WinConsole[key], console[key]);
- }
-}
diff --git a/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/launchscreen.js b/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/launchscreen.js
deleted file mode 100644
index 24606969b..000000000
--- a/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/launchscreen.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-
-var launchscreen = {
- show: function () {
- exec(null, null, 'LaunchScreen', 'show', []);
- },
- hide: function () {
- exec(null, null, 'LaunchScreen', 'hide', []);
- }
-};
-
-module.exports = launchscreen;
diff --git a/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/logger.js b/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/logger.js
deleted file mode 100644
index 6f59e1c8e..000000000
--- a/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/logger.js
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// ------------------------------------------------------------------------------
-// The logger module exports the following properties/functions:
-//
-// LOG - constant for the level LOG
-// ERROR - constant for the level ERROR
-// WARN - constant for the level WARN
-// INFO - constant for the level INFO
-// DEBUG - constant for the level DEBUG
-// logLevel() - returns current log level
-// logLevel(value) - sets and returns a new log level
-// useConsole() - returns whether logger is using console
-// useConsole(value) - sets and returns whether logger is using console
-// log(message,...) - logs a message at level LOG
-// error(message,...) - logs a message at level ERROR
-// warn(message,...) - logs a message at level WARN
-// info(message,...) - logs a message at level INFO
-// debug(message,...) - logs a message at level DEBUG
-// logLevel(level,message,...) - logs a message specified level
-//
-// ------------------------------------------------------------------------------
-
-var logger = exports;
-
-var exec = require('cordova/exec');
-
-var UseConsole = false;
-var UseLogger = true;
-var Queued = [];
-var DeviceReady = false;
-var CurrentLevel;
-
-var originalConsole = console;
-
-/**
- * Logging levels
- */
-
-var Levels = [
- 'LOG',
- 'ERROR',
- 'WARN',
- 'INFO',
- 'DEBUG'
-];
-
-/*
- * add the logging levels to the logger object and
- * to a separate levelsMap object for testing
- */
-
-var LevelsMap = {};
-for (var i = 0; i < Levels.length; i++) {
- var level = Levels[i];
- LevelsMap[level] = i;
- logger[level] = level;
-}
-
-CurrentLevel = LevelsMap.WARN;
-
-/**
- * Getter/Setter for the logging level
- *
- * Returns the current logging level.
- *
- * When a value is passed, sets the logging level to that value.
- * The values should be one of the following constants:
- * logger.LOG
- * logger.ERROR
- * logger.WARN
- * logger.INFO
- * logger.DEBUG
- *
- * The value used determines which messages get printed. The logging
- * values above are in order, and only messages logged at the logging
- * level or above will actually be displayed to the user. E.g., the
- * default level is WARN, so only messages logged with LOG, ERROR, or
- * WARN will be displayed; INFO and DEBUG messages will be ignored.
- */
-logger.level = function (value) {
- if (arguments.length) {
- if (LevelsMap[value] === null) {
- throw new Error('invalid logging level: ' + value);
- }
- CurrentLevel = LevelsMap[value];
- }
-
- return Levels[CurrentLevel];
-};
-
-/**
- * Getter/Setter for the useConsole functionality
- *
- * When useConsole is true, the logger will log via the
- * browser 'console' object.
- */
-logger.useConsole = function (value) {
- if (arguments.length) UseConsole = !!value;
-
- if (UseConsole) {
- if (typeof console === 'undefined') {
- throw new Error('global console object is not defined');
- }
-
- if (typeof console.log !== 'function') {
- throw new Error('global console object does not have a log function');
- }
-
- if (typeof console.useLogger === 'function') {
- if (console.useLogger()) {
- throw new Error('console and logger are too intertwingly');
- }
- }
- }
-
- return UseConsole;
-};
-
-/**
- * Getter/Setter for the useLogger functionality
- *
- * When useLogger is true, the logger will log via the
- * native Logger plugin.
- */
-logger.useLogger = function (value) {
- // Enforce boolean
- if (arguments.length) UseLogger = !!value;
- return UseLogger;
-};
-
-/**
- * Logs a message at the LOG level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.log = function (message) { logWithArgs('LOG', arguments); };
-
-/**
- * Logs a message at the ERROR level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.error = function (message) { logWithArgs('ERROR', arguments); };
-
-/**
- * Logs a message at the WARN level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.warn = function (message) { logWithArgs('WARN', arguments); };
-
-/**
- * Logs a message at the INFO level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.info = function (message) { logWithArgs('INFO', arguments); };
-
-/**
- * Logs a message at the DEBUG level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.debug = function (message) { logWithArgs('DEBUG', arguments); };
-
-// log at the specified level with args
-function logWithArgs (level, args) {
- args = [level].concat([].slice.call(args));
- logger.logLevel.apply(logger, args);
-}
-
-// return the correct formatString for an object
-function formatStringForMessage (message) {
- return (typeof message === 'string') ? '' : '%o';
-}
-
-/**
- * Logs a message at the specified level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.logLevel = function (level /* , ... */) {
- // format the message with the parameters
- var formatArgs = [].slice.call(arguments, 1);
- var fmtString = formatStringForMessage(formatArgs[0]);
- if (fmtString.length > 0) {
- formatArgs.unshift(fmtString); // add formatString
- }
-
- var message = logger.format.apply(logger.format, formatArgs);
-
- if (LevelsMap[level] === null) {
- throw new Error('invalid logging level: ' + level);
- }
-
- if (LevelsMap[level] > CurrentLevel) return;
-
- // queue the message if not yet at deviceready
- if (!DeviceReady && !UseConsole) {
- Queued.push([level, message]);
- return;
- }
-
- // Log using the native logger if that is enabled
- if (UseLogger) {
- exec(null, null, 'Console', 'logLevel', [level, message]);
- }
-
- // Log using the console if that is enabled
- if (UseConsole) {
- // make sure console is not using logger
- if (console.useLogger()) {
- throw new Error('console and logger are too intertwingly');
- }
-
- // log to the console
- switch (level) {
- case logger.LOG: originalConsole.log(message); break;
- case logger.ERROR: originalConsole.log('ERROR: ' + message); break;
- case logger.WARN: originalConsole.log('WARN: ' + message); break;
- case logger.INFO: originalConsole.log('INFO: ' + message); break;
- case logger.DEBUG: originalConsole.log('DEBUG: ' + message); break;
- }
- }
-};
-
-/**
- * Formats a string and arguments following it ala console.log()
- *
- * Any remaining arguments will be appended to the formatted string.
- *
- * for rationale, see FireBug's Console API:
- * http://getfirebug.com/wiki/index.php/Console_API
- */
-logger.format = function (formatString, args) {
- return __format(arguments[0], [].slice.call(arguments, 1)).join(' ');
-};
-
-// ------------------------------------------------------------------------------
-/**
- * Formats a string and arguments following it ala vsprintf()
- *
- * format chars:
- * %j - format arg as JSON
- * %o - format arg as JSON
- * %c - format arg as ''
- * %% - replace with '%'
- * any other char following % will format it's
- * arg via toString().
- *
- * Returns an array containing the formatted string and any remaining
- * arguments.
- */
-function __format (formatString, args) {
- if (formatString === null || formatString === undefined) return [''];
- if (arguments.length === 1) return [formatString.toString()];
-
- if (typeof formatString !== 'string') { formatString = formatString.toString(); }
-
- var pattern = /(.*?)%(.)(.*)/;
- var rest = formatString;
- var result = [];
-
- while (args.length) {
- var match = pattern.exec(rest);
- if (!match) break;
-
- var arg = args.shift();
- rest = match[3];
- result.push(match[1]);
-
- if (match[2] === '%') {
- result.push('%');
- args.unshift(arg);
- continue;
- }
-
- result.push(__formatted(arg, match[2]));
- }
-
- result.push(rest);
-
- var remainingArgs = [].slice.call(args);
- remainingArgs.unshift(result.join(''));
- return remainingArgs;
-}
-
-function __formatted (object, formatChar) {
- try {
- switch (formatChar) {
- case 'j':
- case 'o': return JSON.stringify(object);
- case 'c': return '';
- }
- } catch (e) {
- return 'error JSON.stringify()ing argument: ' + e;
- }
-
- if ((object === null) || (object === undefined)) {
- return Object.prototype.toString.call(object);
- }
-
- return object.toString();
-}
-
-// ------------------------------------------------------------------------------
-// when deviceready fires, log queued messages
-logger.__onDeviceReady = function () {
- if (DeviceReady) return;
-
- DeviceReady = true;
-
- for (var i = 0; i < Queued.length; i++) {
- var messageArgs = Queued[i];
- logger.logLevel(messageArgs[0], messageArgs[1]);
- }
-
- Queued = null;
-};
-
-// add a deviceready event to log queued messages
-document.addEventListener('deviceready', logger.__onDeviceReady, false);
diff --git a/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/wkwebkit.js b/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/wkwebkit.js
deleted file mode 100644
index 35c819cf1..000000000
--- a/cordova/platforms/ios/platform_www/cordova-js-src/plugin/ios/wkwebkit.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-
-var WkWebKit = {
- allowsBackForwardNavigationGestures: function (allow) {
- exec(null, null, 'CDVWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]);
- },
- convertFilePath: function (path) {
- if (!path || !window.CDV_ASSETS_URL) {
- return path;
- }
- if (path.startsWith('/')) {
- return window.CDV_ASSETS_URL + '/_app_file_' + path;
- }
- if (path.startsWith('file://')) {
- return window.CDV_ASSETS_URL + path.replace('file://', '/_app_file_');
- }
- return path;
- }
-};
-
-module.exports = WkWebKit;
diff --git a/cordova/platforms/ios/platform_www/cordova.js b/cordova/platforms/ios/platform_www/cordova.js
index 37f329f54..136d639b6 100644
--- a/cordova/platforms/ios/platform_www/cordova.js
+++ b/cordova/platforms/ios/platform_www/cordova.js
@@ -1,5 +1,5 @@
-// Platform: ios
-// cordova-js rel/6.0.0-10-g07379820
+// Platform: cordova-ios
+// cordova-js 6.1.0
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '6.2.0';
+var PLATFORM_VERSION_BUILD_LABEL = '8.0.0';
// file: src/scripts/require.js
var require;
var define;
@@ -866,7 +866,7 @@ module.exports = channel;
});
-// file: ../cordova-ios/cordova-js-src/exec.js
+// file: ../../cordova-js-src/exec.js
define("cordova/exec", function(require, exports, module) {
/**
@@ -905,7 +905,7 @@ function massageMessageNativeToJs (message) {
return ret.buffer;
};
var base64ToArrayBuffer = function (b64) {
- return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef
+ return stringToArrayBuffer(atob(b64));
};
message = base64ToArrayBuffer(message.data);
}
@@ -969,7 +969,7 @@ iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, de
var success = status === 0 || status === 1;
var args = convertMessageToArgsNativeToJs(message);
Promise.resolve().then(function () {
- cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line
+ cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
});
};
@@ -1233,7 +1233,7 @@ exports.reset();
});
-// file: ../cordova-ios/cordova-js-src/platform.js
+// file: ../../cordova-js-src/platform.js
define("cordova/platform", function(require, exports, module) {
module.exports = {
@@ -1251,13 +1251,17 @@ module.exports = {
// see the file under plugin/ios/launchscreen.js
require('cordova/modulemapper').clobbers('cordova/plugin/ios/launchscreen', 'navigator.splashscreen');
+ // Attach the internal statusBar utility to window.statusbar
+ // see the file under plugin/ios/statusbar.js
+ require('cordova/modulemapper').clobbers('cordova/plugin/ios/statusbar', 'window.statusbar');
+
require('cordova/channel').onNativeReady.fire();
}
};
});
-// file: ../cordova-ios/cordova-js-src/plugin/ios/console.js
+// file: ../../cordova-js-src/plugin/ios/console.js
define("cordova/plugin/ios/console", function(require, exports, module) {
// ------------------------------------------------------------------------------
@@ -1428,7 +1432,7 @@ for (var key in console) {
});
-// file: ../cordova-ios/cordova-js-src/plugin/ios/launchscreen.js
+// file: ../../cordova-js-src/plugin/ios/launchscreen.js
define("cordova/plugin/ios/launchscreen", function(require, exports, module) {
var exec = require('cordova/exec');
@@ -1446,7 +1450,7 @@ module.exports = launchscreen;
});
-// file: ../cordova-ios/cordova-js-src/plugin/ios/logger.js
+// file: ../../cordova-js-src/plugin/ios/logger.js
define("cordova/plugin/ios/logger", function(require, exports, module) {
// ------------------------------------------------------------------------------
@@ -1779,7 +1783,74 @@ document.addEventListener('deviceready', logger.__onDeviceReady, false);
});
-// file: ../cordova-ios/cordova-js-src/plugin/ios/wkwebkit.js
+// file: ../../cordova-js-src/plugin/ios/statusbar.js
+define("cordova/plugin/ios/statusbar", function(require, exports, module) {
+
+var exec = require('cordova/exec');
+
+var statusBarVisible = true;
+var statusBar = {};
+
+// This <script> element is explicitly used by Cordova's statusbar for computing color. (Do not use this element)
+const statusBarScript = document.createElement('script');
+document.head.appendChild(statusBarScript);
+
+Object.defineProperty(statusBar, 'visible', {
+ configurable: false,
+ enumerable: true,
+ get: function () {
+ if (window.StatusBar) {
+ // Let the CDVStatusBar plugin handle it
+ return window.StatusBar.isVisible;
+ }
+
+ return statusBarVisible;
+ },
+ set: function (value) {
+ if (window.StatusBar) {
+ // Let the CDVStatusBar plugin handle it
+ if (value) {
+ window.StatusBar.show();
+ } else {
+ window.StatusBar.hide();
+ }
+ } else {
+ statusBarVisible = value;
+ exec(null, null, 'StatusBarInternal', 'setVisible', [!!value]);
+ }
+ }
+});
+
+Object.defineProperty(statusBar, 'setBackgroundColor', {
+ configurable: false,
+ enumerable: false,
+ writable: false,
+ value: function (value) {
+ statusBarScript.style.color = value;
+ var rgbStr = window.getComputedStyle(statusBarScript).getPropertyValue('color');
+
+ if (!rgbStr.match(/^rgb/)) {
+ return;
+ }
+
+ var rgbVals = rgbStr.match(/\d+/g).map(function (v) { return parseInt(v, 10); });
+ if (rgbVals.length < 3) {
+ return;
+ }
+
+ if (window.StatusBar) {
+ window.StatusBar.backgroundColorByHexString('#' + rgbVals[0].toString(16).padStart(2, '0') + rgbVals[1].toString(16).padStart(2, '0') + rgbVals[2].toString(16).padStart(2, '0'));
+ } else {
+ exec(null, null, 'StatusBarInternal', 'setBackgroundColor', rgbVals);
+ }
+ }
+});
+
+module.exports = statusBar;
+
+});
+
+// file: ../../cordova-js-src/plugin/ios/wkwebkit.js
define("cordova/plugin/ios/wkwebkit", function(require, exports, module) {
var exec = require('cordova/exec');
diff --git a/cordova/platforms/ios/platform_www/cordova_plugins.js b/cordova/platforms/ios/platform_www/cordova_plugins.js
index 5d457dc9c..89efbb690 100644
--- a/cordova/platforms/ios/platform_www/cordova_plugins.js
+++ b/cordova/platforms/ios/platform_www/cordova_plugins.js
@@ -8,6 +8,29 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"plugins.Downloader"
]
},
+ {
+ "id": "es6-promise-plugin.Promise",
+ "file": "plugins/es6-promise-plugin/www/promise.js",
+ "pluginId": "es6-promise-plugin",
+ "runs": true
+ },
+ {
+ "id": "cordova-plugin-device.device",
+ "file": "plugins/cordova-plugin-device/www/device.js",
+ "pluginId": "cordova-plugin-device",
+ "clobbers": [
+ "device"
+ ]
+ },
+ {
+ "id": "cordova-plugin-background-mode.BackgroundMode",
+ "file": "plugins/cordova-plugin-background-mode/www/background-mode.js",
+ "pluginId": "cordova-plugin-background-mode",
+ "clobbers": [
+ "cordova.plugins.backgroundMode",
+ "plugin.backgroundMode"
+ ]
+ },
{
"id": "cordova-plugin-file.DirectoryEntry",
"file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
@@ -180,11 +203,76 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"cordova"
],
"runs": true
+ },
+ {
+ "id": "cordova-plugin-file-opener2.FileOpener2",
+ "file": "plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js",
+ "pluginId": "cordova-plugin-file-opener2",
+ "clobbers": [
+ "cordova.plugins.fileOpener2"
+ ]
+ },
+ {
+ "id": "cordova-plugin-x-socialsharing.SocialSharing",
+ "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js",
+ "pluginId": "cordova-plugin-x-socialsharing",
+ "clobbers": [
+ "window.plugins.socialsharing"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.Camera",
+ "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "Camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverOptions",
+ "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverOptions"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.camera",
+ "file": "plugins/cordova-plugin-camera/www/Camera.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "navigator.camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverHandle",
+ "file": "plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverHandle"
+ ]
+ },
+ {
+ "id": "com-darryncampbell-cordova-plugin-intent.IntentShim",
+ "file": "plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js",
+ "pluginId": "com-darryncampbell-cordova-plugin-intent",
+ "clobbers": [
+ "intentShim"
+ ]
}
];
module.exports.metadata = {
"com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "cordova-plugin-androidx": "3.0.0",
- "cordova-plugin-file": "7.0.0-dev"
+ "es6-promise-plugin": "4.2.2",
+ "cordova-plugin-whitelist": "1.3.3",
+ "cordova-plugin-device": "2.0.2",
+ "cordova-plugin-background-mode": "0.7.3",
+ "cordova-plugin-file": "6.0.2",
+ "cordova-plugin-file-opener2": "3.0.3",
+ "cordova-plugin-x-socialsharing": "5.6.8",
+ "cordova-plugin-camera": "4.1.0",
+ "cordova-plugin-androidx-adapter": "1.1.3",
+ "com-darryncampbell-cordova-plugin-intent": "2.0.0",
+ "cordova-plugin-androidx": "3.0.0"
};
-});
+});
\ No newline at end of file
diff --git a/cordova/platforms/ios/platform_www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js b/cordova/platforms/ios/platform_www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js
new file mode 100644
index 000000000..67be5340c
--- /dev/null
+++ b/cordova/platforms/ios/platform_www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js
@@ -0,0 +1,91 @@
+cordova.define("com-darryncampbell-cordova-plugin-intent.IntentShim", function(require, exports, module) {
+var argscheck = require('cordova/argscheck'),
+ channel = require('cordova/channel'),
+ utils = require('cordova/utils'),
+ exec = require('cordova/exec'),
+ cordova = require('cordova');
+
+
+/**
+ * This represents a thin shim layer over the Android Intent implementation
+ * @constructor
+ */
+function IntentShim() {
+ var me = this;
+}
+
+IntentShim.prototype.ACTION_SEND = "android.intent.action.SEND";
+IntentShim.prototype.ACTION_VIEW= "android.intent.action.VIEW";
+IntentShim.prototype.ACTION_INSTALL_PACKAGE="android.intent.action.INSTALL_PACKAGE";
+IntentShim.prototype.ACTION_UNINSTALL_PACKAGE= "android.intent.action.UNINSTALL_PACKAGE";
+IntentShim.prototype.EXTRA_TEXT = "android.intent.extra.TEXT";
+IntentShim.prototype.EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
+IntentShim.prototype.EXTRA_STREAM = "android.intent.extra.STREAM";
+IntentShim.prototype.EXTRA_EMAIL = "android.intent.extra.EMAIL";
+IntentShim.prototype.ACTION_CALL = "android.intent.action.CALL";
+IntentShim.prototype.ACTION_SENDTO = "android.intent.action.SENDTO";
+// StartActivityForResult
+IntentShim.prototype.ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT";
+IntentShim.prototype.ACTION_PICK = "android.intent.action.PICK";
+IntentShim.prototype.RESULT_CANCELED = 0; // Activity.RESULT_CANCELED
+IntentShim.prototype.RESULT_OK = -1; // Activity.RESULT_OK
+
+IntentShim.prototype.startActivity = function(params, successCallback, errorCallback) {
+ argscheck.checkArgs('off', 'IntentShim.startActivity', arguments);
+ exec(successCallback, errorCallback, "IntentShim", "startActivity", [params]);
+};
+
+IntentShim.prototype.startActivityForResult = function(params, successCallback, errorCallback) {
+ argscheck.checkArgs('off', 'IntentShim.startActivityForResult', arguments);
+ exec(successCallback, errorCallback, "IntentShim", "startActivityForResult", [params]);
+};
+
+IntentShim.prototype.sendBroadcast = function(params, successCallback, errorCallback) {
+ argscheck.checkArgs('off', 'IntentShim.sendBroadcast', arguments);
+ exec(successCallback, errorCallback, "IntentShim", "sendBroadcast", [params]);
+};
+
+IntentShim.prototype.startService = function(params, successCallback, errorCallback) {
+ argscheck.checkArgs('off', 'IntentShim.startService', arguments);
+ exec(successCallback, errorCallback, "IntentShim", "startService", [params]);
+};
+
+IntentShim.prototype.registerBroadcastReceiver = function(params, callback) {
+ argscheck.checkArgs('of', 'IntentShim.registerBroadcastReceiver', arguments);
+ exec(callback, null, "IntentShim", "registerBroadcastReceiver", [params]);
+};
+
+IntentShim.prototype.unregisterBroadcastReceiver = function() {
+ argscheck.checkArgs('', 'IntentShim.unregisterBroadcastReceiver', arguments);
+ exec(null, null, "IntentShim", "unregisterBroadcastReceiver", []);
+};
+
+IntentShim.prototype.onIntent = function(callback) {
+ argscheck.checkArgs('f', 'IntentShim.onIntent', arguments);
+ exec(callback, null, "IntentShim", "onIntent", [callback]);
+};
+
+IntentShim.prototype.onActivityResult = function(callback) {
+ argscheck.checkArgs('f', 'IntentShim.onActivityResult', arguments);
+ exec(callback, null, "IntentShim", "onActivityResult", [callback]);
+};
+
+IntentShim.prototype.getIntent = function(successCallback, failureCallback) {
+ argscheck.checkArgs('ff', 'IntentShim.getIntent', arguments);
+ exec(successCallback, failureCallback, "IntentShim", "getIntent", []);
+};
+
+IntentShim.prototype.sendResult = function(params, callback) {
+ argscheck.checkArgs('of', 'IntentShim.sendResult', arguments);
+ exec(callback, null, "IntentShim", "sendResult", [params]);
+}
+
+IntentShim.prototype.realPathFromUri = function(params, successCallback, errorCallback) {
+ argscheck.checkArgs('off', 'IntentShim.realPathFromUri', arguments);
+ exec(successCallback, errorCallback, "IntentShim", "realPathFromUri", [params]);
+};
+
+window.intentShim = new IntentShim();
+window.plugins = window.plugins || {};
+window.plugins.intentShim = window.intentShim;
+});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-background-mode/www/background-mode.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-background-mode/www/background-mode.js
new file mode 100644
index 000000000..7895b27ad
--- /dev/null
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-background-mode/www/background-mode.js
@@ -0,0 +1,513 @@
+cordova.define("cordova-plugin-background-mode.BackgroundMode", function(require, exports, module) {
+/*
+ Copyright 2013-2017 appPlant GmbH
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var exec = require('cordova/exec'),
+ channel = require('cordova/channel');
+
+/**
+ * Activates the background mode. When activated the application
+ * will be prevented from going to sleep while in background
+ * for the next time.
+ *
+ * @return [ Void ]
+ */
+exports.enable = function()
+{
+ if (this.isEnabled())
+ return;
+
+ var fn = function() {
+ exports._isEnabled = true;
+ exports.fireEvent('enable');
+ };
+
+ cordova.exec(fn, null, 'BackgroundMode', 'enable', []);
+};
+
+/**
+ * Deactivates the background mode. When deactivated the application
+ * will not stay awake while in background.
+ *
+ * @return [ Void ]
+ */
+exports.disable = function()
+{
+ if (!this.isEnabled())
+ return;
+
+ var fn = function() {
+ exports._isEnabled = false;
+ exports.fireEvent('disable');
+ };
+
+ cordova.exec(fn, null, 'BackgroundMode', 'disable', []);
+};
+
+/**
+ * Enable or disable the background mode.
+ *
+ * @param [ Bool ] enable The status to set for.
+ *
+ * @return [ Void ]
+ */
+exports.setEnabled = function (enable)
+{
+ if (enable) {
+ this.enable();
+ } else {
+ this.disable();
+ }
+};
+
+/**
+ * List of all available options with their default value.
+ *
+ * @return [ Object ]
+ */
+exports.getDefaults = function()
+{
+ return this._defaults;
+};
+
+/**
+ * The actual applied settings.
+ *
+ * @return [ Object ]
+ */
+exports.getSettings = function()
+{
+ return this._settings || {};
+};
+
+/**
+ * Overwrite the default settings.
+ *
+ * @param [ Object ] overrides Dict of options to be overridden.
+ *
+ * @return [ Void ]
+ */
+exports.setDefaults = function (overrides)
+{
+ var defaults = this.getDefaults();
+
+ for (var key in defaults)
+ {
+ if (overrides.hasOwnProperty(key))
+ {
+ defaults[key] = overrides[key];
+ }
+ }
+
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundMode', 'configure', [defaults, false]);
+ }
+};
+
+/**
+ * Configures the notification settings for Android.
+ * Will be merged with the defaults.
+ *
+ * @param [ Object ] options Dict of options to be overridden.
+ *
+ * @return [ Void ]
+ */
+exports.configure = function (options)
+{
+ var settings = this.getSettings(),
+ defaults = this.getDefaults();
+
+ if (!this._isAndroid)
+ return;
+
+ if (!this._isActive)
+ {
+ console.log('BackgroundMode is not active, skipped...');
+ return;
+ }
+
+ this._mergeObjects(options, settings);
+ this._mergeObjects(options, defaults);
+ this._settings = options;
+
+ cordova.exec(null, null, 'BackgroundMode', 'configure', [options, true]);
+};
+
+/**
+ * Enable GPS-tracking in background (Android).
+ *
+ * @return [ Void ]
+ */
+exports.disableWebViewOptimizations = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'webview', []);
+ }
+};
+
+/**
+ * Disables battery optimazation mode for the app.
+ *
+ * @return [ Void ]
+ */
+exports.disableBatteryOptimizations = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'battery', []);
+ }
+};
+
+/**
+ * Opens the system settings dialog where the user can tweak or turn off any
+ * custom app start settings added by the manufacturer if available.
+ *
+ * @param [ Object|Bool ] options Set to false if you dont want to display an
+ * alert dialog first.
+ *
+ * @return [ Void ]
+ */
+exports.openAppStartSettings = function (options)
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'appstart', [options]);
+ }
+};
+
+/**
+ * Move app to background (Android only).
+ *
+ * @return [ Void ]
+ */
+exports.moveToBackground = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'background', []);
+ }
+};
+
+/**
+ * Move app to foreground when in background (Android only).
+ *
+ * @return [ Void ]
+ */
+exports.moveToForeground = function()
+{
+ if (this.isActive() && this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'foreground', []);
+ }
+};
+
+/**
+ * Exclude the app from the recent tasks list (Android only).
+ *
+ * @return [ Void ]
+ */
+exports.excludeFromTaskList = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'tasklist', []);
+ }
+};
+
+/**
+ * Override the back button on Android to go to background
+ * instead of closing the app.
+ *
+ * @return [ Void ]
+ */
+exports.overrideBackButton = function()
+{
+ document.addEventListener('backbutton', function() {
+ exports.moveToBackground();
+ }, false);
+};
+
+/**
+ * If the screen is off.
+ *
+ * @param [ Function ] fn Callback function to invoke with boolean arg.
+ *
+ * @return [ Void ]
+ */
+exports.isScreenOff = function (fn)
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(fn, null, 'BackgroundModeExt', 'dimmed', []);
+ }
+ else
+ {
+ fn(undefined);
+ }
+};
+
+/**
+ * Wake up the device.
+ *
+ * @return [ Void ]
+ */
+exports.wakeUp = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'wakeup', []);
+ }
+};
+
+/**
+ * Wake up and unlock the device.
+ *
+ * @return [ Void ]
+ */
+exports.unlock = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'unlock', []);
+ }
+};
+
+/**
+ * If the mode is enabled or disabled.
+ *
+ * @return [ Boolean ]
+ */
+exports.isEnabled = function()
+{
+ return this._isEnabled !== false;
+};
+
+/**
+ * If the mode is active.
+ *
+ * @return [ Boolean ]
+ */
+exports.isActive = function()
+{
+ return this._isActive !== false;
+};
+
+exports._listener = {};
+
+/**
+ * Fire event with given arguments.
+ *
+ * @param [ String ] event The event's name.
+ * @param [ Array<Object> ] The callback's arguments.
+ *
+ * @return [ Void ]
+ */
+exports.fireEvent = function (event)
+{
+ var args = Array.apply(null, arguments).slice(1),
+ listener = this._listener[event];
+
+ if (!listener)
+ return;
+
+ for (var i = 0; i < listener.length; i++)
+ {
+ var fn = listener[i][0],
+ scope = listener[i][1];
+
+ fn.apply(scope, args);
+ }
+};
+
+/**
+ * Register callback for given event.
+ *
+ * @param [ String ] event The event's name.
+ * @param [ Function ] callback The function to be exec as callback.
+ * @param [ Object ] scope The callback function's scope.
+ *
+ * @return [ Void ]
+ */
+exports.on = function (event, callback, scope)
+{
+ if (typeof callback !== "function")
+ return;
+
+ if (!this._listener[event])
+ {
+ this._listener[event] = [];
+ }
+
+ var item = [callback, scope || window];
+
+ this._listener[event].push(item);
+};
+
+/**
+ * Unregister callback for given event.
+ *
+ * @param [ String ] event The event's name.
+ * @param [ Function ] callback The function to be exec as callback.
+ *
+ * @return [ Void ]
+ */
+exports.un = function (event, callback)
+{
+ var listener = this._listener[event];
+
+ if (!listener)
+ return;
+
+ for (var i = 0; i < listener.length; i++)
+ {
+ var fn = listener[i][0];
+
+ if (fn == callback)
+ {
+ listener.splice(i, 1);
+ break;
+ }
+ }
+};
+
+/**
+ * @private
+ *
+ * Flag indicates if the mode is enabled.
+ */
+exports._isEnabled = false;
+
+/**
+ * @private
+ *
+ * Flag indicates if the mode is active.
+ */
+exports._isActive = false;
+
+/**
+ * @private
+ *
+ * Default values of all available options.
+ */
+exports._defaults =
+{
+ title: 'App is running in background',
+ text: 'Doing heavy tasks.',
+ bigText: false,
+ resume: true,
+ silent: false,
+ hidden: true,
+ color: undefined,
+ icon: 'icon'
+};
+
+/**
+ * @private
+ *
+ * Merge settings with default values.
+ *
+ * @param [ Object ] options The custom options.
+ * @param [ Object ] toMergeIn The options to merge in.
+ *
+ * @return [ Object ] Default values merged with custom values.
+ */
+exports._mergeObjects = function (options, toMergeIn)
+{
+ for (var key in toMergeIn)
+ {
+ if (!options.hasOwnProperty(key))
+ {
+ options[key] = toMergeIn[key];
+ continue;
+ }
+ }
+
+ return options;
+};
+
+/**
+ * @private
+ *
+ * Setter for the isActive flag. Resets the
+ * settings if the mode isnt active anymore.
+ *
+ * @param [ Boolean] value The new value for the flag.
+ *
+ * @return [ Void ]
+ */
+exports._setActive = function(value)
+{
+ if (this._isActive == value)
+ return;
+
+ this._isActive = value;
+ this._settings = value ? this._mergeObjects({}, this._defaults) : {};
+};
+
+/**
+ * @private
+ *
+ * Initialize the plugin.
+ *
+ * Method should be called after the 'deviceready' event
+ * but before the event listeners will be called.
+ *
+ * @return [ Void ]
+ */
+exports._pluginInitialize = function()
+{
+ this._isAndroid = device.platform.match(/^android|amazon/i) !== null;
+ this.setDefaults({});
+
+ if (device.platform == 'browser')
+ {
+ this.enable();
+ this._isEnabled = true;
+ }
+
+ this._isActive = this._isActive || device.platform == 'browser';
+};
+
+// Called before 'deviceready' listener will be called
+channel.onCordovaReady.subscribe(function()
+{
+ channel.onCordovaInfoReady.subscribe(function() {
+ exports._pluginInitialize();
+ });
+});
+
+// Called after 'deviceready' event
+channel.deviceready.subscribe(function()
+{
+ if (exports.isEnabled())
+ {
+ exports.fireEvent('enable');
+ }
+
+ if (exports.isActive())
+ {
+ exports.fireEvent('activate');
+ }
+});
+
+});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/Camera.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/Camera.js
new file mode 100644
index 000000000..3f614ec80
--- /dev/null
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/Camera.js
@@ -0,0 +1,188 @@
+cordova.define("cordova-plugin-camera.camera", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var argscheck = require('cordova/argscheck');
+var exec = require('cordova/exec');
+var Camera = require('./Camera');
+// XXX: commented out
+// CameraPopoverHandle = require('./CameraPopoverHandle');
+
+/**
+ * @namespace navigator
+ */
+
+/**
+ * @exports camera
+ */
+var cameraExport = {};
+
+// Tack on the Camera Constants to the base camera plugin.
+for (var key in Camera) {
+ cameraExport[key] = Camera[key];
+}
+
+/**
+ * Callback function that provides an error message.
+ * @callback module:camera.onError
+ * @param {string} message - The message is provided by the device's native code.
+ */
+
+/**
+ * Callback function that provides the image data.
+ * @callback module:camera.onSuccess
+ * @param {string} imageData - Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`]{@link module:camera.CameraOptions} in effect.
+ * @example
+ * // Show image
+ * //
+ * function cameraCallback(imageData) {
+ * var image = document.getElementById('myImage');
+ * image.src = "data:image/jpeg;base64," + imageData;
+ * }
+ */
+
+/**
+ * Optional parameters to customize the camera settings.
+ * * [Quirks](#CameraOptions-quirks)
+ * @typedef module:camera.CameraOptions
+ * @type {Object}
+ * @property {number} [quality=50] - Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.)
+ * @property {module:Camera.DestinationType} [destinationType=FILE_URI] - Choose the format of the return value.
+ * @property {module:Camera.PictureSourceType} [sourceType=CAMERA] - Set the source of the picture.
+ * @property {Boolean} [allowEdit=false] - Allow simple editing of image before selection.
+ * @property {module:Camera.EncodingType} [encodingType=JPEG] - Choose the returned image file's encoding.
+ * @property {number} [targetWidth] - Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant.
+ * @property {number} [targetHeight] - Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant.
+ * @property {module:Camera.MediaType} [mediaType=PICTURE] - Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`.
+ * @property {Boolean} [correctOrientation] - Rotate the image to correct for the orientation of the device during capture.
+ * @property {Boolean} [saveToPhotoAlbum] - Save the image to the photo album on the device after capture.
+ * @property {module:CameraPopoverOptions} [popoverOptions] - iOS-only options that specify popover location in iPad.
+ * @property {module:Camera.Direction} [cameraDirection=BACK] - Choose the camera to use (front- or back-facing).
+ */
+
+/**
+ * @description Takes a photo using the camera, or retrieves a photo from the device's
+ * image gallery. The image is passed to the success callback as a
+ * Base64-encoded `String`, or as the URI for the image file.
+ *
+ * The `camera.getPicture` function opens the device's default camera
+ * application that allows users to snap pictures by default - this behavior occurs,
+ * when `Camera.sourceType` equals [`Camera.PictureSourceType.CAMERA`]{@link module:Camera.PictureSourceType}.
+ * Once the user snaps the photo, the camera application closes and the application is restored.
+ *
+ * If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
+ * `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
+ * that allows users to select an existing image.
+ *
+ * The return value is sent to the [`cameraSuccess`]{@link module:camera.onSuccess} callback function, in
+ * one of the following formats, depending on the specified
+ * `cameraOptions`:
+ *
+ * - A `String` containing the Base64-encoded photo image.
+ * - A `String` representing the image file location on local storage (default).
+ *
+ * You can do whatever you want with the encoded image or URI, for
+ * example:
+ *
+ * - Render the image in an `<img>` tag, as in the example below
+ * - Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
+ * - Post the data to a remote server
+ *
+ * __NOTE__: Photo resolution on newer devices is quite good. Photos
+ * selected from the device's gallery are not downscaled to a lower
+ * quality, even if a `quality` parameter is specified. To avoid common
+ * memory problems, set `Camera.destinationType` to `FILE_URI` rather
+ * than `DATA_URL`.
+ *
+ * __Supported Platforms__
+ *
+ * - Android
+ * - BlackBerry
+ * - Browser
+ * - Firefox
+ * - FireOS
+ * - iOS
+ * - Windows
+ * - WP8
+ * - Ubuntu
+ *
+ * More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
+ *
+ * @example
+ * navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
+ * @param {module:camera.onSuccess} successCallback
+ * @param {module:camera.onError} errorCallback
+ * @param {module:camera.CameraOptions} options CameraOptions
+ */
+cameraExport.getPicture = function (successCallback, errorCallback, options) {
+ argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
+ options = options || {};
+ var getValue = argscheck.getValue;
+
+ var quality = getValue(options.quality, 50);
+ var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
+ var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
+ var targetWidth = getValue(options.targetWidth, -1);
+ var targetHeight = getValue(options.targetHeight, -1);
+ var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
+ var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
+ var allowEdit = !!options.allowEdit;
+ var correctOrientation = !!options.correctOrientation;
+ var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
+ var popoverOptions = getValue(options.popoverOptions, null);
+ var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
+
+ var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
+ mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
+
+ exec(successCallback, errorCallback, 'Camera', 'takePicture', args);
+ // XXX: commented out
+ // return new CameraPopoverHandle();
+};
+
+/**
+ * Removes intermediate image files that are kept in temporary storage
+ * after calling [`camera.getPicture`]{@link module:camera.getPicture}. Applies only when the value of
+ * `Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
+ * `Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.
+ *
+ * __Supported Platforms__
+ *
+ * - iOS
+ *
+ * @example
+ * navigator.camera.cleanup(onSuccess, onFail);
+ *
+ * function onSuccess() {
+ * console.log("Camera cleanup success.")
+ * }
+ *
+ * function onFail(message) {
+ * alert('Failed because: ' + message);
+ * }
+ */
+cameraExport.cleanup = function (successCallback, errorCallback) {
+ exec(successCallback, errorCallback, 'Camera', 'cleanup', []);
+};
+
+module.exports = cameraExport;
+
+});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js
new file mode 100644
index 000000000..4f4b046f1
--- /dev/null
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraConstants.js
@@ -0,0 +1,104 @@
+cordova.define("cordova-plugin-camera.Camera", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/**
+ * @module Camera
+ */
+module.exports = {
+ /**
+ * @description
+ * Defines the output format of `Camera.getPicture` call.
+ * _Note:_ On iOS passing `DestinationType.NATIVE_URI` along with
+ * `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM` will
+ * disable any image modifications (resize, quality change, cropping, etc.) due
+ * to implementation specific.
+ *
+ * @enum {number}
+ */
+ DestinationType: {
+ /** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible */
+ DATA_URL: 0,
+ /** Return file uri (content://media/external/images/media/2 for Android) */
+ FILE_URI: 1,
+ /** Return native uri (eg. asset-library://... for iOS) */
+ NATIVE_URI: 2
+ },
+ /**
+ * @enum {number}
+ */
+ EncodingType: {
+ /** Return JPEG encoded image */
+ JPEG: 0,
+ /** Return PNG encoded image */
+ PNG: 1
+ },
+ /**
+ * @enum {number}
+ */
+ MediaType: {
+ /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
+ PICTURE: 0,
+ /** Allow selection of video only, ONLY RETURNS URL */
+ VIDEO: 1,
+ /** Allow selection from all media types */
+ ALLMEDIA: 2
+ },
+ /**
+ * @description
+ * Defines the output format of `Camera.getPicture` call.
+ * _Note:_ On iOS passing `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM`
+ * along with `DestinationType.NATIVE_URI` will disable any image modifications (resize, quality
+ * change, cropping, etc.) due to implementation specific.
+ *
+ * @enum {number}
+ */
+ PictureSourceType: {
+ /** Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android) */
+ PHOTOLIBRARY: 0,
+ /** Take picture from camera */
+ CAMERA: 1,
+ /** Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android) */
+ SAVEDPHOTOALBUM: 2
+ },
+ /**
+ * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
+ * @enum {number}
+ */
+ PopoverArrowDirection: {
+ ARROW_UP: 1,
+ ARROW_DOWN: 2,
+ ARROW_LEFT: 4,
+ ARROW_RIGHT: 8,
+ ARROW_ANY: 15
+ },
+ /**
+ * @enum {number}
+ */
+ Direction: {
+ /** Use the back-facing camera */
+ BACK: 0,
+ /** Use the front-facing camera */
+ FRONT: 1
+ }
+};
+
+});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
new file mode 100644
index 000000000..6e03c52ee
--- /dev/null
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
@@ -0,0 +1,59 @@
+cordova.define("cordova-plugin-camera.CameraPopoverOptions", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var Camera = require('./Camera');
+
+/**
+ * @namespace navigator
+ */
+
+/**
+ * iOS-only parameters that specify the anchor element location and arrow
+ * direction of the popover when selecting images from an iPad's library
+ * or album.
+ * Note that the size of the popover may change to adjust to the
+ * direction of the arrow and orientation of the screen. Make sure to
+ * account for orientation changes when specifying the anchor element
+ * location.
+ * @module CameraPopoverOptions
+ * @param {Number} [x=0] - x pixel coordinate of screen element onto which to anchor the popover.
+ * @param {Number} [y=32] - y pixel coordinate of screen element onto which to anchor the popover.
+ * @param {Number} [width=320] - width, in pixels, of the screen element onto which to anchor the popover.
+ * @param {Number} [height=480] - height, in pixels, of the screen element onto which to anchor the popover.
+ * @param {module:Camera.PopoverArrowDirection} [arrowDir=ARROW_ANY] - Direction the arrow on the popover should point.
+ * @param {Number} [popoverWidth=0] - width of the popover (0 or not specified will use apple's default width).
+ * @param {Number} [popoverHeight=0] - height of the popover (0 or not specified will use apple's default height).
+ */
+var CameraPopoverOptions = function (x, y, width, height, arrowDir, popoverWidth, popoverHeight) {
+ // information of rectangle that popover should be anchored to
+ this.x = x || 0;
+ this.y = y || 32;
+ this.width = width || 320;
+ this.height = height || 480;
+ this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY;
+ this.popoverWidth = popoverWidth || 0;
+ this.popoverHeight = popoverHeight || 0;
+};
+
+module.exports = CameraPopoverOptions;
+
+});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js
new file mode 100644
index 000000000..6da9fa35d
--- /dev/null
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js
@@ -0,0 +1,69 @@
+cordova.define("cordova-plugin-camera.CameraPopoverHandle", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var exec = require('cordova/exec');
+
+/**
+ * @namespace navigator
+ */
+
+/**
+ * A handle to an image picker popover.
+ *
+ * __Supported Platforms__
+ *
+ * - iOS
+ *
+ * @example
+ * navigator.camera.getPicture(onSuccess, onFail,
+ * {
+ * destinationType: Camera.DestinationType.FILE_URI,
+ * sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
+ * popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY, 300, 600)
+ * });
+ *
+ * // Reposition the popover if the orientation changes.
+ * window.onorientationchange = function() {
+ * var cameraPopoverHandle = new CameraPopoverHandle();
+ * var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY, 400, 500);
+ * cameraPopoverHandle.setPosition(cameraPopoverOptions);
+ * }
+ * @module CameraPopoverHandle
+ */
+var CameraPopoverHandle = function () {
+ /**
+ * Can be used to reposition the image selection dialog,
+ * for example, when the device orientation changes.
+ * @memberof CameraPopoverHandle
+ * @instance
+ * @method setPosition
+ * @param {module:CameraPopoverOptions} popoverOptions
+ */
+ this.setPosition = function (popoverOptions) {
+ var args = [ popoverOptions ];
+ exec(null, null, 'Camera', 'repositionPopover', args);
+ };
+};
+
+module.exports = CameraPopoverHandle;
+
+});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-device/www/device.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-device/www/device.js
new file mode 100644
index 000000000..ae48e3546
--- /dev/null
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-device/www/device.js
@@ -0,0 +1,86 @@
+cordova.define("cordova-plugin-device.device", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var argscheck = require('cordova/argscheck');
+var channel = require('cordova/channel');
+var utils = require('cordova/utils');
+var exec = require('cordova/exec');
+var cordova = require('cordova');
+
+channel.createSticky('onCordovaInfoReady');
+// Tell cordova channel to wait on the CordovaInfoReady event
+channel.waitForInitialization('onCordovaInfoReady');
+
+/**
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
+ * phone, etc.
+ * @constructor
+ */
+function Device () {
+ this.available = false;
+ this.platform = null;
+ this.version = null;
+ this.uuid = null;
+ this.cordova = null;
+ this.model = null;
+ this.manufacturer = null;
+ this.isVirtual = null;
+ this.serial = null;
+
+ var me = this;
+
+ channel.onCordovaReady.subscribe(function () {
+ me.getInfo(function (info) {
+ // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
+ // TODO: CB-5105 native implementations should not return info.cordova
+ var buildLabel = cordova.version;
+ me.available = true;
+ me.platform = info.platform;
+ me.version = info.version;
+ me.uuid = info.uuid;
+ me.cordova = buildLabel;
+ me.model = info.model;
+ me.isVirtual = info.isVirtual;
+ me.manufacturer = info.manufacturer || 'unknown';
+ me.serial = info.serial || 'unknown';
+ channel.onCordovaInfoReady.fire();
+ }, function (e) {
+ me.available = false;
+ utils.alert('[ERROR] Error initializing Cordova: ' + e);
+ });
+ });
+}
+
+/**
+ * Get device info
+ *
+ * @param {Function} successCallback The function to call when the heading data is available
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
+ */
+Device.prototype.getInfo = function (successCallback, errorCallback) {
+ argscheck.checkArgs('fF', 'Device.getInfo', arguments);
+ exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
+};
+
+module.exports = new Device();
+
+});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js
new file mode 100644
index 000000000..395c4d973
--- /dev/null
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js
@@ -0,0 +1,54 @@
+cordova.define("cordova-plugin-file-opener2.FileOpener2", function(require, exports, module) {
+/*jslint browser: true, devel: true, node: true, sloppy: true, plusplus: true*/
+/*global require, cordova */
+/*
+The MIT License (MIT)
+
+Copyright (c) 2013 pwlin - [email protected]
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+var exec = require('cordova/exec');
+
+function FileOpener2() {}
+
+FileOpener2.prototype.open = function (fileName, contentType, callbackContext) {
+ contentType = contentType || '';
+ callbackContext = callbackContext || {};
+ exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType]);
+};
+
+FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) {
+ contentType = contentType || '';
+ callbackContext = callbackContext || {};
+ exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false, callbackContext.position || [0, 0]]);
+};
+
+FileOpener2.prototype.uninstall = function (packageId, callbackContext) {
+ callbackContext = callbackContext || {};
+ exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'uninstall', [packageId]);
+};
+
+FileOpener2.prototype.appIsInstalled = function (packageId, callbackContext) {
+ callbackContext = callbackContext || {};
+ exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'appIsInstalled', [packageId]);
+};
+
+module.exports = new FileOpener2();
+
+});
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js
index fcd620c74..bb676eb6c 100644
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/DirectoryEntry.js
@@ -37,6 +37,7 @@ var DirectoryReader = require('./DirectoryReader');
* {FileSystem} filesystem on which the directory resides (readonly)
*/
var DirectoryEntry = function (name, fullPath, fileSystem, nativeURL) {
+
// add trailing slash if it is missing
if ((fullPath) && !/\/$/.test(fullPath)) {
fullPath += '/';
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Entry.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Entry.js
index 5db846cfa..b296d999e 100644
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Entry.js
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/Entry.js
@@ -152,7 +152,7 @@ Entry.prototype.copyTo = function (parent, newName, successCallback, errorCallba
errorCallback(new FileError(code));
};
var srcURL = this.toInternalURL();
- // entry name
+ // entry name
var name = newName || this.name;
// success callback
var success = function (entry) {
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileReader.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileReader.js
index 36d4dd4e6..5c030913b 100644
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileReader.js
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileReader.js
@@ -76,24 +76,12 @@ function defineEvent (eventName) {
this._realReader[eventName] = value;
});
}
-
-// When the read starts.
-defineEvent('onloadstart');
-
-// While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total)
-defineEvent('onprogress');
-
-// When the read has successfully completed.
-defineEvent('onload');
-
-// When the read has failed (see errors).
-defineEvent('onerror');
-
-// When the request has completed (either in success or failure).
-defineEvent('onloadend');
-
-// When the read has been aborted. For instance, by invoking the abort() method.
-defineEvent('onabort');
+defineEvent('onloadstart'); // When the read starts.
+defineEvent('onprogress'); // While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total)
+defineEvent('onload'); // When the read has successfully completed.
+defineEvent('onerror'); // When the read has failed (see errors).
+defineEvent('onloadend'); // When the request has completed (either in success or failure).
+defineEvent('onabort'); // When the read has been aborted. For instance, by invoking the abort() method.
function initRead (reader, file) {
// Already loading something
@@ -114,7 +102,7 @@ function initRead (reader, file) {
}
if (reader.onloadstart) {
- reader.onloadstart(new ProgressEvent('loadstart', { target: reader }));
+ reader.onloadstart(new ProgressEvent('loadstart', {target: reader}));
}
}
@@ -138,12 +126,10 @@ function readSuccessCallback (readType, encoding, offset, totalSize, accumulate,
if (readType === 'readAsDataURL') {
// Windows proxy does not support reading file slices as Data URLs
// so read the whole file at once.
- CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize // eslint-disable-line no-undef
- : (
- // Calculate new chunk size for data URLs to be multiply of 3
- // Otherwise concatenated base64 chunks won't be valid base64 data
- FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3
- );
+ CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize : // eslint-disable-line no-undef
+ // Calculate new chunk size for data URLs to be multiply of 3
+ // Otherwise concatenated base64 chunks won't be valid base64 data
+ FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3;
}
if (typeof r !== 'undefined') {
@@ -151,7 +137,7 @@ function readSuccessCallback (readType, encoding, offset, totalSize, accumulate,
this._progress = Math.min(this._progress + CHUNK_SIZE, totalSize);
if (typeof this.onprogress === 'function') {
- this.onprogress(new ProgressEvent('progress', { loaded: this._progress, total: totalSize }));
+ this.onprogress(new ProgressEvent('progress', {loaded: this._progress, total: totalSize}));
}
}
@@ -171,11 +157,11 @@ function readSuccessCallback (readType, encoding, offset, totalSize, accumulate,
this._readyState = FileReader.DONE;
if (typeof this.onload === 'function') {
- this.onload(new ProgressEvent('load', { target: this }));
+ this.onload(new ProgressEvent('load', {target: this}));
}
if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', { target: this }));
+ this.onloadend(new ProgressEvent('loadend', {target: this}));
}
}
}
@@ -194,11 +180,11 @@ function readFailureCallback (e) {
this._error = new FileError(e);
if (typeof this.onerror === 'function') {
- this.onerror(new ProgressEvent('error', { target: this }));
+ this.onerror(new ProgressEvent('error', {target: this}));
}
if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', { target: this }));
+ this.onloadend(new ProgressEvent('loadend', {target: this}));
}
}
@@ -219,11 +205,11 @@ FileReader.prototype.abort = function () {
// If abort callback
if (typeof this.onabort === 'function') {
- this.onabort(new ProgressEvent('abort', { target: this }));
+ this.onabort(new ProgressEvent('abort', {target: this}));
}
// If load end callback
if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', { target: this }));
+ this.onloadend(new ProgressEvent('loadend', {target: this}));
}
};
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileWriter.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileWriter.js
index 9f141e085..c3e856219 100644
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileWriter.js
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/FileWriter.js
@@ -54,23 +54,12 @@ var FileWriter = function (file) {
this.error = null;
// Event handlers
- // When writing starts
- this.onwritestart = null;
-
- // While writing the file, and reporting partial file data
- this.onprogress = null;
-
- // When the write has successfully completed.
- this.onwrite = null;
-
- // When the request has completed (either in success or failure).
- this.onwriteend = null;
-
- // When the write has been aborted. For instance, by invoking the abort() method.
- this.onabort = null;
-
- // When the write has failed (see errors).
- this.onerror = null;
+ this.onwritestart = null; // When writing starts
+ this.onprogress = null; // While writing the file, and reporting partial file data
+ this.onwrite = null; // When the write has successfully completed.
+ this.onwriteend = null; // When the request has completed (either in success or failure).
+ this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method.
+ this.onerror = null; // When the write has failed (see errors).
};
// States
@@ -94,12 +83,12 @@ FileWriter.prototype.abort = function () {
// If abort callback
if (typeof this.onabort === 'function') {
- this.onabort(new ProgressEvent('abort', { target: this }));
+ this.onabort(new ProgressEvent('abort', {'target': this}));
}
// If write end callback
if (typeof this.onwriteend === 'function') {
- this.onwriteend(new ProgressEvent('writeend', { target: this }));
+ this.onwriteend(new ProgressEvent('writeend', {'target': this}));
}
};
@@ -110,6 +99,7 @@ FileWriter.prototype.abort = function () {
* @param isPendingBlobReadResult {Boolean} true if the data is the pending blob read operation result
*/
FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
+
var that = this;
var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
/* eslint-disable no-undef */
@@ -133,12 +123,12 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
// If onerror callback
if (typeof that.onerror === 'function') {
- that.onerror(new ProgressEvent('error', { target: that }));
+ that.onerror(new ProgressEvent('error', {'target': that}));
}
// If onwriteend callback
if (typeof that.onwriteend === 'function') {
- that.onwriteend(new ProgressEvent('writeend', { target: that }));
+ that.onwriteend(new ProgressEvent('writeend', {'target': that}));
}
};
@@ -172,7 +162,7 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
// If onwritestart callback
if (typeof me.onwritestart === 'function') {
- me.onwritestart(new ProgressEvent('writestart', { target: me }));
+ me.onwritestart(new ProgressEvent('writestart', {'target': me}));
}
// Write file
@@ -195,12 +185,12 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
// If onwrite callback
if (typeof me.onwrite === 'function') {
- me.onwrite(new ProgressEvent('write', { target: me }));
+ me.onwrite(new ProgressEvent('write', {'target': me}));
}
// If onwriteend callback
if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', { target: me }));
+ me.onwriteend(new ProgressEvent('writeend', {'target': me}));
}
},
// Error callback
@@ -218,12 +208,12 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
// If onerror callback
if (typeof me.onerror === 'function') {
- me.onerror(new ProgressEvent('error', { target: me }));
+ me.onerror(new ProgressEvent('error', {'target': me}));
}
// If onwriteend callback
if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', { target: me }));
+ me.onwriteend(new ProgressEvent('writeend', {'target': me}));
}
}, 'File', 'write', [this.localURL, data, this.position, isBinary]);
};
@@ -279,7 +269,7 @@ FileWriter.prototype.truncate = function (size) {
// If onwritestart callback
if (typeof me.onwritestart === 'function') {
- me.onwritestart(new ProgressEvent('writestart', { target: this }));
+ me.onwritestart(new ProgressEvent('writestart', {'target': this}));
}
// Write file
@@ -300,12 +290,12 @@ FileWriter.prototype.truncate = function (size) {
// If onwrite callback
if (typeof me.onwrite === 'function') {
- me.onwrite(new ProgressEvent('write', { target: me }));
+ me.onwrite(new ProgressEvent('write', {'target': me}));
}
// If onwriteend callback
if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', { target: me }));
+ me.onwriteend(new ProgressEvent('writeend', {'target': me}));
}
},
// Error callback
@@ -323,12 +313,12 @@ FileWriter.prototype.truncate = function (size) {
// If onerror callback
if (typeof me.onerror === 'function') {
- me.onerror(new ProgressEvent('error', { target: me }));
+ me.onerror(new ProgressEvent('error', {'target': me}));
}
// If onwriteend callback
if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', { target: me }));
+ me.onwriteend(new ProgressEvent('writeend', {'target': me}));
}
}, 'File', 'truncate', [this.localURL, size]);
};
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
index 494de62ff..73715bc0e 100644
--- a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
@@ -70,7 +70,7 @@ cordova.define("cordova-plugin-file.resolveLocalFileSystemURI", function(require
fileSystems.getFs(fsName, function (fs) {
// This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
if (!fs) {
- fs = new FileSystem(fsName, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
+ fs = new FileSystem(fsName, {name: '', fullPath: '/'}); // eslint-disable-line no-undef
}
var result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath, fs, entry.nativeURL) : new FileEntry(entry.name, entry.fullPath, fs, entry.nativeURL);
successCallback(result);
diff --git a/cordova/platforms/ios/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js
new file mode 100644
index 000000000..d16bfdc1c
--- /dev/null
+++ b/cordova/platforms/ios/platform_www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js
@@ -0,0 +1,160 @@
+cordova.define("cordova-plugin-x-socialsharing.SocialSharing", function(require, exports, module) {
+function SocialSharing() {
+}
+
+// Override this method (after deviceready) to set the location where you want the iPad popup arrow to appear.
+// If not overridden with different values, the popup is not used. Example:
+//
+// window.plugins.socialsharing.iPadPopupCoordinates = function() {
+// return "100,100,200,300";
+// };
+SocialSharing.prototype.iPadPopupCoordinates = function () {
+ // left,top,width,height
+ return "-1,-1,-1,-1";
+};
+
+SocialSharing.prototype.setIPadPopupCoordinates = function (coords) {
+ console.log("Deprecated - setIPadPopupCoordinates no longer works since plugin version 5.5.0. See https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/1052");
+ // left,top,width,height
+ cordova.exec(function() {}, this._getErrorCallback(function() {}, "setIPadPopupCoordinates"), "SocialSharing", "setIPadPopupCoordinates", [coords]);
+};
+
+SocialSharing.prototype.available = function (callback) {
+ cordova.exec(function (avail) {
+ callback(avail ? true : false);
+ }, null, "SocialSharing", "available", []);
+};
+
+// this is the recommended way to share as it is the most feature-rich with respect to what you pass in and get back
+SocialSharing.prototype.shareWithOptions = function (options, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareWithOptions"), "SocialSharing", "shareWithOptions", [options]);
+};
+
+SocialSharing.prototype.shareW3C = function (sharedata) {
+ return new Promise(function(resolve, reject) {
+ var options = {
+ subject: sharedata.title,
+ message: sharedata.text,
+ url: sharedata.url,
+ iPadCoordinates: sharedata.iPadCoordinates || undefined
+ };
+ if(sharedata.hasOwnProperty('title') ||
+ sharedata.hasOwnProperty('text') ||
+ sharedata.hasOwnProperty('url')) {
+ cordova.exec(resolve, reject, "SocialSharing", "shareWithOptions", [options]);
+ } else {
+ reject();
+ }
+ });
+};
+
+SocialSharing.prototype.share = function (message, subject, fileOrFileArray, url, iPadCoordinates, successCallback, errorCallback) {
+ if (typeof iPadCoordinates === 'function') {
+ errorCallback = successCallback;
+ successCallback = iPadCoordinates;
+ iPadCoordinates = "";
+ }
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "share"), "SocialSharing", "share", [message, subject, this._asArray(fileOrFileArray), url, iPadCoordinates]);
+};
+
+SocialSharing.prototype.shareViaTwitter = function (message, file /* multiple not allowed by twitter */, url, successCallback, errorCallback) {
+ var fileArray = this._asArray(file);
+ var ecb = this._getErrorCallback(errorCallback, "shareViaTwitter");
+ if (fileArray.length > 1) {
+ ecb("shareViaTwitter supports max one file");
+ } else {
+ cordova.exec(successCallback, ecb, "SocialSharing", "shareViaTwitter", [message, null, fileArray, url]);
+ }
+};
+
+SocialSharing.prototype.shareViaFacebook = function (message, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebook"), "SocialSharing", "shareViaFacebook", [message, null, this._asArray(fileOrFileArray), url]);
+};
+
+SocialSharing.prototype.shareViaFacebookWithPasteMessageHint = function (message, fileOrFileArray, url, pasteMessageHint, successCallback, errorCallback) {
+ pasteMessageHint = pasteMessageHint || "If you like you can paste a message from your clipboard";
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebookWithPasteMessageHint"), "SocialSharing", "shareViaFacebookWithPasteMessageHint", [message, null, this._asArray(fileOrFileArray), url, pasteMessageHint]);
+};
+
+SocialSharing.prototype.shareViaWhatsApp = function (message, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsApp"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null, null]);
+};
+
+SocialSharing.prototype.shareViaWhatsAppToReceiver = function (receiver, message, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToReceiver"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, receiver, null]);
+};
+
+SocialSharing.prototype.shareViaWhatsAppToPhone = function (phone, message, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToPhone"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null, phone]);
+};
+
+SocialSharing.prototype.shareViaSMS = function (options, phonenumbers, successCallback, errorCallback) {
+ var opts = options;
+ if (typeof options === "string") {
+ opts = {"message":options}; // for backward compatibility as the options param used to be the message
+ }
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaSMS"), "SocialSharing", "shareViaSMS", [opts, phonenumbers]);
+};
+
+SocialSharing.prototype.shareViaEmail = function (message, subject, toArray, ccArray, bccArray, fileOrFileArray, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaEmail"), "SocialSharing", "shareViaEmail", [message, subject, this._asArray(toArray), this._asArray(ccArray), this._asArray(bccArray), this._asArray(fileOrFileArray)]);
+};
+
+SocialSharing.prototype.canShareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareVia"), "SocialSharing", "canShareVia", [message, subject, this._asArray(fileOrFileArray), url, via]);
+};
+
+SocialSharing.prototype.canShareViaEmail = function (successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareViaEmail"), "SocialSharing", "canShareViaEmail", []);
+};
+
+SocialSharing.prototype.shareViaInstagram = function (message, fileOrFileArray, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaInstagram"), "SocialSharing", "shareViaInstagram", [message, null, this._asArray(fileOrFileArray), null]);
+};
+
+SocialSharing.prototype.shareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareVia"), "SocialSharing", "shareVia", [message, subject, this._asArray(fileOrFileArray), url, via]);
+};
+
+SocialSharing.prototype.saveToPhotoAlbum = function (fileOrFileArray, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "saveToPhotoAlbum"), "SocialSharing", "saveToPhotoAlbum", [this._asArray(fileOrFileArray)]);
+};
+
+SocialSharing.prototype._asArray = function (param) {
+ if (param == null) {
+ param = [];
+ } else if (typeof param === 'string') {
+ param = new Array(param);
+ }
+ return param;
+};
+
+SocialSharing.prototype._getErrorCallback = function (ecb, functionName) {
+ if (typeof ecb === 'function') {
+ return ecb;
+ } else {
+ return function (result) {
+ console.log("The injected error callback of '" + functionName + "' received: " + JSON.stringify(result));
+ }
+ }
+};
+
+SocialSharing.install = function () {
+ if (!window.plugins) {
+ window.plugins = {};
+ }
+
+ window.plugins.socialsharing = new SocialSharing();
+
+ // Note only polyfill navigator.share if it is not defined, since shareW3C implements L1 of the spec,
+ // and an existing navigator.share method could implement L2.
+ if (!navigator.share) {
+ navigator.share = window.plugins.socialsharing.shareW3C;
+ }
+
+ return window.plugins.socialsharing;
+};
+
+cordova.addConstructor(SocialSharing.install);
+
+});
diff --git a/cordova/platforms/ios/platform_www/plugins/es6-promise-plugin/www/promise.js b/cordova/platforms/ios/platform_www/plugins/es6-promise-plugin/www/promise.js
new file mode 100644
index 000000000..6cce47ae8
--- /dev/null
+++ b/cordova/platforms/ios/platform_www/plugins/es6-promise-plugin/www/promise.js
@@ -0,0 +1,13 @@
+cordova.define("es6-promise-plugin.Promise", function(require, exports, module) {
+/*!
+ * @overview es6-promise - a tiny implementation of Promises/A+.
+ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
+ * @license Licensed under MIT license
+ * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
+ * @version v4.2.2+97478eb6
+ */
+
+!function t(e,n,r){function o(u,s){if(!n[u]){if(!e[u]){var c="function"==typeof require&&require;if(!s&&c)return c(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var a=n[u]={exports:{}};e[u][0].call(a.exports,function(t){var n=e[u][1][t];return o(n?n:t)},a,a.exports,t,e,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t){void 0===window.Promise&&t("es6-promise").polyfill()},{"es6-promise":2}],2:[function(t,e,n){(function(r,o){!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.ES6Promise=r()}(this,function(){"use strict";function e(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function n(t){return"function"==typeof t}function i(t){J=t}function u(t){Q=t}function s(){return function(){return r.nextTick(h)}}function c(){return"undefined"!=typeof I?function(){I(h)}:l()}function f(){var t=0,e=new X(h),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function a(){var t=new MessageChannel;return t.port1.onmessage=h,function(){return t.port2.postMessage(0)}}function l(){var t=setTimeout;return function(){return t(h,1)}}function h(){for(var t=0;H>t;t+=2){var e=te[t],n=te[t+1];e(n),te[t]=void 0,te[t+1]=void 0}H=0}function p(){try{var e=t,n=e("vertx");return I=n.runOnLoop||n.runOnContext,c()}catch(r){return l()}}function d(t,e){var n=this,r=new this.constructor(y);void 0===r[ne]&&D(r);var o=n._state;if(o){var i=arguments[o-1];Q(function(){return L(o,r,i,n._result)})}else O(n,r,t,e);return r}function v(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(y);return E(n,t),n}function y(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function _(){return new TypeError("A promises callback cannot return that same promise.")}function w(t){try{return t.then}catch(e){return ue.error=e,ue}}function g(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function b(t,e,n){Q(function(t){var r=!1,o=g(n,e,function(n){r||(r=!0,e!==n?E(t,n):j(t,n))},function(e){r||(r=!0,x(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,x(t,o))},t)}function T(t,e){e._state===oe?j(t,e._result):e._state===ie?x(t,e._result):O(e,void 0,function(e){return E(t,e)},function(e){return x(t,e)})}function A(t,e,r){e.constructor===t.constructor&&r===d&&e.constructor.resolve===v?T(t,e):r===ue?(x(t,ue.error),ue.error=null):void 0===r?j(t,e):n(r)?b(t,e,r):j(t,e)}function E(t,n){t===n?x(t,m()):e(n)?A(t,n,w(n)):j(t,n)}function S(t){t._onerror&&t._onerror(t._result),M(t)}function j(t,e){t._state===re&&(t._result=e,t._state=oe,0!==t._subscribers.length&&Q(M,t))}function x(t,e){t._state===re&&(t._state=ie,t._result=e,Q(S,t))}function O(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+oe]=n,o[i+ie]=r,0===i&&t._state&&Q(M,t)}function M(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,u=0;u<e.length;u+=3)r=e[u],o=e[u+n],r?L(n,r,o,i):o(i);t._subscribers.length=0}}function P(){this.error=null}function C(t,e){try{return t(e)}catch(n){return se.error=n,se}}function L(t,e,r,o){var i=n(r),u=void 0,s=void 0,c=void 0,f=void 0;if(i){if(u=C(r,o),u===se?(f=!0,s=u.error,u.error=null):c=!0,e===u)return x(e,_()),void 0}else u=o,c=!0;e._state!==re||(i&&c?E(e,u):f?x(e,s):t===oe?j(e,u):t===ie&&x(e,u))}function k(t,e){try{e(function(e){E(t,e)},function(e){x(t,e)})}catch(n){x(t,n)}}function q(){return ce++}function D(t){t[ne]=ce++,t._state=void 0,t._result=void 0,t._subscribers=[]}function F(){return new Error("Array Methods must be provided an Array")}function F(){return new Error("Array Methods must be provided an Array")}function N(t){return new fe(this,t).promise}function U(t){var e=this;return G(t)?new e(function(n,r){for(var o=t.length,i=0;o>i;i++)e.resolve(t[i]).then(n,r)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})}function Y(t){var e=this,n=new e(y);return x(n,t),n}function K(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function W(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function z(){var t=void 0;if("undefined"!=typeof o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=ae}var B=void 0;B=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var G=B,H=0,I=void 0,J=void 0,Q=function(t,e){te[H]=t,te[H+1]=e,H+=2,2===H&&(J?J(h):ee())},R="undefined"!=typeof window?window:void 0,V=R||{},X=V.MutationObserver||V.WebKitMutationObserver,Z="undefined"==typeof self&&"undefined"!=typeof r&&"[object process]"==={}.toString.call(r),$="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,te=new Array(1e3),ee=void 0;ee=Z?s():X?f():$?a():void 0===R&&"function"==typeof t?p():l();var ne=Math.random().toString(36).substring(16),re=void 0,oe=1,ie=2,ue=new P,se=new P,ce=0,fe=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(y),this.promise[ne]||D(this.promise),G(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&j(this.promise,this._result))):x(this.promise,F())}return t.prototype._enumerate=function(t){for(var e=0;this._state===re&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===v){var o=w(t);if(o===d&&t._state!==re)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===ae){var i=new n(y);A(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===re&&(this._remaining--,t===ie?x(r,n):this._result[e]=n),0===this._remaining&&j(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;O(t,void 0,function(t){return n._settledAt(oe,e,t)},function(t){return n._settledAt(ie,e,t)})},t}(),ae=function(){function t(e){this[ne]=q(),this._result=this._state=void 0,this._subscribers=[],y!==e&&("function"!=typeof e&&K(),this instanceof t?k(this,e):W())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var e=this,n=e.constructor;return e.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})})},t}();return ae.prototype.then=d,ae.all=N,ae.race=U,ae.resolve=v,ae.reject=Y,ae._setScheduler=i,ae._setAsap=u,ae._asap=Q,ae.polyfill=z,ae.Promise=ae,ae})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],3:[function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(a===setTimeout)return setTimeout(t,0);if((a===n||!a)&&setTimeout)return a=setTimeout,setTimeout(t,0);try{return a(t,0)}catch(e){try{return a.call(null,t,0)}catch(e){return a.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function u(){v&&p&&(v=!1,p.length?d=p.concat(d):y=-1,d.length&&s())}function s(){if(!v){var t=o(u);v=!0;for(var e=d.length;e;){for(p=d,d=[];++y<e;)p&&p[y].run();y=-1,e=d.length}p=null,v=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function f(){}var a,l,h=e.exports={};!function(){try{a="function"==typeof setTimeout?setTimeout:n}catch(t){a=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(t){l=r}}();var p,d=[],v=!1,y=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||v||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=f,h.addListener=f,h.once=f,h.off=f,h.removeListener=f,h.removeAllListeners=f,h.emit=f,h.prependListener=f,h.prependOnceListener=f,h.listeners=function(){return[]},h.binding=function(){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}]},{},[1]);
+
+
+});
diff --git a/cordova/platforms/ios/www/cordova-js-src/exec.js b/cordova/platforms/ios/www/cordova-js-src/exec.js
deleted file mode 100644
index 466220d83..000000000
--- a/cordova/platforms/ios/www/cordova-js-src/exec.js
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Creates the exec bridge used to notify the native code of
- * commands.
- */
-var cordova = require('cordova');
-var utils = require('cordova/utils');
-var base64 = require('cordova/base64');
-
-function massageArgsJsToNative (args) {
- if (!args || utils.typeName(args) !== 'Array') {
- return args;
- }
- var ret = [];
- args.forEach(function (arg, i) {
- if (utils.typeName(arg) === 'ArrayBuffer') {
- ret.push({
- CDVType: 'ArrayBuffer',
- data: base64.fromArrayBuffer(arg)
- });
- } else {
- ret.push(arg);
- }
- });
- return ret;
-}
-
-function massageMessageNativeToJs (message) {
- if (message.CDVType === 'ArrayBuffer') {
- var stringToArrayBuffer = function (str) {
- var ret = new Uint8Array(str.length);
- for (var i = 0; i < str.length; i++) {
- ret[i] = str.charCodeAt(i);
- }
- return ret.buffer;
- };
- var base64ToArrayBuffer = function (b64) {
- return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef
- };
- message = base64ToArrayBuffer(message.data);
- }
- return message;
-}
-
-function convertMessageToArgsNativeToJs (message) {
- var args = [];
- if (!message || !Object.prototype.hasOwnProperty.call(message, 'CDVType')) {
- args.push(message);
- } else if (message.CDVType === 'MultiPart') {
- message.messages.forEach(function (e) {
- args.push(massageMessageNativeToJs(e));
- });
- } else {
- args.push(massageMessageNativeToJs(message));
- }
- return args;
-}
-
-var iOSExec = function () {
- var successCallback, failCallback, service, action, actionArgs;
- var callbackId = null;
- if (typeof arguments[0] !== 'string') {
- // FORMAT ONE
- successCallback = arguments[0];
- failCallback = arguments[1];
- service = arguments[2];
- action = arguments[3];
- actionArgs = arguments[4];
-
- // Since we need to maintain backwards compatibility, we have to pass
- // an invalid callbackId even if no callback was provided since plugins
- // will be expecting it. The Cordova.exec() implementation allocates
- // an invalid callbackId and passes it even if no callbacks were given.
- callbackId = 'INVALID';
- } else {
- throw new Error('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' + // eslint-disable-line
- 'cordova.exec(null, null, \'Service\', \'action\', [ arg1, arg2 ]);');
- }
-
- // If actionArgs is not provided, default to an empty array
- actionArgs = actionArgs || [];
-
- // Register the callbacks and add the callbackId to the positional
- // arguments if given.
- if (successCallback || failCallback) {
- callbackId = service + cordova.callbackId++;
- cordova.callbacks[callbackId] =
- { success: successCallback, fail: failCallback };
- }
-
- actionArgs = massageArgsJsToNative(actionArgs);
-
- // CB-10133 DataClone DOM Exception 25 guard (fast function remover)
- var command = [callbackId, service, action, JSON.parse(JSON.stringify(actionArgs))];
- window.webkit.messageHandlers.cordova.postMessage(command);
-};
-
-iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, debug) {
- var success = status === 0 || status === 1;
- var args = convertMessageToArgsNativeToJs(message);
- Promise.resolve().then(function () {
- cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line
- });
-};
-
-// for backwards compatibility
-iOSExec.nativeEvalAndFetch = function (func) {
- try {
- func();
- } catch (e) {
- console.log(e);
- }
-};
-
-// Proxy the exec for bridge changes. See CB-10106
-
-function cordovaExec () {
- var cexec = require('cordova/exec');
- var cexec_valid = (typeof cexec.nativeFetchMessages === 'function') && (typeof cexec.nativeEvalAndFetch === 'function') && (typeof cexec.nativeCallback === 'function');
- return (cexec_valid && execProxy !== cexec) ? cexec : iOSExec;
-}
-
-function execProxy () {
- cordovaExec().apply(null, arguments);
-}
-
-execProxy.nativeFetchMessages = function () {
- return cordovaExec().nativeFetchMessages.apply(null, arguments);
-};
-
-execProxy.nativeEvalAndFetch = function () {
- return cordovaExec().nativeEvalAndFetch.apply(null, arguments);
-};
-
-execProxy.nativeCallback = function () {
- return cordovaExec().nativeCallback.apply(null, arguments);
-};
-
-module.exports = execProxy;
diff --git a/cordova/platforms/ios/www/cordova-js-src/platform.js b/cordova/platforms/ios/www/cordova-js-src/platform.js
deleted file mode 100644
index 83868c81b..000000000
--- a/cordova/platforms/ios/www/cordova-js-src/platform.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
- id: 'ios',
- bootstrap: function () {
- // Attach the console polyfill that is iOS-only to window.console
- // see the file under plugin/ios/console.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/console', 'window.console');
-
- // Attach the wkwebkit utility to window.WkWebView
- // see the file under plugin/ios/wkwebkit.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/wkwebkit', 'window.WkWebView');
-
- // Attach the splashscreen utility to window.navigator.splashscreen
- // see the file under plugin/ios/launchscreen.js
- require('cordova/modulemapper').clobbers('cordova/plugin/ios/launchscreen', 'navigator.splashscreen');
-
- require('cordova/channel').onNativeReady.fire();
- }
-};
diff --git a/cordova/platforms/ios/www/cordova-js-src/plugin/ios/console.js b/cordova/platforms/ios/www/cordova-js-src/plugin/ios/console.js
deleted file mode 100644
index 0a4820ede..000000000
--- a/cordova/platforms/ios/www/cordova-js-src/plugin/ios/console.js
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// ------------------------------------------------------------------------------
-
-var logger = require('cordova/plugin/ios/logger');
-
-// ------------------------------------------------------------------------------
-// object that we're exporting
-// ------------------------------------------------------------------------------
-var console = module.exports;
-
-// ------------------------------------------------------------------------------
-// copy of the original console object
-// ------------------------------------------------------------------------------
-var WinConsole = window.console;
-
-// ------------------------------------------------------------------------------
-// whether to use the logger
-// ------------------------------------------------------------------------------
-var UseLogger = false;
-
-// ------------------------------------------------------------------------------
-// Timers
-// ------------------------------------------------------------------------------
-var Timers = {};
-
-// ------------------------------------------------------------------------------
-// used for unimplemented methods
-// ------------------------------------------------------------------------------
-function noop () {}
-
-// ------------------------------------------------------------------------------
-// used for unimplemented methods
-// ------------------------------------------------------------------------------
-console.useLogger = function (value) {
- if (arguments.length) UseLogger = !!value;
-
- if (UseLogger) {
- if (logger.useConsole()) {
- throw new Error('console and logger are too intertwingly');
- }
- }
-
- return UseLogger;
-};
-
-// ------------------------------------------------------------------------------
-console.log = function () {
- if (logger.useConsole()) return;
- logger.log.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.error = function () {
- if (logger.useConsole()) return;
- logger.error.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.warn = function () {
- if (logger.useConsole()) return;
- logger.warn.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.info = function () {
- if (logger.useConsole()) return;
- logger.info.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.debug = function () {
- if (logger.useConsole()) return;
- logger.debug.apply(logger, [].slice.call(arguments));
-};
-
-// ------------------------------------------------------------------------------
-console.assert = function (expression) {
- if (expression) return;
-
- var message = logger.format.apply(logger.format, [].slice.call(arguments, 1));
- console.log('ASSERT: ' + message);
-};
-
-// ------------------------------------------------------------------------------
-console.clear = function () {};
-
-// ------------------------------------------------------------------------------
-console.dir = function (object) {
- console.log('%o', object);
-};
-
-// ------------------------------------------------------------------------------
-console.dirxml = function (node) {
- console.log(node.innerHTML);
-};
-
-// ------------------------------------------------------------------------------
-console.trace = noop;
-
-// ------------------------------------------------------------------------------
-console.group = console.log;
-
-// ------------------------------------------------------------------------------
-console.groupCollapsed = console.log;
-
-// ------------------------------------------------------------------------------
-console.groupEnd = noop;
-
-// ------------------------------------------------------------------------------
-console.time = function (name) {
- Timers[name] = new Date().valueOf();
-};
-
-// ------------------------------------------------------------------------------
-console.timeEnd = function (name) {
- var timeStart = Timers[name];
- if (!timeStart) {
- console.warn('unknown timer: ' + name);
- return;
- }
-
- var timeElapsed = new Date().valueOf() - timeStart;
- console.log(name + ': ' + timeElapsed + 'ms');
-};
-
-// ------------------------------------------------------------------------------
-console.timeStamp = noop;
-
-// ------------------------------------------------------------------------------
-console.profile = noop;
-
-// ------------------------------------------------------------------------------
-console.profileEnd = noop;
-
-// ------------------------------------------------------------------------------
-console.count = noop;
-
-// ------------------------------------------------------------------------------
-console.exception = console.log;
-
-// ------------------------------------------------------------------------------
-console.table = function (data, columns) {
- console.log('%o', data);
-};
-
-// ------------------------------------------------------------------------------
-// return a new function that calls both functions passed as args
-// ------------------------------------------------------------------------------
-function wrappedOrigCall (orgFunc, newFunc) {
- return function () {
- var args = [].slice.call(arguments);
- try { orgFunc.apply(WinConsole, args); } catch (e) {}
- try { newFunc.apply(console, args); } catch (e) {}
- };
-}
-
-// ------------------------------------------------------------------------------
-// For every function that exists in the original console object, that
-// also exists in the new console object, wrap the new console method
-// with one that calls both
-// ------------------------------------------------------------------------------
-for (var key in console) {
- if (typeof WinConsole[key] === 'function') {
- console[key] = wrappedOrigCall(WinConsole[key], console[key]);
- }
-}
diff --git a/cordova/platforms/ios/www/cordova-js-src/plugin/ios/launchscreen.js b/cordova/platforms/ios/www/cordova-js-src/plugin/ios/launchscreen.js
deleted file mode 100644
index 24606969b..000000000
--- a/cordova/platforms/ios/www/cordova-js-src/plugin/ios/launchscreen.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-
-var launchscreen = {
- show: function () {
- exec(null, null, 'LaunchScreen', 'show', []);
- },
- hide: function () {
- exec(null, null, 'LaunchScreen', 'hide', []);
- }
-};
-
-module.exports = launchscreen;
diff --git a/cordova/platforms/ios/www/cordova-js-src/plugin/ios/logger.js b/cordova/platforms/ios/www/cordova-js-src/plugin/ios/logger.js
deleted file mode 100644
index 6f59e1c8e..000000000
--- a/cordova/platforms/ios/www/cordova-js-src/plugin/ios/logger.js
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-// ------------------------------------------------------------------------------
-// The logger module exports the following properties/functions:
-//
-// LOG - constant for the level LOG
-// ERROR - constant for the level ERROR
-// WARN - constant for the level WARN
-// INFO - constant for the level INFO
-// DEBUG - constant for the level DEBUG
-// logLevel() - returns current log level
-// logLevel(value) - sets and returns a new log level
-// useConsole() - returns whether logger is using console
-// useConsole(value) - sets and returns whether logger is using console
-// log(message,...) - logs a message at level LOG
-// error(message,...) - logs a message at level ERROR
-// warn(message,...) - logs a message at level WARN
-// info(message,...) - logs a message at level INFO
-// debug(message,...) - logs a message at level DEBUG
-// logLevel(level,message,...) - logs a message specified level
-//
-// ------------------------------------------------------------------------------
-
-var logger = exports;
-
-var exec = require('cordova/exec');
-
-var UseConsole = false;
-var UseLogger = true;
-var Queued = [];
-var DeviceReady = false;
-var CurrentLevel;
-
-var originalConsole = console;
-
-/**
- * Logging levels
- */
-
-var Levels = [
- 'LOG',
- 'ERROR',
- 'WARN',
- 'INFO',
- 'DEBUG'
-];
-
-/*
- * add the logging levels to the logger object and
- * to a separate levelsMap object for testing
- */
-
-var LevelsMap = {};
-for (var i = 0; i < Levels.length; i++) {
- var level = Levels[i];
- LevelsMap[level] = i;
- logger[level] = level;
-}
-
-CurrentLevel = LevelsMap.WARN;
-
-/**
- * Getter/Setter for the logging level
- *
- * Returns the current logging level.
- *
- * When a value is passed, sets the logging level to that value.
- * The values should be one of the following constants:
- * logger.LOG
- * logger.ERROR
- * logger.WARN
- * logger.INFO
- * logger.DEBUG
- *
- * The value used determines which messages get printed. The logging
- * values above are in order, and only messages logged at the logging
- * level or above will actually be displayed to the user. E.g., the
- * default level is WARN, so only messages logged with LOG, ERROR, or
- * WARN will be displayed; INFO and DEBUG messages will be ignored.
- */
-logger.level = function (value) {
- if (arguments.length) {
- if (LevelsMap[value] === null) {
- throw new Error('invalid logging level: ' + value);
- }
- CurrentLevel = LevelsMap[value];
- }
-
- return Levels[CurrentLevel];
-};
-
-/**
- * Getter/Setter for the useConsole functionality
- *
- * When useConsole is true, the logger will log via the
- * browser 'console' object.
- */
-logger.useConsole = function (value) {
- if (arguments.length) UseConsole = !!value;
-
- if (UseConsole) {
- if (typeof console === 'undefined') {
- throw new Error('global console object is not defined');
- }
-
- if (typeof console.log !== 'function') {
- throw new Error('global console object does not have a log function');
- }
-
- if (typeof console.useLogger === 'function') {
- if (console.useLogger()) {
- throw new Error('console and logger are too intertwingly');
- }
- }
- }
-
- return UseConsole;
-};
-
-/**
- * Getter/Setter for the useLogger functionality
- *
- * When useLogger is true, the logger will log via the
- * native Logger plugin.
- */
-logger.useLogger = function (value) {
- // Enforce boolean
- if (arguments.length) UseLogger = !!value;
- return UseLogger;
-};
-
-/**
- * Logs a message at the LOG level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.log = function (message) { logWithArgs('LOG', arguments); };
-
-/**
- * Logs a message at the ERROR level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.error = function (message) { logWithArgs('ERROR', arguments); };
-
-/**
- * Logs a message at the WARN level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.warn = function (message) { logWithArgs('WARN', arguments); };
-
-/**
- * Logs a message at the INFO level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.info = function (message) { logWithArgs('INFO', arguments); };
-
-/**
- * Logs a message at the DEBUG level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.debug = function (message) { logWithArgs('DEBUG', arguments); };
-
-// log at the specified level with args
-function logWithArgs (level, args) {
- args = [level].concat([].slice.call(args));
- logger.logLevel.apply(logger, args);
-}
-
-// return the correct formatString for an object
-function formatStringForMessage (message) {
- return (typeof message === 'string') ? '' : '%o';
-}
-
-/**
- * Logs a message at the specified level.
- *
- * Parameters passed after message are used applied to
- * the message with utils.format()
- */
-logger.logLevel = function (level /* , ... */) {
- // format the message with the parameters
- var formatArgs = [].slice.call(arguments, 1);
- var fmtString = formatStringForMessage(formatArgs[0]);
- if (fmtString.length > 0) {
- formatArgs.unshift(fmtString); // add formatString
- }
-
- var message = logger.format.apply(logger.format, formatArgs);
-
- if (LevelsMap[level] === null) {
- throw new Error('invalid logging level: ' + level);
- }
-
- if (LevelsMap[level] > CurrentLevel) return;
-
- // queue the message if not yet at deviceready
- if (!DeviceReady && !UseConsole) {
- Queued.push([level, message]);
- return;
- }
-
- // Log using the native logger if that is enabled
- if (UseLogger) {
- exec(null, null, 'Console', 'logLevel', [level, message]);
- }
-
- // Log using the console if that is enabled
- if (UseConsole) {
- // make sure console is not using logger
- if (console.useLogger()) {
- throw new Error('console and logger are too intertwingly');
- }
-
- // log to the console
- switch (level) {
- case logger.LOG: originalConsole.log(message); break;
- case logger.ERROR: originalConsole.log('ERROR: ' + message); break;
- case logger.WARN: originalConsole.log('WARN: ' + message); break;
- case logger.INFO: originalConsole.log('INFO: ' + message); break;
- case logger.DEBUG: originalConsole.log('DEBUG: ' + message); break;
- }
- }
-};
-
-/**
- * Formats a string and arguments following it ala console.log()
- *
- * Any remaining arguments will be appended to the formatted string.
- *
- * for rationale, see FireBug's Console API:
- * http://getfirebug.com/wiki/index.php/Console_API
- */
-logger.format = function (formatString, args) {
- return __format(arguments[0], [].slice.call(arguments, 1)).join(' ');
-};
-
-// ------------------------------------------------------------------------------
-/**
- * Formats a string and arguments following it ala vsprintf()
- *
- * format chars:
- * %j - format arg as JSON
- * %o - format arg as JSON
- * %c - format arg as ''
- * %% - replace with '%'
- * any other char following % will format it's
- * arg via toString().
- *
- * Returns an array containing the formatted string and any remaining
- * arguments.
- */
-function __format (formatString, args) {
- if (formatString === null || formatString === undefined) return [''];
- if (arguments.length === 1) return [formatString.toString()];
-
- if (typeof formatString !== 'string') { formatString = formatString.toString(); }
-
- var pattern = /(.*?)%(.)(.*)/;
- var rest = formatString;
- var result = [];
-
- while (args.length) {
- var match = pattern.exec(rest);
- if (!match) break;
-
- var arg = args.shift();
- rest = match[3];
- result.push(match[1]);
-
- if (match[2] === '%') {
- result.push('%');
- args.unshift(arg);
- continue;
- }
-
- result.push(__formatted(arg, match[2]));
- }
-
- result.push(rest);
-
- var remainingArgs = [].slice.call(args);
- remainingArgs.unshift(result.join(''));
- return remainingArgs;
-}
-
-function __formatted (object, formatChar) {
- try {
- switch (formatChar) {
- case 'j':
- case 'o': return JSON.stringify(object);
- case 'c': return '';
- }
- } catch (e) {
- return 'error JSON.stringify()ing argument: ' + e;
- }
-
- if ((object === null) || (object === undefined)) {
- return Object.prototype.toString.call(object);
- }
-
- return object.toString();
-}
-
-// ------------------------------------------------------------------------------
-// when deviceready fires, log queued messages
-logger.__onDeviceReady = function () {
- if (DeviceReady) return;
-
- DeviceReady = true;
-
- for (var i = 0; i < Queued.length; i++) {
- var messageArgs = Queued[i];
- logger.logLevel(messageArgs[0], messageArgs[1]);
- }
-
- Queued = null;
-};
-
-// add a deviceready event to log queued messages
-document.addEventListener('deviceready', logger.__onDeviceReady, false);
diff --git a/cordova/platforms/ios/www/cordova-js-src/plugin/ios/wkwebkit.js b/cordova/platforms/ios/www/cordova-js-src/plugin/ios/wkwebkit.js
deleted file mode 100644
index 35c819cf1..000000000
--- a/cordova/platforms/ios/www/cordova-js-src/plugin/ios/wkwebkit.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec');
-
-var WkWebKit = {
- allowsBackForwardNavigationGestures: function (allow) {
- exec(null, null, 'CDVWebViewEngine', 'allowsBackForwardNavigationGestures', [allow]);
- },
- convertFilePath: function (path) {
- if (!path || !window.CDV_ASSETS_URL) {
- return path;
- }
- if (path.startsWith('/')) {
- return window.CDV_ASSETS_URL + '/_app_file_' + path;
- }
- if (path.startsWith('file://')) {
- return window.CDV_ASSETS_URL + path.replace('file://', '/_app_file_');
- }
- return path;
- }
-};
-
-module.exports = WkWebKit;
diff --git a/cordova/platforms/ios/www/cordova.js b/cordova/platforms/ios/www/cordova.js
index 37f329f54..136d639b6 100644
--- a/cordova/platforms/ios/www/cordova.js
+++ b/cordova/platforms/ios/www/cordova.js
@@ -1,5 +1,5 @@
-// Platform: ios
-// cordova-js rel/6.0.0-10-g07379820
+// Platform: cordova-ios
+// cordova-js 6.1.0
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -19,7 +19,7 @@
under the License.
*/
;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '6.2.0';
+var PLATFORM_VERSION_BUILD_LABEL = '8.0.0';
// file: src/scripts/require.js
var require;
var define;
@@ -866,7 +866,7 @@ module.exports = channel;
});
-// file: ../cordova-ios/cordova-js-src/exec.js
+// file: ../../cordova-js-src/exec.js
define("cordova/exec", function(require, exports, module) {
/**
@@ -905,7 +905,7 @@ function massageMessageNativeToJs (message) {
return ret.buffer;
};
var base64ToArrayBuffer = function (b64) {
- return stringToArrayBuffer(atob(b64)); // eslint-disable-line no-undef
+ return stringToArrayBuffer(atob(b64));
};
message = base64ToArrayBuffer(message.data);
}
@@ -969,7 +969,7 @@ iOSExec.nativeCallback = function (callbackId, status, message, keepCallback, de
var success = status === 0 || status === 1;
var args = convertMessageToArgsNativeToJs(message);
Promise.resolve().then(function () {
- cordova.callbackFromNative(callbackId, success, status, args, keepCallback); // eslint-disable-line
+ cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
});
};
@@ -1233,7 +1233,7 @@ exports.reset();
});
-// file: ../cordova-ios/cordova-js-src/platform.js
+// file: ../../cordova-js-src/platform.js
define("cordova/platform", function(require, exports, module) {
module.exports = {
@@ -1251,13 +1251,17 @@ module.exports = {
// see the file under plugin/ios/launchscreen.js
require('cordova/modulemapper').clobbers('cordova/plugin/ios/launchscreen', 'navigator.splashscreen');
+ // Attach the internal statusBar utility to window.statusbar
+ // see the file under plugin/ios/statusbar.js
+ require('cordova/modulemapper').clobbers('cordova/plugin/ios/statusbar', 'window.statusbar');
+
require('cordova/channel').onNativeReady.fire();
}
};
});
-// file: ../cordova-ios/cordova-js-src/plugin/ios/console.js
+// file: ../../cordova-js-src/plugin/ios/console.js
define("cordova/plugin/ios/console", function(require, exports, module) {
// ------------------------------------------------------------------------------
@@ -1428,7 +1432,7 @@ for (var key in console) {
});
-// file: ../cordova-ios/cordova-js-src/plugin/ios/launchscreen.js
+// file: ../../cordova-js-src/plugin/ios/launchscreen.js
define("cordova/plugin/ios/launchscreen", function(require, exports, module) {
var exec = require('cordova/exec');
@@ -1446,7 +1450,7 @@ module.exports = launchscreen;
});
-// file: ../cordova-ios/cordova-js-src/plugin/ios/logger.js
+// file: ../../cordova-js-src/plugin/ios/logger.js
define("cordova/plugin/ios/logger", function(require, exports, module) {
// ------------------------------------------------------------------------------
@@ -1779,7 +1783,74 @@ document.addEventListener('deviceready', logger.__onDeviceReady, false);
});
-// file: ../cordova-ios/cordova-js-src/plugin/ios/wkwebkit.js
+// file: ../../cordova-js-src/plugin/ios/statusbar.js
+define("cordova/plugin/ios/statusbar", function(require, exports, module) {
+
+var exec = require('cordova/exec');
+
+var statusBarVisible = true;
+var statusBar = {};
+
+// This <script> element is explicitly used by Cordova's statusbar for computing color. (Do not use this element)
+const statusBarScript = document.createElement('script');
+document.head.appendChild(statusBarScript);
+
+Object.defineProperty(statusBar, 'visible', {
+ configurable: false,
+ enumerable: true,
+ get: function () {
+ if (window.StatusBar) {
+ // Let the CDVStatusBar plugin handle it
+ return window.StatusBar.isVisible;
+ }
+
+ return statusBarVisible;
+ },
+ set: function (value) {
+ if (window.StatusBar) {
+ // Let the CDVStatusBar plugin handle it
+ if (value) {
+ window.StatusBar.show();
+ } else {
+ window.StatusBar.hide();
+ }
+ } else {
+ statusBarVisible = value;
+ exec(null, null, 'StatusBarInternal', 'setVisible', [!!value]);
+ }
+ }
+});
+
+Object.defineProperty(statusBar, 'setBackgroundColor', {
+ configurable: false,
+ enumerable: false,
+ writable: false,
+ value: function (value) {
+ statusBarScript.style.color = value;
+ var rgbStr = window.getComputedStyle(statusBarScript).getPropertyValue('color');
+
+ if (!rgbStr.match(/^rgb/)) {
+ return;
+ }
+
+ var rgbVals = rgbStr.match(/\d+/g).map(function (v) { return parseInt(v, 10); });
+ if (rgbVals.length < 3) {
+ return;
+ }
+
+ if (window.StatusBar) {
+ window.StatusBar.backgroundColorByHexString('#' + rgbVals[0].toString(16).padStart(2, '0') + rgbVals[1].toString(16).padStart(2, '0') + rgbVals[2].toString(16).padStart(2, '0'));
+ } else {
+ exec(null, null, 'StatusBarInternal', 'setBackgroundColor', rgbVals);
+ }
+ }
+});
+
+module.exports = statusBar;
+
+});
+
+// file: ../../cordova-js-src/plugin/ios/wkwebkit.js
define("cordova/plugin/ios/wkwebkit", function(require, exports, module) {
var exec = require('cordova/exec');
diff --git a/cordova/platforms/ios/www/cordova_plugins.js b/cordova/platforms/ios/www/cordova_plugins.js
index 5d457dc9c..89efbb690 100644
--- a/cordova/platforms/ios/www/cordova_plugins.js
+++ b/cordova/platforms/ios/www/cordova_plugins.js
@@ -8,6 +8,29 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"plugins.Downloader"
]
},
+ {
+ "id": "es6-promise-plugin.Promise",
+ "file": "plugins/es6-promise-plugin/www/promise.js",
+ "pluginId": "es6-promise-plugin",
+ "runs": true
+ },
+ {
+ "id": "cordova-plugin-device.device",
+ "file": "plugins/cordova-plugin-device/www/device.js",
+ "pluginId": "cordova-plugin-device",
+ "clobbers": [
+ "device"
+ ]
+ },
+ {
+ "id": "cordova-plugin-background-mode.BackgroundMode",
+ "file": "plugins/cordova-plugin-background-mode/www/background-mode.js",
+ "pluginId": "cordova-plugin-background-mode",
+ "clobbers": [
+ "cordova.plugins.backgroundMode",
+ "plugin.backgroundMode"
+ ]
+ },
{
"id": "cordova-plugin-file.DirectoryEntry",
"file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
@@ -180,11 +203,76 @@ cordova.define('cordova/plugin_list', function(require, exports, module) {
"cordova"
],
"runs": true
+ },
+ {
+ "id": "cordova-plugin-file-opener2.FileOpener2",
+ "file": "plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js",
+ "pluginId": "cordova-plugin-file-opener2",
+ "clobbers": [
+ "cordova.plugins.fileOpener2"
+ ]
+ },
+ {
+ "id": "cordova-plugin-x-socialsharing.SocialSharing",
+ "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js",
+ "pluginId": "cordova-plugin-x-socialsharing",
+ "clobbers": [
+ "window.plugins.socialsharing"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.Camera",
+ "file": "plugins/cordova-plugin-camera/www/CameraConstants.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "Camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverOptions",
+ "file": "plugins/cordova-plugin-camera/www/CameraPopoverOptions.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverOptions"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.camera",
+ "file": "plugins/cordova-plugin-camera/www/Camera.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "navigator.camera"
+ ]
+ },
+ {
+ "id": "cordova-plugin-camera.CameraPopoverHandle",
+ "file": "plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js",
+ "pluginId": "cordova-plugin-camera",
+ "clobbers": [
+ "CameraPopoverHandle"
+ ]
+ },
+ {
+ "id": "com-darryncampbell-cordova-plugin-intent.IntentShim",
+ "file": "plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js",
+ "pluginId": "com-darryncampbell-cordova-plugin-intent",
+ "clobbers": [
+ "intentShim"
+ ]
}
];
module.exports.metadata = {
"com.whebcraft.cordova.plugin.downloader": "0.1.0",
- "cordova-plugin-androidx": "3.0.0",
- "cordova-plugin-file": "7.0.0-dev"
+ "es6-promise-plugin": "4.2.2",
+ "cordova-plugin-whitelist": "1.3.3",
+ "cordova-plugin-device": "2.0.2",
+ "cordova-plugin-background-mode": "0.7.3",
+ "cordova-plugin-file": "6.0.2",
+ "cordova-plugin-file-opener2": "3.0.3",
+ "cordova-plugin-x-socialsharing": "5.6.8",
+ "cordova-plugin-camera": "4.1.0",
+ "cordova-plugin-androidx-adapter": "1.1.3",
+ "com-darryncampbell-cordova-plugin-intent": "2.0.0",
+ "cordova-plugin-androidx": "3.0.0"
};
-});
+});
\ No newline at end of file
diff --git a/cordova/platforms/ios/www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js b/cordova/platforms/ios/www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js
new file mode 100644
index 000000000..67be5340c
--- /dev/null
+++ b/cordova/platforms/ios/www/plugins/com-darryncampbell-cordova-plugin-intent/www/IntentShim.js
@@ -0,0 +1,91 @@
+cordova.define("com-darryncampbell-cordova-plugin-intent.IntentShim", function(require, exports, module) {
+var argscheck = require('cordova/argscheck'),
+ channel = require('cordova/channel'),
+ utils = require('cordova/utils'),
+ exec = require('cordova/exec'),
+ cordova = require('cordova');
+
+
+/**
+ * This represents a thin shim layer over the Android Intent implementation
+ * @constructor
+ */
+function IntentShim() {
+ var me = this;
+}
+
+IntentShim.prototype.ACTION_SEND = "android.intent.action.SEND";
+IntentShim.prototype.ACTION_VIEW= "android.intent.action.VIEW";
+IntentShim.prototype.ACTION_INSTALL_PACKAGE="android.intent.action.INSTALL_PACKAGE";
+IntentShim.prototype.ACTION_UNINSTALL_PACKAGE= "android.intent.action.UNINSTALL_PACKAGE";
+IntentShim.prototype.EXTRA_TEXT = "android.intent.extra.TEXT";
+IntentShim.prototype.EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
+IntentShim.prototype.EXTRA_STREAM = "android.intent.extra.STREAM";
+IntentShim.prototype.EXTRA_EMAIL = "android.intent.extra.EMAIL";
+IntentShim.prototype.ACTION_CALL = "android.intent.action.CALL";
+IntentShim.prototype.ACTION_SENDTO = "android.intent.action.SENDTO";
+// StartActivityForResult
+IntentShim.prototype.ACTION_GET_CONTENT = "android.intent.action.GET_CONTENT";
+IntentShim.prototype.ACTION_PICK = "android.intent.action.PICK";
+IntentShim.prototype.RESULT_CANCELED = 0; // Activity.RESULT_CANCELED
+IntentShim.prototype.RESULT_OK = -1; // Activity.RESULT_OK
+
+IntentShim.prototype.startActivity = function(params, successCallback, errorCallback) {
+ argscheck.checkArgs('off', 'IntentShim.startActivity', arguments);
+ exec(successCallback, errorCallback, "IntentShim", "startActivity", [params]);
+};
+
+IntentShim.prototype.startActivityForResult = function(params, successCallback, errorCallback) {
+ argscheck.checkArgs('off', 'IntentShim.startActivityForResult', arguments);
+ exec(successCallback, errorCallback, "IntentShim", "startActivityForResult", [params]);
+};
+
+IntentShim.prototype.sendBroadcast = function(params, successCallback, errorCallback) {
+ argscheck.checkArgs('off', 'IntentShim.sendBroadcast', arguments);
+ exec(successCallback, errorCallback, "IntentShim", "sendBroadcast", [params]);
+};
+
+IntentShim.prototype.startService = function(params, successCallback, errorCallback) {
+ argscheck.checkArgs('off', 'IntentShim.startService', arguments);
+ exec(successCallback, errorCallback, "IntentShim", "startService", [params]);
+};
+
+IntentShim.prototype.registerBroadcastReceiver = function(params, callback) {
+ argscheck.checkArgs('of', 'IntentShim.registerBroadcastReceiver', arguments);
+ exec(callback, null, "IntentShim", "registerBroadcastReceiver", [params]);
+};
+
+IntentShim.prototype.unregisterBroadcastReceiver = function() {
+ argscheck.checkArgs('', 'IntentShim.unregisterBroadcastReceiver', arguments);
+ exec(null, null, "IntentShim", "unregisterBroadcastReceiver", []);
+};
+
+IntentShim.prototype.onIntent = function(callback) {
+ argscheck.checkArgs('f', 'IntentShim.onIntent', arguments);
+ exec(callback, null, "IntentShim", "onIntent", [callback]);
+};
+
+IntentShim.prototype.onActivityResult = function(callback) {
+ argscheck.checkArgs('f', 'IntentShim.onActivityResult', arguments);
+ exec(callback, null, "IntentShim", "onActivityResult", [callback]);
+};
+
+IntentShim.prototype.getIntent = function(successCallback, failureCallback) {
+ argscheck.checkArgs('ff', 'IntentShim.getIntent', arguments);
+ exec(successCallback, failureCallback, "IntentShim", "getIntent", []);
+};
+
+IntentShim.prototype.sendResult = function(params, callback) {
+ argscheck.checkArgs('of', 'IntentShim.sendResult', arguments);
+ exec(callback, null, "IntentShim", "sendResult", [params]);
+}
+
+IntentShim.prototype.realPathFromUri = function(params, successCallback, errorCallback) {
+ argscheck.checkArgs('off', 'IntentShim.realPathFromUri', arguments);
+ exec(successCallback, errorCallback, "IntentShim", "realPathFromUri", [params]);
+};
+
+window.intentShim = new IntentShim();
+window.plugins = window.plugins || {};
+window.plugins.intentShim = window.intentShim;
+});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-background-mode/www/background-mode.js b/cordova/platforms/ios/www/plugins/cordova-plugin-background-mode/www/background-mode.js
new file mode 100644
index 000000000..7895b27ad
--- /dev/null
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-background-mode/www/background-mode.js
@@ -0,0 +1,513 @@
+cordova.define("cordova-plugin-background-mode.BackgroundMode", function(require, exports, module) {
+/*
+ Copyright 2013-2017 appPlant GmbH
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+var exec = require('cordova/exec'),
+ channel = require('cordova/channel');
+
+/**
+ * Activates the background mode. When activated the application
+ * will be prevented from going to sleep while in background
+ * for the next time.
+ *
+ * @return [ Void ]
+ */
+exports.enable = function()
+{
+ if (this.isEnabled())
+ return;
+
+ var fn = function() {
+ exports._isEnabled = true;
+ exports.fireEvent('enable');
+ };
+
+ cordova.exec(fn, null, 'BackgroundMode', 'enable', []);
+};
+
+/**
+ * Deactivates the background mode. When deactivated the application
+ * will not stay awake while in background.
+ *
+ * @return [ Void ]
+ */
+exports.disable = function()
+{
+ if (!this.isEnabled())
+ return;
+
+ var fn = function() {
+ exports._isEnabled = false;
+ exports.fireEvent('disable');
+ };
+
+ cordova.exec(fn, null, 'BackgroundMode', 'disable', []);
+};
+
+/**
+ * Enable or disable the background mode.
+ *
+ * @param [ Bool ] enable The status to set for.
+ *
+ * @return [ Void ]
+ */
+exports.setEnabled = function (enable)
+{
+ if (enable) {
+ this.enable();
+ } else {
+ this.disable();
+ }
+};
+
+/**
+ * List of all available options with their default value.
+ *
+ * @return [ Object ]
+ */
+exports.getDefaults = function()
+{
+ return this._defaults;
+};
+
+/**
+ * The actual applied settings.
+ *
+ * @return [ Object ]
+ */
+exports.getSettings = function()
+{
+ return this._settings || {};
+};
+
+/**
+ * Overwrite the default settings.
+ *
+ * @param [ Object ] overrides Dict of options to be overridden.
+ *
+ * @return [ Void ]
+ */
+exports.setDefaults = function (overrides)
+{
+ var defaults = this.getDefaults();
+
+ for (var key in defaults)
+ {
+ if (overrides.hasOwnProperty(key))
+ {
+ defaults[key] = overrides[key];
+ }
+ }
+
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundMode', 'configure', [defaults, false]);
+ }
+};
+
+/**
+ * Configures the notification settings for Android.
+ * Will be merged with the defaults.
+ *
+ * @param [ Object ] options Dict of options to be overridden.
+ *
+ * @return [ Void ]
+ */
+exports.configure = function (options)
+{
+ var settings = this.getSettings(),
+ defaults = this.getDefaults();
+
+ if (!this._isAndroid)
+ return;
+
+ if (!this._isActive)
+ {
+ console.log('BackgroundMode is not active, skipped...');
+ return;
+ }
+
+ this._mergeObjects(options, settings);
+ this._mergeObjects(options, defaults);
+ this._settings = options;
+
+ cordova.exec(null, null, 'BackgroundMode', 'configure', [options, true]);
+};
+
+/**
+ * Enable GPS-tracking in background (Android).
+ *
+ * @return [ Void ]
+ */
+exports.disableWebViewOptimizations = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'webview', []);
+ }
+};
+
+/**
+ * Disables battery optimazation mode for the app.
+ *
+ * @return [ Void ]
+ */
+exports.disableBatteryOptimizations = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'battery', []);
+ }
+};
+
+/**
+ * Opens the system settings dialog where the user can tweak or turn off any
+ * custom app start settings added by the manufacturer if available.
+ *
+ * @param [ Object|Bool ] options Set to false if you dont want to display an
+ * alert dialog first.
+ *
+ * @return [ Void ]
+ */
+exports.openAppStartSettings = function (options)
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'appstart', [options]);
+ }
+};
+
+/**
+ * Move app to background (Android only).
+ *
+ * @return [ Void ]
+ */
+exports.moveToBackground = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'background', []);
+ }
+};
+
+/**
+ * Move app to foreground when in background (Android only).
+ *
+ * @return [ Void ]
+ */
+exports.moveToForeground = function()
+{
+ if (this.isActive() && this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'foreground', []);
+ }
+};
+
+/**
+ * Exclude the app from the recent tasks list (Android only).
+ *
+ * @return [ Void ]
+ */
+exports.excludeFromTaskList = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'tasklist', []);
+ }
+};
+
+/**
+ * Override the back button on Android to go to background
+ * instead of closing the app.
+ *
+ * @return [ Void ]
+ */
+exports.overrideBackButton = function()
+{
+ document.addEventListener('backbutton', function() {
+ exports.moveToBackground();
+ }, false);
+};
+
+/**
+ * If the screen is off.
+ *
+ * @param [ Function ] fn Callback function to invoke with boolean arg.
+ *
+ * @return [ Void ]
+ */
+exports.isScreenOff = function (fn)
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(fn, null, 'BackgroundModeExt', 'dimmed', []);
+ }
+ else
+ {
+ fn(undefined);
+ }
+};
+
+/**
+ * Wake up the device.
+ *
+ * @return [ Void ]
+ */
+exports.wakeUp = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'wakeup', []);
+ }
+};
+
+/**
+ * Wake up and unlock the device.
+ *
+ * @return [ Void ]
+ */
+exports.unlock = function()
+{
+ if (this._isAndroid)
+ {
+ cordova.exec(null, null, 'BackgroundModeExt', 'unlock', []);
+ }
+};
+
+/**
+ * If the mode is enabled or disabled.
+ *
+ * @return [ Boolean ]
+ */
+exports.isEnabled = function()
+{
+ return this._isEnabled !== false;
+};
+
+/**
+ * If the mode is active.
+ *
+ * @return [ Boolean ]
+ */
+exports.isActive = function()
+{
+ return this._isActive !== false;
+};
+
+exports._listener = {};
+
+/**
+ * Fire event with given arguments.
+ *
+ * @param [ String ] event The event's name.
+ * @param [ Array<Object> ] The callback's arguments.
+ *
+ * @return [ Void ]
+ */
+exports.fireEvent = function (event)
+{
+ var args = Array.apply(null, arguments).slice(1),
+ listener = this._listener[event];
+
+ if (!listener)
+ return;
+
+ for (var i = 0; i < listener.length; i++)
+ {
+ var fn = listener[i][0],
+ scope = listener[i][1];
+
+ fn.apply(scope, args);
+ }
+};
+
+/**
+ * Register callback for given event.
+ *
+ * @param [ String ] event The event's name.
+ * @param [ Function ] callback The function to be exec as callback.
+ * @param [ Object ] scope The callback function's scope.
+ *
+ * @return [ Void ]
+ */
+exports.on = function (event, callback, scope)
+{
+ if (typeof callback !== "function")
+ return;
+
+ if (!this._listener[event])
+ {
+ this._listener[event] = [];
+ }
+
+ var item = [callback, scope || window];
+
+ this._listener[event].push(item);
+};
+
+/**
+ * Unregister callback for given event.
+ *
+ * @param [ String ] event The event's name.
+ * @param [ Function ] callback The function to be exec as callback.
+ *
+ * @return [ Void ]
+ */
+exports.un = function (event, callback)
+{
+ var listener = this._listener[event];
+
+ if (!listener)
+ return;
+
+ for (var i = 0; i < listener.length; i++)
+ {
+ var fn = listener[i][0];
+
+ if (fn == callback)
+ {
+ listener.splice(i, 1);
+ break;
+ }
+ }
+};
+
+/**
+ * @private
+ *
+ * Flag indicates if the mode is enabled.
+ */
+exports._isEnabled = false;
+
+/**
+ * @private
+ *
+ * Flag indicates if the mode is active.
+ */
+exports._isActive = false;
+
+/**
+ * @private
+ *
+ * Default values of all available options.
+ */
+exports._defaults =
+{
+ title: 'App is running in background',
+ text: 'Doing heavy tasks.',
+ bigText: false,
+ resume: true,
+ silent: false,
+ hidden: true,
+ color: undefined,
+ icon: 'icon'
+};
+
+/**
+ * @private
+ *
+ * Merge settings with default values.
+ *
+ * @param [ Object ] options The custom options.
+ * @param [ Object ] toMergeIn The options to merge in.
+ *
+ * @return [ Object ] Default values merged with custom values.
+ */
+exports._mergeObjects = function (options, toMergeIn)
+{
+ for (var key in toMergeIn)
+ {
+ if (!options.hasOwnProperty(key))
+ {
+ options[key] = toMergeIn[key];
+ continue;
+ }
+ }
+
+ return options;
+};
+
+/**
+ * @private
+ *
+ * Setter for the isActive flag. Resets the
+ * settings if the mode isnt active anymore.
+ *
+ * @param [ Boolean] value The new value for the flag.
+ *
+ * @return [ Void ]
+ */
+exports._setActive = function(value)
+{
+ if (this._isActive == value)
+ return;
+
+ this._isActive = value;
+ this._settings = value ? this._mergeObjects({}, this._defaults) : {};
+};
+
+/**
+ * @private
+ *
+ * Initialize the plugin.
+ *
+ * Method should be called after the 'deviceready' event
+ * but before the event listeners will be called.
+ *
+ * @return [ Void ]
+ */
+exports._pluginInitialize = function()
+{
+ this._isAndroid = device.platform.match(/^android|amazon/i) !== null;
+ this.setDefaults({});
+
+ if (device.platform == 'browser')
+ {
+ this.enable();
+ this._isEnabled = true;
+ }
+
+ this._isActive = this._isActive || device.platform == 'browser';
+};
+
+// Called before 'deviceready' listener will be called
+channel.onCordovaReady.subscribe(function()
+{
+ channel.onCordovaInfoReady.subscribe(function() {
+ exports._pluginInitialize();
+ });
+});
+
+// Called after 'deviceready' event
+channel.deviceready.subscribe(function()
+{
+ if (exports.isEnabled())
+ {
+ exports.fireEvent('enable');
+ }
+
+ if (exports.isActive())
+ {
+ exports.fireEvent('activate');
+ }
+});
+
+});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/Camera.js b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/Camera.js
new file mode 100644
index 000000000..3f614ec80
--- /dev/null
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/Camera.js
@@ -0,0 +1,188 @@
+cordova.define("cordova-plugin-camera.camera", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var argscheck = require('cordova/argscheck');
+var exec = require('cordova/exec');
+var Camera = require('./Camera');
+// XXX: commented out
+// CameraPopoverHandle = require('./CameraPopoverHandle');
+
+/**
+ * @namespace navigator
+ */
+
+/**
+ * @exports camera
+ */
+var cameraExport = {};
+
+// Tack on the Camera Constants to the base camera plugin.
+for (var key in Camera) {
+ cameraExport[key] = Camera[key];
+}
+
+/**
+ * Callback function that provides an error message.
+ * @callback module:camera.onError
+ * @param {string} message - The message is provided by the device's native code.
+ */
+
+/**
+ * Callback function that provides the image data.
+ * @callback module:camera.onSuccess
+ * @param {string} imageData - Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`]{@link module:camera.CameraOptions} in effect.
+ * @example
+ * // Show image
+ * //
+ * function cameraCallback(imageData) {
+ * var image = document.getElementById('myImage');
+ * image.src = "data:image/jpeg;base64," + imageData;
+ * }
+ */
+
+/**
+ * Optional parameters to customize the camera settings.
+ * * [Quirks](#CameraOptions-quirks)
+ * @typedef module:camera.CameraOptions
+ * @type {Object}
+ * @property {number} [quality=50] - Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.)
+ * @property {module:Camera.DestinationType} [destinationType=FILE_URI] - Choose the format of the return value.
+ * @property {module:Camera.PictureSourceType} [sourceType=CAMERA] - Set the source of the picture.
+ * @property {Boolean} [allowEdit=false] - Allow simple editing of image before selection.
+ * @property {module:Camera.EncodingType} [encodingType=JPEG] - Choose the returned image file's encoding.
+ * @property {number} [targetWidth] - Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant.
+ * @property {number} [targetHeight] - Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant.
+ * @property {module:Camera.MediaType} [mediaType=PICTURE] - Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`.
+ * @property {Boolean} [correctOrientation] - Rotate the image to correct for the orientation of the device during capture.
+ * @property {Boolean} [saveToPhotoAlbum] - Save the image to the photo album on the device after capture.
+ * @property {module:CameraPopoverOptions} [popoverOptions] - iOS-only options that specify popover location in iPad.
+ * @property {module:Camera.Direction} [cameraDirection=BACK] - Choose the camera to use (front- or back-facing).
+ */
+
+/**
+ * @description Takes a photo using the camera, or retrieves a photo from the device's
+ * image gallery. The image is passed to the success callback as a
+ * Base64-encoded `String`, or as the URI for the image file.
+ *
+ * The `camera.getPicture` function opens the device's default camera
+ * application that allows users to snap pictures by default - this behavior occurs,
+ * when `Camera.sourceType` equals [`Camera.PictureSourceType.CAMERA`]{@link module:Camera.PictureSourceType}.
+ * Once the user snaps the photo, the camera application closes and the application is restored.
+ *
+ * If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
+ * `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
+ * that allows users to select an existing image.
+ *
+ * The return value is sent to the [`cameraSuccess`]{@link module:camera.onSuccess} callback function, in
+ * one of the following formats, depending on the specified
+ * `cameraOptions`:
+ *
+ * - A `String` containing the Base64-encoded photo image.
+ * - A `String` representing the image file location on local storage (default).
+ *
+ * You can do whatever you want with the encoded image or URI, for
+ * example:
+ *
+ * - Render the image in an `<img>` tag, as in the example below
+ * - Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
+ * - Post the data to a remote server
+ *
+ * __NOTE__: Photo resolution on newer devices is quite good. Photos
+ * selected from the device's gallery are not downscaled to a lower
+ * quality, even if a `quality` parameter is specified. To avoid common
+ * memory problems, set `Camera.destinationType` to `FILE_URI` rather
+ * than `DATA_URL`.
+ *
+ * __Supported Platforms__
+ *
+ * - Android
+ * - BlackBerry
+ * - Browser
+ * - Firefox
+ * - FireOS
+ * - iOS
+ * - Windows
+ * - WP8
+ * - Ubuntu
+ *
+ * More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
+ *
+ * @example
+ * navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
+ * @param {module:camera.onSuccess} successCallback
+ * @param {module:camera.onError} errorCallback
+ * @param {module:camera.CameraOptions} options CameraOptions
+ */
+cameraExport.getPicture = function (successCallback, errorCallback, options) {
+ argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
+ options = options || {};
+ var getValue = argscheck.getValue;
+
+ var quality = getValue(options.quality, 50);
+ var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
+ var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
+ var targetWidth = getValue(options.targetWidth, -1);
+ var targetHeight = getValue(options.targetHeight, -1);
+ var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
+ var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
+ var allowEdit = !!options.allowEdit;
+ var correctOrientation = !!options.correctOrientation;
+ var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
+ var popoverOptions = getValue(options.popoverOptions, null);
+ var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
+
+ var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
+ mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
+
+ exec(successCallback, errorCallback, 'Camera', 'takePicture', args);
+ // XXX: commented out
+ // return new CameraPopoverHandle();
+};
+
+/**
+ * Removes intermediate image files that are kept in temporary storage
+ * after calling [`camera.getPicture`]{@link module:camera.getPicture}. Applies only when the value of
+ * `Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
+ * `Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.
+ *
+ * __Supported Platforms__
+ *
+ * - iOS
+ *
+ * @example
+ * navigator.camera.cleanup(onSuccess, onFail);
+ *
+ * function onSuccess() {
+ * console.log("Camera cleanup success.")
+ * }
+ *
+ * function onFail(message) {
+ * alert('Failed because: ' + message);
+ * }
+ */
+cameraExport.cleanup = function (successCallback, errorCallback) {
+ exec(successCallback, errorCallback, 'Camera', 'cleanup', []);
+};
+
+module.exports = cameraExport;
+
+});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraConstants.js b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraConstants.js
new file mode 100644
index 000000000..4f4b046f1
--- /dev/null
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraConstants.js
@@ -0,0 +1,104 @@
+cordova.define("cordova-plugin-camera.Camera", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/**
+ * @module Camera
+ */
+module.exports = {
+ /**
+ * @description
+ * Defines the output format of `Camera.getPicture` call.
+ * _Note:_ On iOS passing `DestinationType.NATIVE_URI` along with
+ * `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM` will
+ * disable any image modifications (resize, quality change, cropping, etc.) due
+ * to implementation specific.
+ *
+ * @enum {number}
+ */
+ DestinationType: {
+ /** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible */
+ DATA_URL: 0,
+ /** Return file uri (content://media/external/images/media/2 for Android) */
+ FILE_URI: 1,
+ /** Return native uri (eg. asset-library://... for iOS) */
+ NATIVE_URI: 2
+ },
+ /**
+ * @enum {number}
+ */
+ EncodingType: {
+ /** Return JPEG encoded image */
+ JPEG: 0,
+ /** Return PNG encoded image */
+ PNG: 1
+ },
+ /**
+ * @enum {number}
+ */
+ MediaType: {
+ /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
+ PICTURE: 0,
+ /** Allow selection of video only, ONLY RETURNS URL */
+ VIDEO: 1,
+ /** Allow selection from all media types */
+ ALLMEDIA: 2
+ },
+ /**
+ * @description
+ * Defines the output format of `Camera.getPicture` call.
+ * _Note:_ On iOS passing `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM`
+ * along with `DestinationType.NATIVE_URI` will disable any image modifications (resize, quality
+ * change, cropping, etc.) due to implementation specific.
+ *
+ * @enum {number}
+ */
+ PictureSourceType: {
+ /** Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android) */
+ PHOTOLIBRARY: 0,
+ /** Take picture from camera */
+ CAMERA: 1,
+ /** Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android) */
+ SAVEDPHOTOALBUM: 2
+ },
+ /**
+ * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
+ * @enum {number}
+ */
+ PopoverArrowDirection: {
+ ARROW_UP: 1,
+ ARROW_DOWN: 2,
+ ARROW_LEFT: 4,
+ ARROW_RIGHT: 8,
+ ARROW_ANY: 15
+ },
+ /**
+ * @enum {number}
+ */
+ Direction: {
+ /** Use the back-facing camera */
+ BACK: 0,
+ /** Use the front-facing camera */
+ FRONT: 1
+ }
+};
+
+});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
new file mode 100644
index 000000000..6e03c52ee
--- /dev/null
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/CameraPopoverOptions.js
@@ -0,0 +1,59 @@
+cordova.define("cordova-plugin-camera.CameraPopoverOptions", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var Camera = require('./Camera');
+
+/**
+ * @namespace navigator
+ */
+
+/**
+ * iOS-only parameters that specify the anchor element location and arrow
+ * direction of the popover when selecting images from an iPad's library
+ * or album.
+ * Note that the size of the popover may change to adjust to the
+ * direction of the arrow and orientation of the screen. Make sure to
+ * account for orientation changes when specifying the anchor element
+ * location.
+ * @module CameraPopoverOptions
+ * @param {Number} [x=0] - x pixel coordinate of screen element onto which to anchor the popover.
+ * @param {Number} [y=32] - y pixel coordinate of screen element onto which to anchor the popover.
+ * @param {Number} [width=320] - width, in pixels, of the screen element onto which to anchor the popover.
+ * @param {Number} [height=480] - height, in pixels, of the screen element onto which to anchor the popover.
+ * @param {module:Camera.PopoverArrowDirection} [arrowDir=ARROW_ANY] - Direction the arrow on the popover should point.
+ * @param {Number} [popoverWidth=0] - width of the popover (0 or not specified will use apple's default width).
+ * @param {Number} [popoverHeight=0] - height of the popover (0 or not specified will use apple's default height).
+ */
+var CameraPopoverOptions = function (x, y, width, height, arrowDir, popoverWidth, popoverHeight) {
+ // information of rectangle that popover should be anchored to
+ this.x = x || 0;
+ this.y = y || 32;
+ this.width = width || 320;
+ this.height = height || 480;
+ this.arrowDir = arrowDir || Camera.PopoverArrowDirection.ARROW_ANY;
+ this.popoverWidth = popoverWidth || 0;
+ this.popoverHeight = popoverHeight || 0;
+};
+
+module.exports = CameraPopoverOptions;
+
+});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js
new file mode 100644
index 000000000..6da9fa35d
--- /dev/null
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js
@@ -0,0 +1,69 @@
+cordova.define("cordova-plugin-camera.CameraPopoverHandle", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var exec = require('cordova/exec');
+
+/**
+ * @namespace navigator
+ */
+
+/**
+ * A handle to an image picker popover.
+ *
+ * __Supported Platforms__
+ *
+ * - iOS
+ *
+ * @example
+ * navigator.camera.getPicture(onSuccess, onFail,
+ * {
+ * destinationType: Camera.DestinationType.FILE_URI,
+ * sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
+ * popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY, 300, 600)
+ * });
+ *
+ * // Reposition the popover if the orientation changes.
+ * window.onorientationchange = function() {
+ * var cameraPopoverHandle = new CameraPopoverHandle();
+ * var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY, 400, 500);
+ * cameraPopoverHandle.setPosition(cameraPopoverOptions);
+ * }
+ * @module CameraPopoverHandle
+ */
+var CameraPopoverHandle = function () {
+ /**
+ * Can be used to reposition the image selection dialog,
+ * for example, when the device orientation changes.
+ * @memberof CameraPopoverHandle
+ * @instance
+ * @method setPosition
+ * @param {module:CameraPopoverOptions} popoverOptions
+ */
+ this.setPosition = function (popoverOptions) {
+ var args = [ popoverOptions ];
+ exec(null, null, 'Camera', 'repositionPopover', args);
+ };
+};
+
+module.exports = CameraPopoverHandle;
+
+});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-device/www/device.js b/cordova/platforms/ios/www/plugins/cordova-plugin-device/www/device.js
new file mode 100644
index 000000000..ae48e3546
--- /dev/null
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-device/www/device.js
@@ -0,0 +1,86 @@
+cordova.define("cordova-plugin-device.device", function(require, exports, module) {
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+var argscheck = require('cordova/argscheck');
+var channel = require('cordova/channel');
+var utils = require('cordova/utils');
+var exec = require('cordova/exec');
+var cordova = require('cordova');
+
+channel.createSticky('onCordovaInfoReady');
+// Tell cordova channel to wait on the CordovaInfoReady event
+channel.waitForInitialization('onCordovaInfoReady');
+
+/**
+ * This represents the mobile device, and provides properties for inspecting the model, version, UUID of the
+ * phone, etc.
+ * @constructor
+ */
+function Device () {
+ this.available = false;
+ this.platform = null;
+ this.version = null;
+ this.uuid = null;
+ this.cordova = null;
+ this.model = null;
+ this.manufacturer = null;
+ this.isVirtual = null;
+ this.serial = null;
+
+ var me = this;
+
+ channel.onCordovaReady.subscribe(function () {
+ me.getInfo(function (info) {
+ // ignoring info.cordova returning from native, we should use value from cordova.version defined in cordova.js
+ // TODO: CB-5105 native implementations should not return info.cordova
+ var buildLabel = cordova.version;
+ me.available = true;
+ me.platform = info.platform;
+ me.version = info.version;
+ me.uuid = info.uuid;
+ me.cordova = buildLabel;
+ me.model = info.model;
+ me.isVirtual = info.isVirtual;
+ me.manufacturer = info.manufacturer || 'unknown';
+ me.serial = info.serial || 'unknown';
+ channel.onCordovaInfoReady.fire();
+ }, function (e) {
+ me.available = false;
+ utils.alert('[ERROR] Error initializing Cordova: ' + e);
+ });
+ });
+}
+
+/**
+ * Get device info
+ *
+ * @param {Function} successCallback The function to call when the heading data is available
+ * @param {Function} errorCallback The function to call when there is an error getting the heading data. (OPTIONAL)
+ */
+Device.prototype.getInfo = function (successCallback, errorCallback) {
+ argscheck.checkArgs('fF', 'Device.getInfo', arguments);
+ exec(successCallback, errorCallback, 'Device', 'getDeviceInfo', []);
+};
+
+module.exports = new Device();
+
+});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js
new file mode 100644
index 000000000..395c4d973
--- /dev/null
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-file-opener2/www/plugins.FileOpener2.js
@@ -0,0 +1,54 @@
+cordova.define("cordova-plugin-file-opener2.FileOpener2", function(require, exports, module) {
+/*jslint browser: true, devel: true, node: true, sloppy: true, plusplus: true*/
+/*global require, cordova */
+/*
+The MIT License (MIT)
+
+Copyright (c) 2013 pwlin - [email protected]
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+var exec = require('cordova/exec');
+
+function FileOpener2() {}
+
+FileOpener2.prototype.open = function (fileName, contentType, callbackContext) {
+ contentType = contentType || '';
+ callbackContext = callbackContext || {};
+ exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType]);
+};
+
+FileOpener2.prototype.showOpenWithDialog = function (fileName, contentType, callbackContext) {
+ contentType = contentType || '';
+ callbackContext = callbackContext || {};
+ exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'open', [fileName, contentType, false, callbackContext.position || [0, 0]]);
+};
+
+FileOpener2.prototype.uninstall = function (packageId, callbackContext) {
+ callbackContext = callbackContext || {};
+ exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'uninstall', [packageId]);
+};
+
+FileOpener2.prototype.appIsInstalled = function (packageId, callbackContext) {
+ callbackContext = callbackContext || {};
+ exec(callbackContext.success || null, callbackContext.error || null, 'FileOpener2', 'appIsInstalled', [packageId]);
+};
+
+module.exports = new FileOpener2();
+
+});
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/DirectoryEntry.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/DirectoryEntry.js
index fcd620c74..bb676eb6c 100644
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/DirectoryEntry.js
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/DirectoryEntry.js
@@ -37,6 +37,7 @@ var DirectoryReader = require('./DirectoryReader');
* {FileSystem} filesystem on which the directory resides (readonly)
*/
var DirectoryEntry = function (name, fullPath, fileSystem, nativeURL) {
+
// add trailing slash if it is missing
if ((fullPath) && !/\/$/.test(fullPath)) {
fullPath += '/';
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Entry.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Entry.js
index 5db846cfa..b296d999e 100644
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Entry.js
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/Entry.js
@@ -152,7 +152,7 @@ Entry.prototype.copyTo = function (parent, newName, successCallback, errorCallba
errorCallback(new FileError(code));
};
var srcURL = this.toInternalURL();
- // entry name
+ // entry name
var name = newName || this.name;
// success callback
var success = function (entry) {
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileReader.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileReader.js
index 36d4dd4e6..5c030913b 100644
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileReader.js
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileReader.js
@@ -76,24 +76,12 @@ function defineEvent (eventName) {
this._realReader[eventName] = value;
});
}
-
-// When the read starts.
-defineEvent('onloadstart');
-
-// While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total)
-defineEvent('onprogress');
-
-// When the read has successfully completed.
-defineEvent('onload');
-
-// When the read has failed (see errors).
-defineEvent('onerror');
-
-// When the request has completed (either in success or failure).
-defineEvent('onloadend');
-
-// When the read has been aborted. For instance, by invoking the abort() method.
-defineEvent('onabort');
+defineEvent('onloadstart'); // When the read starts.
+defineEvent('onprogress'); // While reading (and decoding) file or fileBlob data, and reporting partial file data (progress.loaded/progress.total)
+defineEvent('onload'); // When the read has successfully completed.
+defineEvent('onerror'); // When the read has failed (see errors).
+defineEvent('onloadend'); // When the request has completed (either in success or failure).
+defineEvent('onabort'); // When the read has been aborted. For instance, by invoking the abort() method.
function initRead (reader, file) {
// Already loading something
@@ -114,7 +102,7 @@ function initRead (reader, file) {
}
if (reader.onloadstart) {
- reader.onloadstart(new ProgressEvent('loadstart', { target: reader }));
+ reader.onloadstart(new ProgressEvent('loadstart', {target: reader}));
}
}
@@ -138,12 +126,10 @@ function readSuccessCallback (readType, encoding, offset, totalSize, accumulate,
if (readType === 'readAsDataURL') {
// Windows proxy does not support reading file slices as Data URLs
// so read the whole file at once.
- CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize // eslint-disable-line no-undef
- : (
- // Calculate new chunk size for data URLs to be multiply of 3
- // Otherwise concatenated base64 chunks won't be valid base64 data
- FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3
- );
+ CHUNK_SIZE = cordova.platformId === 'windows' ? totalSize : // eslint-disable-line no-undef
+ // Calculate new chunk size for data URLs to be multiply of 3
+ // Otherwise concatenated base64 chunks won't be valid base64 data
+ FileReader.READ_CHUNK_SIZE - (FileReader.READ_CHUNK_SIZE % 3) + 3;
}
if (typeof r !== 'undefined') {
@@ -151,7 +137,7 @@ function readSuccessCallback (readType, encoding, offset, totalSize, accumulate,
this._progress = Math.min(this._progress + CHUNK_SIZE, totalSize);
if (typeof this.onprogress === 'function') {
- this.onprogress(new ProgressEvent('progress', { loaded: this._progress, total: totalSize }));
+ this.onprogress(new ProgressEvent('progress', {loaded: this._progress, total: totalSize}));
}
}
@@ -171,11 +157,11 @@ function readSuccessCallback (readType, encoding, offset, totalSize, accumulate,
this._readyState = FileReader.DONE;
if (typeof this.onload === 'function') {
- this.onload(new ProgressEvent('load', { target: this }));
+ this.onload(new ProgressEvent('load', {target: this}));
}
if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', { target: this }));
+ this.onloadend(new ProgressEvent('loadend', {target: this}));
}
}
}
@@ -194,11 +180,11 @@ function readFailureCallback (e) {
this._error = new FileError(e);
if (typeof this.onerror === 'function') {
- this.onerror(new ProgressEvent('error', { target: this }));
+ this.onerror(new ProgressEvent('error', {target: this}));
}
if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', { target: this }));
+ this.onloadend(new ProgressEvent('loadend', {target: this}));
}
}
@@ -219,11 +205,11 @@ FileReader.prototype.abort = function () {
// If abort callback
if (typeof this.onabort === 'function') {
- this.onabort(new ProgressEvent('abort', { target: this }));
+ this.onabort(new ProgressEvent('abort', {target: this}));
}
// If load end callback
if (typeof this.onloadend === 'function') {
- this.onloadend(new ProgressEvent('loadend', { target: this }));
+ this.onloadend(new ProgressEvent('loadend', {target: this}));
}
};
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileWriter.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileWriter.js
index 9f141e085..c3e856219 100644
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileWriter.js
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/FileWriter.js
@@ -54,23 +54,12 @@ var FileWriter = function (file) {
this.error = null;
// Event handlers
- // When writing starts
- this.onwritestart = null;
-
- // While writing the file, and reporting partial file data
- this.onprogress = null;
-
- // When the write has successfully completed.
- this.onwrite = null;
-
- // When the request has completed (either in success or failure).
- this.onwriteend = null;
-
- // When the write has been aborted. For instance, by invoking the abort() method.
- this.onabort = null;
-
- // When the write has failed (see errors).
- this.onerror = null;
+ this.onwritestart = null; // When writing starts
+ this.onprogress = null; // While writing the file, and reporting partial file data
+ this.onwrite = null; // When the write has successfully completed.
+ this.onwriteend = null; // When the request has completed (either in success or failure).
+ this.onabort = null; // When the write has been aborted. For instance, by invoking the abort() method.
+ this.onerror = null; // When the write has failed (see errors).
};
// States
@@ -94,12 +83,12 @@ FileWriter.prototype.abort = function () {
// If abort callback
if (typeof this.onabort === 'function') {
- this.onabort(new ProgressEvent('abort', { target: this }));
+ this.onabort(new ProgressEvent('abort', {'target': this}));
}
// If write end callback
if (typeof this.onwriteend === 'function') {
- this.onwriteend(new ProgressEvent('writeend', { target: this }));
+ this.onwriteend(new ProgressEvent('writeend', {'target': this}));
}
};
@@ -110,6 +99,7 @@ FileWriter.prototype.abort = function () {
* @param isPendingBlobReadResult {Boolean} true if the data is the pending blob read operation result
*/
FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
+
var that = this;
var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
/* eslint-disable no-undef */
@@ -133,12 +123,12 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
// If onerror callback
if (typeof that.onerror === 'function') {
- that.onerror(new ProgressEvent('error', { target: that }));
+ that.onerror(new ProgressEvent('error', {'target': that}));
}
// If onwriteend callback
if (typeof that.onwriteend === 'function') {
- that.onwriteend(new ProgressEvent('writeend', { target: that }));
+ that.onwriteend(new ProgressEvent('writeend', {'target': that}));
}
};
@@ -172,7 +162,7 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
// If onwritestart callback
if (typeof me.onwritestart === 'function') {
- me.onwritestart(new ProgressEvent('writestart', { target: me }));
+ me.onwritestart(new ProgressEvent('writestart', {'target': me}));
}
// Write file
@@ -195,12 +185,12 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
// If onwrite callback
if (typeof me.onwrite === 'function') {
- me.onwrite(new ProgressEvent('write', { target: me }));
+ me.onwrite(new ProgressEvent('write', {'target': me}));
}
// If onwriteend callback
if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', { target: me }));
+ me.onwriteend(new ProgressEvent('writeend', {'target': me}));
}
},
// Error callback
@@ -218,12 +208,12 @@ FileWriter.prototype.write = function (data, isPendingBlobReadResult) {
// If onerror callback
if (typeof me.onerror === 'function') {
- me.onerror(new ProgressEvent('error', { target: me }));
+ me.onerror(new ProgressEvent('error', {'target': me}));
}
// If onwriteend callback
if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', { target: me }));
+ me.onwriteend(new ProgressEvent('writeend', {'target': me}));
}
}, 'File', 'write', [this.localURL, data, this.position, isBinary]);
};
@@ -279,7 +269,7 @@ FileWriter.prototype.truncate = function (size) {
// If onwritestart callback
if (typeof me.onwritestart === 'function') {
- me.onwritestart(new ProgressEvent('writestart', { target: this }));
+ me.onwritestart(new ProgressEvent('writestart', {'target': this}));
}
// Write file
@@ -300,12 +290,12 @@ FileWriter.prototype.truncate = function (size) {
// If onwrite callback
if (typeof me.onwrite === 'function') {
- me.onwrite(new ProgressEvent('write', { target: me }));
+ me.onwrite(new ProgressEvent('write', {'target': me}));
}
// If onwriteend callback
if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', { target: me }));
+ me.onwriteend(new ProgressEvent('writeend', {'target': me}));
}
},
// Error callback
@@ -323,12 +313,12 @@ FileWriter.prototype.truncate = function (size) {
// If onerror callback
if (typeof me.onerror === 'function') {
- me.onerror(new ProgressEvent('error', { target: me }));
+ me.onerror(new ProgressEvent('error', {'target': me}));
}
// If onwriteend callback
if (typeof me.onwriteend === 'function') {
- me.onwriteend(new ProgressEvent('writeend', { target: me }));
+ me.onwriteend(new ProgressEvent('writeend', {'target': me}));
}
}, 'File', 'truncate', [this.localURL, size]);
};
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
index 494de62ff..73715bc0e 100644
--- a/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-file/www/resolveLocalFileSystemURI.js
@@ -70,7 +70,7 @@ cordova.define("cordova-plugin-file.resolveLocalFileSystemURI", function(require
fileSystems.getFs(fsName, function (fs) {
// This should happen only on platforms that haven't implemented requestAllFileSystems (windows)
if (!fs) {
- fs = new FileSystem(fsName, { name: '', fullPath: '/' }); // eslint-disable-line no-undef
+ fs = new FileSystem(fsName, {name: '', fullPath: '/'}); // eslint-disable-line no-undef
}
var result = (entry.isDirectory) ? new DirectoryEntry(entry.name, entry.fullPath, fs, entry.nativeURL) : new FileEntry(entry.name, entry.fullPath, fs, entry.nativeURL);
successCallback(result);
diff --git a/cordova/platforms/ios/www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js b/cordova/platforms/ios/www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js
new file mode 100644
index 000000000..d16bfdc1c
--- /dev/null
+++ b/cordova/platforms/ios/www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js
@@ -0,0 +1,160 @@
+cordova.define("cordova-plugin-x-socialsharing.SocialSharing", function(require, exports, module) {
+function SocialSharing() {
+}
+
+// Override this method (after deviceready) to set the location where you want the iPad popup arrow to appear.
+// If not overridden with different values, the popup is not used. Example:
+//
+// window.plugins.socialsharing.iPadPopupCoordinates = function() {
+// return "100,100,200,300";
+// };
+SocialSharing.prototype.iPadPopupCoordinates = function () {
+ // left,top,width,height
+ return "-1,-1,-1,-1";
+};
+
+SocialSharing.prototype.setIPadPopupCoordinates = function (coords) {
+ console.log("Deprecated - setIPadPopupCoordinates no longer works since plugin version 5.5.0. See https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/1052");
+ // left,top,width,height
+ cordova.exec(function() {}, this._getErrorCallback(function() {}, "setIPadPopupCoordinates"), "SocialSharing", "setIPadPopupCoordinates", [coords]);
+};
+
+SocialSharing.prototype.available = function (callback) {
+ cordova.exec(function (avail) {
+ callback(avail ? true : false);
+ }, null, "SocialSharing", "available", []);
+};
+
+// this is the recommended way to share as it is the most feature-rich with respect to what you pass in and get back
+SocialSharing.prototype.shareWithOptions = function (options, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareWithOptions"), "SocialSharing", "shareWithOptions", [options]);
+};
+
+SocialSharing.prototype.shareW3C = function (sharedata) {
+ return new Promise(function(resolve, reject) {
+ var options = {
+ subject: sharedata.title,
+ message: sharedata.text,
+ url: sharedata.url,
+ iPadCoordinates: sharedata.iPadCoordinates || undefined
+ };
+ if(sharedata.hasOwnProperty('title') ||
+ sharedata.hasOwnProperty('text') ||
+ sharedata.hasOwnProperty('url')) {
+ cordova.exec(resolve, reject, "SocialSharing", "shareWithOptions", [options]);
+ } else {
+ reject();
+ }
+ });
+};
+
+SocialSharing.prototype.share = function (message, subject, fileOrFileArray, url, iPadCoordinates, successCallback, errorCallback) {
+ if (typeof iPadCoordinates === 'function') {
+ errorCallback = successCallback;
+ successCallback = iPadCoordinates;
+ iPadCoordinates = "";
+ }
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "share"), "SocialSharing", "share", [message, subject, this._asArray(fileOrFileArray), url, iPadCoordinates]);
+};
+
+SocialSharing.prototype.shareViaTwitter = function (message, file /* multiple not allowed by twitter */, url, successCallback, errorCallback) {
+ var fileArray = this._asArray(file);
+ var ecb = this._getErrorCallback(errorCallback, "shareViaTwitter");
+ if (fileArray.length > 1) {
+ ecb("shareViaTwitter supports max one file");
+ } else {
+ cordova.exec(successCallback, ecb, "SocialSharing", "shareViaTwitter", [message, null, fileArray, url]);
+ }
+};
+
+SocialSharing.prototype.shareViaFacebook = function (message, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebook"), "SocialSharing", "shareViaFacebook", [message, null, this._asArray(fileOrFileArray), url]);
+};
+
+SocialSharing.prototype.shareViaFacebookWithPasteMessageHint = function (message, fileOrFileArray, url, pasteMessageHint, successCallback, errorCallback) {
+ pasteMessageHint = pasteMessageHint || "If you like you can paste a message from your clipboard";
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaFacebookWithPasteMessageHint"), "SocialSharing", "shareViaFacebookWithPasteMessageHint", [message, null, this._asArray(fileOrFileArray), url, pasteMessageHint]);
+};
+
+SocialSharing.prototype.shareViaWhatsApp = function (message, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsApp"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null, null]);
+};
+
+SocialSharing.prototype.shareViaWhatsAppToReceiver = function (receiver, message, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToReceiver"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, receiver, null]);
+};
+
+SocialSharing.prototype.shareViaWhatsAppToPhone = function (phone, message, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaWhatsAppToPhone"), "SocialSharing", "shareViaWhatsApp", [message, null, this._asArray(fileOrFileArray), url, null, phone]);
+};
+
+SocialSharing.prototype.shareViaSMS = function (options, phonenumbers, successCallback, errorCallback) {
+ var opts = options;
+ if (typeof options === "string") {
+ opts = {"message":options}; // for backward compatibility as the options param used to be the message
+ }
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaSMS"), "SocialSharing", "shareViaSMS", [opts, phonenumbers]);
+};
+
+SocialSharing.prototype.shareViaEmail = function (message, subject, toArray, ccArray, bccArray, fileOrFileArray, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaEmail"), "SocialSharing", "shareViaEmail", [message, subject, this._asArray(toArray), this._asArray(ccArray), this._asArray(bccArray), this._asArray(fileOrFileArray)]);
+};
+
+SocialSharing.prototype.canShareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareVia"), "SocialSharing", "canShareVia", [message, subject, this._asArray(fileOrFileArray), url, via]);
+};
+
+SocialSharing.prototype.canShareViaEmail = function (successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "canShareViaEmail"), "SocialSharing", "canShareViaEmail", []);
+};
+
+SocialSharing.prototype.shareViaInstagram = function (message, fileOrFileArray, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareViaInstagram"), "SocialSharing", "shareViaInstagram", [message, null, this._asArray(fileOrFileArray), null]);
+};
+
+SocialSharing.prototype.shareVia = function (via, message, subject, fileOrFileArray, url, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "shareVia"), "SocialSharing", "shareVia", [message, subject, this._asArray(fileOrFileArray), url, via]);
+};
+
+SocialSharing.prototype.saveToPhotoAlbum = function (fileOrFileArray, successCallback, errorCallback) {
+ cordova.exec(successCallback, this._getErrorCallback(errorCallback, "saveToPhotoAlbum"), "SocialSharing", "saveToPhotoAlbum", [this._asArray(fileOrFileArray)]);
+};
+
+SocialSharing.prototype._asArray = function (param) {
+ if (param == null) {
+ param = [];
+ } else if (typeof param === 'string') {
+ param = new Array(param);
+ }
+ return param;
+};
+
+SocialSharing.prototype._getErrorCallback = function (ecb, functionName) {
+ if (typeof ecb === 'function') {
+ return ecb;
+ } else {
+ return function (result) {
+ console.log("The injected error callback of '" + functionName + "' received: " + JSON.stringify(result));
+ }
+ }
+};
+
+SocialSharing.install = function () {
+ if (!window.plugins) {
+ window.plugins = {};
+ }
+
+ window.plugins.socialsharing = new SocialSharing();
+
+ // Note only polyfill navigator.share if it is not defined, since shareW3C implements L1 of the spec,
+ // and an existing navigator.share method could implement L2.
+ if (!navigator.share) {
+ navigator.share = window.plugins.socialsharing.shareW3C;
+ }
+
+ return window.plugins.socialsharing;
+};
+
+cordova.addConstructor(SocialSharing.install);
+
+});
diff --git a/cordova/platforms/ios/www/plugins/es6-promise-plugin/www/promise.js b/cordova/platforms/ios/www/plugins/es6-promise-plugin/www/promise.js
new file mode 100644
index 000000000..6cce47ae8
--- /dev/null
+++ b/cordova/platforms/ios/www/plugins/es6-promise-plugin/www/promise.js
@@ -0,0 +1,13 @@
+cordova.define("es6-promise-plugin.Promise", function(require, exports, module) {
+/*!
+ * @overview es6-promise - a tiny implementation of Promises/A+.
+ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
+ * @license Licensed under MIT license
+ * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
+ * @version v4.2.2+97478eb6
+ */
+
+!function t(e,n,r){function o(u,s){if(!n[u]){if(!e[u]){var c="function"==typeof require&&require;if(!s&&c)return c(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var a=n[u]={exports:{}};e[u][0].call(a.exports,function(t){var n=e[u][1][t];return o(n?n:t)},a,a.exports,t,e,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t){void 0===window.Promise&&t("es6-promise").polyfill()},{"es6-promise":2}],2:[function(t,e,n){(function(r,o){!function(t,r){"object"==typeof n&&"undefined"!=typeof e?e.exports=r():"function"==typeof define&&define.amd?define(r):t.ES6Promise=r()}(this,function(){"use strict";function e(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function n(t){return"function"==typeof t}function i(t){J=t}function u(t){Q=t}function s(){return function(){return r.nextTick(h)}}function c(){return"undefined"!=typeof I?function(){I(h)}:l()}function f(){var t=0,e=new X(h),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function a(){var t=new MessageChannel;return t.port1.onmessage=h,function(){return t.port2.postMessage(0)}}function l(){var t=setTimeout;return function(){return t(h,1)}}function h(){for(var t=0;H>t;t+=2){var e=te[t],n=te[t+1];e(n),te[t]=void 0,te[t+1]=void 0}H=0}function p(){try{var e=t,n=e("vertx");return I=n.runOnLoop||n.runOnContext,c()}catch(r){return l()}}function d(t,e){var n=this,r=new this.constructor(y);void 0===r[ne]&&D(r);var o=n._state;if(o){var i=arguments[o-1];Q(function(){return L(o,r,i,n._result)})}else O(n,r,t,e);return r}function v(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(y);return E(n,t),n}function y(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function _(){return new TypeError("A promises callback cannot return that same promise.")}function w(t){try{return t.then}catch(e){return ue.error=e,ue}}function g(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function b(t,e,n){Q(function(t){var r=!1,o=g(n,e,function(n){r||(r=!0,e!==n?E(t,n):j(t,n))},function(e){r||(r=!0,x(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,x(t,o))},t)}function T(t,e){e._state===oe?j(t,e._result):e._state===ie?x(t,e._result):O(e,void 0,function(e){return E(t,e)},function(e){return x(t,e)})}function A(t,e,r){e.constructor===t.constructor&&r===d&&e.constructor.resolve===v?T(t,e):r===ue?(x(t,ue.error),ue.error=null):void 0===r?j(t,e):n(r)?b(t,e,r):j(t,e)}function E(t,n){t===n?x(t,m()):e(n)?A(t,n,w(n)):j(t,n)}function S(t){t._onerror&&t._onerror(t._result),M(t)}function j(t,e){t._state===re&&(t._result=e,t._state=oe,0!==t._subscribers.length&&Q(M,t))}function x(t,e){t._state===re&&(t._state=ie,t._result=e,Q(S,t))}function O(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+oe]=n,o[i+ie]=r,0===i&&t._state&&Q(M,t)}function M(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,u=0;u<e.length;u+=3)r=e[u],o=e[u+n],r?L(n,r,o,i):o(i);t._subscribers.length=0}}function P(){this.error=null}function C(t,e){try{return t(e)}catch(n){return se.error=n,se}}function L(t,e,r,o){var i=n(r),u=void 0,s=void 0,c=void 0,f=void 0;if(i){if(u=C(r,o),u===se?(f=!0,s=u.error,u.error=null):c=!0,e===u)return x(e,_()),void 0}else u=o,c=!0;e._state!==re||(i&&c?E(e,u):f?x(e,s):t===oe?j(e,u):t===ie&&x(e,u))}function k(t,e){try{e(function(e){E(t,e)},function(e){x(t,e)})}catch(n){x(t,n)}}function q(){return ce++}function D(t){t[ne]=ce++,t._state=void 0,t._result=void 0,t._subscribers=[]}function F(){return new Error("Array Methods must be provided an Array")}function F(){return new Error("Array Methods must be provided an Array")}function N(t){return new fe(this,t).promise}function U(t){var e=this;return G(t)?new e(function(n,r){for(var o=t.length,i=0;o>i;i++)e.resolve(t[i]).then(n,r)}):new e(function(t,e){return e(new TypeError("You must pass an array to race."))})}function Y(t){var e=this,n=new e(y);return x(n,t),n}function K(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function W(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function z(){var t=void 0;if("undefined"!=typeof o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=ae}var B=void 0;B=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var G=B,H=0,I=void 0,J=void 0,Q=function(t,e){te[H]=t,te[H+1]=e,H+=2,2===H&&(J?J(h):ee())},R="undefined"!=typeof window?window:void 0,V=R||{},X=V.MutationObserver||V.WebKitMutationObserver,Z="undefined"==typeof self&&"undefined"!=typeof r&&"[object process]"==={}.toString.call(r),$="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,te=new Array(1e3),ee=void 0;ee=Z?s():X?f():$?a():void 0===R&&"function"==typeof t?p():l();var ne=Math.random().toString(36).substring(16),re=void 0,oe=1,ie=2,ue=new P,se=new P,ce=0,fe=function(){function t(t,e){this._instanceConstructor=t,this.promise=new t(y),this.promise[ne]||D(this.promise),G(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&j(this.promise,this._result))):x(this.promise,F())}return t.prototype._enumerate=function(t){for(var e=0;this._state===re&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===v){var o=w(t);if(o===d&&t._state!==re)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===ae){var i=new n(y);A(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===re&&(this._remaining--,t===ie?x(r,n):this._result[e]=n),0===this._remaining&&j(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;O(t,void 0,function(t){return n._settledAt(oe,e,t)},function(t){return n._settledAt(ie,e,t)})},t}(),ae=function(){function t(e){this[ne]=q(),this._result=this._state=void 0,this._subscribers=[],y!==e&&("function"!=typeof e&&K(),this instanceof t?k(this,e):W())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var e=this,n=e.constructor;return e.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})})},t}();return ae.prototype.then=d,ae.all=N,ae.race=U,ae.resolve=v,ae.reject=Y,ae._setScheduler=i,ae._setAsap=u,ae._asap=Q,ae.polyfill=z,ae.Promise=ae,ae})}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],3:[function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(a===setTimeout)return setTimeout(t,0);if((a===n||!a)&&setTimeout)return a=setTimeout,setTimeout(t,0);try{return a(t,0)}catch(e){try{return a.call(null,t,0)}catch(e){return a.call(this,t,0)}}}function i(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function u(){v&&p&&(v=!1,p.length?d=p.concat(d):y=-1,d.length&&s())}function s(){if(!v){var t=o(u);v=!0;for(var e=d.length;e;){for(p=d,d=[];++y<e;)p&&p[y].run();y=-1,e=d.length}p=null,v=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function f(){}var a,l,h=e.exports={};!function(){try{a="function"==typeof setTimeout?setTimeout:n}catch(t){a=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(t){l=r}}();var p,d=[],v=!1,y=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||v||o(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=f,h.addListener=f,h.once=f,h.off=f,h.removeListener=f,h.removeAllListeners=f,h.emit=f,h.prependListener=f,h.prependOnceListener=f,h.listeners=function(){return[]},h.binding=function(){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}]},{},[1]);
+
+
+});