Init for 2020-12-18
187
angular.json
Normal file
@ -0,0 +1,187 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"version": 1,
|
||||
"defaultProject": "app",
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"app": {
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"projectType": "application",
|
||||
"prefix": "app",
|
||||
"schematics": {},
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"outputPath": "www",
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "tsconfig.app.json",
|
||||
"assets": [
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "assets"
|
||||
},
|
||||
{
|
||||
"glob": "**/*.svg",
|
||||
"input": "node_modules/ionicons/dist/ionicons/svg",
|
||||
"output": "./svg"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
{
|
||||
"input": "src/theme/variables.scss"
|
||||
},
|
||||
{
|
||||
"input": "src/global.scss"
|
||||
}
|
||||
],
|
||||
"scripts": []
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
"extractCss": true,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true,
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "2mb",
|
||||
"maximumError": "5mb"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ci": {
|
||||
"progress": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "app:build"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "app:build:production"
|
||||
},
|
||||
"ci": {
|
||||
"progress": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "app:build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "src/test.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "tsconfig.spec.json",
|
||||
"karmaConfig": "karma.conf.js",
|
||||
"styles": [],
|
||||
"scripts": [],
|
||||
"assets": [
|
||||
{
|
||||
"glob": "favicon.ico",
|
||||
"input": "src/",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "src/assets",
|
||||
"output": "/assets"
|
||||
}
|
||||
]
|
||||
},
|
||||
"configurations": {
|
||||
"ci": {
|
||||
"progress": false,
|
||||
"watch": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"tsconfig.app.json",
|
||||
"tsconfig.spec.json",
|
||||
"e2e/tsconfig.json"
|
||||
],
|
||||
"exclude": ["**/node_modules/**"]
|
||||
}
|
||||
},
|
||||
"e2e": {
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "e2e/protractor.conf.js",
|
||||
"devServerTarget": "app:serve"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"devServerTarget": "app:serve:production"
|
||||
},
|
||||
"ci": {
|
||||
"devServerTarget": "app:serve:ci"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ionic-cordova-build": {
|
||||
"builder": "@ionic/angular-toolkit:cordova-build",
|
||||
"options": {
|
||||
"browserTarget": "app:build"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "app:build:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ionic-cordova-serve": {
|
||||
"builder": "@ionic/angular-toolkit:cordova-serve",
|
||||
"options": {
|
||||
"cordovaBuildTarget": "app:ionic-cordova-build",
|
||||
"devServerTarget": "app:serve"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"cordovaBuildTarget": "app:ionic-cordova-build:production",
|
||||
"devServerTarget": "app:serve:production"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"cli": {
|
||||
"defaultCollection": "@ionic/angular-toolkit"
|
||||
},
|
||||
"schematics": {
|
||||
"@ionic/angular-toolkit:component": {
|
||||
"styleext": "scss"
|
||||
},
|
||||
"@ionic/angular-toolkit:page": {
|
||||
"styleext": "scss"
|
||||
}
|
||||
}
|
||||
}
|
12
browserslist
Normal file
@ -0,0 +1,12 @@
|
||||
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
||||
# For additional information regarding the format and rule options, please see:
|
||||
# https://github.com/browserslist/browserslist#queries
|
||||
|
||||
# You can see what browsers were selected by your queries by running:
|
||||
# npx browserslist
|
||||
|
||||
> 0.5%
|
||||
last 2 versions
|
||||
Firefox ESR
|
||||
not dead
|
||||
not IE 9-11 # For IE 9-11 support, remove 'not'.
|
106
config.xml
Normal file
@ -0,0 +1,106 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||
<name>MyApp</name>
|
||||
<description>An awesome Ionic/Cordova app.</description>
|
||||
<author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
|
||||
<content src="index.html" />
|
||||
<access origin="*" />
|
||||
<allow-intent href="http://*/*" />
|
||||
<allow-intent href="https://*/*" />
|
||||
<allow-intent href="tel:*" />
|
||||
<allow-intent href="sms:*" />
|
||||
<allow-intent href="mailto:*" />
|
||||
<allow-intent href="geo:*" />
|
||||
<preference name="ScrollEnabled" value="false" />
|
||||
<preference name="BackupWebStorage" value="none" />
|
||||
<preference name="SplashMaintainAspectRatio" value="true" />
|
||||
<preference name="FadeSplashScreenDuration" value="300" />
|
||||
<preference name="SplashShowOnlyFirstTime" value="false" />
|
||||
<preference name="SplashScreen" value="screen" />
|
||||
<preference name="SplashScreenDelay" value="3000" />
|
||||
<platform name="android">
|
||||
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application android:networkSecurityConfig="@xml/network_security_config" />
|
||||
</edit-config>
|
||||
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
|
||||
<allow-intent href="market:*" />
|
||||
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
|
||||
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
|
||||
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
|
||||
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
|
||||
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
|
||||
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
|
||||
<splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
|
||||
<splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
|
||||
<splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
|
||||
<splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
|
||||
<splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
|
||||
<splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
|
||||
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
|
||||
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
|
||||
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
|
||||
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
|
||||
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
|
||||
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
|
||||
</platform>
|
||||
<platform name="ios">
|
||||
<allow-intent href="itms:*" />
|
||||
<allow-intent href="itms-apps:*" />
|
||||
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
|
||||
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
|
||||
<icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
|
||||
<icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
|
||||
<icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
|
||||
<icon height="20" src="resources/ios/icon/icon-20.png" width="20" />
|
||||
<icon height="40" src="resources/ios/icon/icon-20@2x.png" width="40" />
|
||||
<icon height="60" src="resources/ios/icon/icon-20@3x.png" width="60" />
|
||||
<icon height="48" src="resources/ios/icon/icon-24@2x.png" width="48" />
|
||||
<icon height="55" src="resources/ios/icon/icon-27.5@2x.png" width="55" />
|
||||
<icon height="29" src="resources/ios/icon/icon-29.png" width="29" />
|
||||
<icon height="58" src="resources/ios/icon/icon-29@2x.png" width="58" />
|
||||
<icon height="87" src="resources/ios/icon/icon-29@3x.png" width="87" />
|
||||
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
|
||||
<icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
|
||||
<icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
|
||||
<icon height="88" src="resources/ios/icon/icon-44@2x.png" width="88" />
|
||||
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
|
||||
<icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
|
||||
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
|
||||
<icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
|
||||
<icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
|
||||
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
|
||||
<icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
|
||||
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
|
||||
<icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
|
||||
<icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
|
||||
<icon height="172" src="resources/ios/icon/icon-86@2x.png" width="172" />
|
||||
<icon height="196" src="resources/ios/icon/icon-98@2x.png" width="196" />
|
||||
<icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
|
||||
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
|
||||
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
|
||||
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
|
||||
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
|
||||
<splash height="1125" src="resources/ios/splash/Default-Landscape-2436h.png" width="2436" />
|
||||
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
|
||||
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
|
||||
<splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
|
||||
<splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
|
||||
<splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
|
||||
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
|
||||
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
|
||||
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
|
||||
<splash height="2436" src="resources/ios/splash/Default-2436h.png" width="1125" />
|
||||
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
|
||||
<icon height="216" src="resources/ios/icon/icon-108@2x.png" width="216" />
|
||||
<splash height="2688" src="resources/ios/splash/Default-2688h~iphone.png" width="1242" />
|
||||
<splash height="1242" src="resources/ios/splash/Default-Landscape-2688h~iphone.png" width="2688" />
|
||||
<splash height="1792" src="resources/ios/splash/Default-1792h~iphone.png" width="828" />
|
||||
<splash height="828" src="resources/ios/splash/Default-Landscape-1792h~iphone.png" width="1792" />
|
||||
</platform>
|
||||
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
|
||||
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
|
||||
<plugin name="cordova-plugin-device" spec="2.0.2" />
|
||||
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
|
||||
<plugin name="cordova-plugin-ionic-webview" spec="^4.0.0" />
|
||||
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
|
||||
</widget>
|
36
e2e/protractor.conf.js
Normal file
@ -0,0 +1,36 @@
|
||||
// @ts-check
|
||||
// Protractor configuration file, see link for more information
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||
|
||||
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter');
|
||||
|
||||
/**
|
||||
* @type { import("protractor").Config }
|
||||
*/
|
||||
exports.config = {
|
||||
allScriptsTimeout: 11000,
|
||||
specs: [
|
||||
'./src/**/*.e2e-spec.ts'
|
||||
],
|
||||
capabilities: {
|
||||
browserName: 'chrome'
|
||||
},
|
||||
directConnect: true,
|
||||
baseUrl: 'http://localhost:4200/',
|
||||
framework: 'jasmine',
|
||||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 30000,
|
||||
print: function() {}
|
||||
},
|
||||
onPrepare() {
|
||||
require('ts-node').register({
|
||||
project: require('path').join(__dirname, './tsconfig.json')
|
||||
});
|
||||
jasmine.getEnv().addReporter(new SpecReporter({
|
||||
spec: {
|
||||
displayStacktrace: StacktraceOption.PRETTY
|
||||
}
|
||||
}));
|
||||
}
|
||||
};
|
14
e2e/src/app.e2e-spec.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { AppPage } from './app.po';
|
||||
|
||||
describe('new App', () => {
|
||||
let page: AppPage;
|
||||
|
||||
beforeEach(() => {
|
||||
page = new AppPage();
|
||||
});
|
||||
|
||||
it('should be blank', () => {
|
||||
page.navigateTo();
|
||||
expect(page.getParagraphText()).toContain('Start with Ionic UI Components');
|
||||
});
|
||||
});
|
11
e2e/src/app.po.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { browser, by, element } from 'protractor';
|
||||
|
||||
export class AppPage {
|
||||
navigateTo() {
|
||||
return browser.get('/');
|
||||
}
|
||||
|
||||
getParagraphText() {
|
||||
return element(by.deepCss('app-root ion-content')).getText();
|
||||
}
|
||||
}
|
13
e2e/tsconfig.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/app",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"types": [
|
||||
"jasmine",
|
||||
"jasminewd2",
|
||||
"node"
|
||||
]
|
||||
}
|
||||
}
|
7
ionic.config.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "aiber-test",
|
||||
"integrations": {
|
||||
"cordova": {}
|
||||
},
|
||||
"type": "angular"
|
||||
}
|
31
karma.conf.js
Normal file
@ -0,0 +1,31 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '',
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage-istanbul-reporter'),
|
||||
require('@angular-devkit/build-angular/plugins/karma')
|
||||
],
|
||||
client: {
|
||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
||||
},
|
||||
coverageIstanbulReporter: {
|
||||
dir: require('path').join(__dirname, '../coverage'),
|
||||
reports: ['html', 'lcovonly', 'text-summary'],
|
||||
fixWebpackSourcePaths: true
|
||||
},
|
||||
reporters: ['progress', 'kjhtml'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: false
|
||||
});
|
||||
};
|
14385
package-lock.json
generated
Normal file
77
package.json
Normal file
@ -0,0 +1,77 @@
|
||||
{
|
||||
"name": "aiber-test",
|
||||
"version": "0.0.1",
|
||||
"author": "Ionic Framework",
|
||||
"homepage": "https://ionicframework.com/",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e",
|
||||
"emulate": "ionic cordova emulate ios --target='914C6DC7-C042-48FC-A076-4A271DD71093' --consolelogs --livereload",
|
||||
"build:ionic": "ionic build"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/common": "~10.0.0",
|
||||
"@angular/core": "~10.0.0",
|
||||
"@angular/forms": "~10.0.0",
|
||||
"@angular/platform-browser": "~10.0.0",
|
||||
"@angular/platform-browser-dynamic": "~10.0.0",
|
||||
"@angular/router": "~10.0.0",
|
||||
"@ionic-native/core": "^5.0.0",
|
||||
"@ionic-native/splash-screen": "^5.0.0",
|
||||
"@ionic-native/status-bar": "^5.0.0",
|
||||
"@ionic/angular": "^5.0.0",
|
||||
"basic-trend": "^1.0.6",
|
||||
"rxjs": "~6.5.5",
|
||||
"tslib": "^2.0.0",
|
||||
"zone.js": "~0.10.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.1000.0",
|
||||
"@angular/cli": "~10.0.5",
|
||||
"@angular/compiler": "~10.0.0",
|
||||
"@angular/compiler-cli": "~10.0.0",
|
||||
"@angular/language-service": "~10.0.0",
|
||||
"@ionic/angular-toolkit": "^2.3.0",
|
||||
"@types/jasmine": "~3.5.0",
|
||||
"@types/jasminewd2": "~2.0.3",
|
||||
"@types/node": "^12.11.1",
|
||||
"codelyzer": "^6.0.0",
|
||||
"cordova-ios": "^6.1.1",
|
||||
"cordova-plugin-device": "^2.0.2",
|
||||
"cordova-plugin-ionic-keyboard": "^2.2.0",
|
||||
"cordova-plugin-ionic-webview": "^4.2.1",
|
||||
"cordova-plugin-splashscreen": "^5.0.2",
|
||||
"cordova-plugin-statusbar": "^2.4.2",
|
||||
"cordova-plugin-whitelist": "^1.3.3",
|
||||
"jasmine-core": "~3.5.0",
|
||||
"jasmine-spec-reporter": "~5.0.0",
|
||||
"karma": "~5.0.0",
|
||||
"karma-chrome-launcher": "~3.1.0",
|
||||
"karma-coverage-istanbul-reporter": "~3.0.2",
|
||||
"karma-jasmine": "~3.3.0",
|
||||
"karma-jasmine-html-reporter": "^1.5.0",
|
||||
"protractor": "~7.0.0",
|
||||
"ts-node": "~8.3.0",
|
||||
"tslint": "~6.1.0",
|
||||
"typescript": "~3.9.5"
|
||||
},
|
||||
"description": "An Ionic project",
|
||||
"cordova": {
|
||||
"plugins": {
|
||||
"cordova-plugin-whitelist": {},
|
||||
"cordova-plugin-statusbar": {},
|
||||
"cordova-plugin-device": {},
|
||||
"cordova-plugin-splashscreen": {},
|
||||
"cordova-plugin-ionic-webview": {},
|
||||
"cordova-plugin-ionic-keyboard": {}
|
||||
},
|
||||
"platforms": [
|
||||
"ios"
|
||||
]
|
||||
}
|
||||
}
|
5
platforms/ios/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
*.mode1v3
|
||||
*.perspectivev3
|
||||
*.pbxuser
|
||||
.DS_Store
|
||||
build/
|
25
platforms/ios/CordovaLib/Classes/Private/CDVDebug.h
Normal file
@ -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.
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
#else
|
||||
#define DLog(...)
|
||||
#endif
|
||||
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
|
31
platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.h
Normal file
@ -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.
|
||||
*/
|
||||
|
||||
@interface NSArray (CDVJSONSerializingPrivate)
|
||||
- (NSString*)cdv_JSONString;
|
||||
@end
|
||||
|
||||
@interface NSDictionary (CDVJSONSerializingPrivate)
|
||||
- (NSString*)cdv_JSONString;
|
||||
@end
|
||||
|
||||
@interface NSString (CDVJSONSerializingPrivate)
|
||||
- (id)cdv_JSONObject;
|
||||
- (id)cdv_JSONFragment;
|
||||
@end
|
99
platforms/ios/CordovaLib/Classes/Private/CDVJSON_private.m
Normal file
@ -0,0 +1,99 @@
|
||||
/*
|
||||
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 "CDVJSON_private.h"
|
||||
#import <Foundation/NSJSONSerialization.h>
|
||||
|
||||
@implementation NSArray (CDVJSONSerializingPrivate)
|
||||
|
||||
- (NSString*)cdv_JSONString
|
||||
{
|
||||
@autoreleasepool {
|
||||
NSError* error = nil;
|
||||
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
|
||||
options:0
|
||||
error:&error];
|
||||
|
||||
if (error != nil) {
|
||||
NSLog(@"NSArray JSONString error: %@", [error localizedDescription]);
|
||||
return nil;
|
||||
} else {
|
||||
return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSDictionary (CDVJSONSerializingPrivate)
|
||||
|
||||
- (NSString*)cdv_JSONString
|
||||
{
|
||||
@autoreleasepool {
|
||||
NSError* error = nil;
|
||||
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
|
||||
options:NSJSONWritingPrettyPrinted
|
||||
error:&error];
|
||||
|
||||
if (error != nil) {
|
||||
NSLog(@"NSDictionary JSONString error: %@", [error localizedDescription]);
|
||||
return nil;
|
||||
} else {
|
||||
return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSString (CDVJSONSerializingPrivate)
|
||||
|
||||
- (id)cdv_JSONObject
|
||||
{
|
||||
@autoreleasepool {
|
||||
NSError* error = nil;
|
||||
id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
|
||||
options:NSJSONReadingMutableContainers
|
||||
error:&error];
|
||||
|
||||
if (error != nil) {
|
||||
NSLog(@"NSString JSONObject error: %@, Malformed Data: %@", [error localizedDescription], self);
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
}
|
||||
|
||||
- (id)cdv_JSONFragment
|
||||
{
|
||||
@autoreleasepool {
|
||||
NSError* error = nil;
|
||||
id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
|
||||
options:NSJSONReadingAllowFragments
|
||||
error:&error];
|
||||
|
||||
if (error != nil) {
|
||||
NSLog(@"NSString JSONObject error: %@", [error localizedDescription]);
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
24
platforms/ios/CordovaLib/Classes/Private/CDVPlugin+Private.h
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
@interface CDVPlugin (Private)
|
||||
|
||||
- (instancetype)initWithWebViewEngine:(id <CDVWebViewEngineProtocol>)theWebViewEngine;
|
||||
|
||||
@end
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
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 CDVGestureHandler : CDVPlugin
|
||||
|
||||
@property (nonatomic, strong) UILongPressGestureRecognizer* lpgr;
|
||||
|
||||
@end
|
@ -0,0 +1,70 @@
|
||||
/*
|
||||
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 "CDVGestureHandler.h"
|
||||
|
||||
@implementation CDVGestureHandler
|
||||
|
||||
- (void)pluginInitialize
|
||||
{
|
||||
[self applyLongPressFix];
|
||||
}
|
||||
|
||||
- (void)applyLongPressFix
|
||||
{
|
||||
// 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]) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.lpgr = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPressGestures:)];
|
||||
self.lpgr.minimumPressDuration = 0.45f;
|
||||
self.lpgr.allowableMovement = 200.0f;
|
||||
|
||||
// 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]) {
|
||||
self.lpgr.minimumPressDuration = 0.15f;
|
||||
}
|
||||
|
||||
NSArray *views = self.webView.subviews;
|
||||
if (views.count == 0) {
|
||||
NSLog(@"No webview subviews found, not applying the longpress fix.");
|
||||
return;
|
||||
}
|
||||
for (int i=0; i<views.count; i++) {
|
||||
UIView *webViewScrollView = views[i];
|
||||
if ([webViewScrollView isKindOfClass:[UIScrollView class]]) {
|
||||
NSArray *webViewScrollViewSubViews = webViewScrollView.subviews;
|
||||
UIView *browser = webViewScrollViewSubViews[0];
|
||||
[browser addGestureRecognizer:self.lpgr];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)handleLongPressGestures:(UILongPressGestureRecognizer*)sender
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@end
|
@ -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 CDVHandleOpenURL : CDVPlugin
|
||||
|
||||
@property (nonatomic, strong) NSURL* url;
|
||||
@property (nonatomic, assign) BOOL pageLoaded;
|
||||
|
||||
@end
|
@ -0,0 +1,86 @@
|
||||
/*
|
||||
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 "CDVHandleOpenURL.h"
|
||||
#import <Cordova/CDV.h>
|
||||
|
||||
@implementation CDVHandleOpenURL
|
||||
|
||||
- (void)pluginInitialize
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationLaunchedWithUrl:) name:CDVPluginHandleOpenURLNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationPageDidLoad:) name:CDVPageDidLoadNotification object:nil];
|
||||
}
|
||||
|
||||
- (void)applicationLaunchedWithUrl:(NSNotification*)notification
|
||||
{
|
||||
NSURL* url = [notification object];
|
||||
|
||||
self.url = url;
|
||||
|
||||
// warm-start handler
|
||||
if (self.pageLoaded) {
|
||||
[self processOpenUrl:self.url pageLoaded:YES];
|
||||
self.url = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applicationPageDidLoad:(NSNotification*)notification
|
||||
{
|
||||
// cold-start handler
|
||||
|
||||
self.pageLoaded = YES;
|
||||
|
||||
if (self.url) {
|
||||
[self processOpenUrl:self.url pageLoaded:YES];
|
||||
self.url = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)processOpenUrl:(NSURL*)url pageLoaded:(BOOL)pageLoaded
|
||||
{
|
||||
__weak __typeof(self) weakSelf = self;
|
||||
|
||||
dispatch_block_t handleOpenUrl = ^(void) {
|
||||
// calls into javascript global function 'handleOpenURL'
|
||||
NSString* jsString = [NSString stringWithFormat:@"document.addEventListener('deviceready',function(){if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}});", url.absoluteString];
|
||||
|
||||
[weakSelf.webViewEngine evaluateJavaScript:jsString completionHandler:nil];
|
||||
};
|
||||
|
||||
if (!pageLoaded) {
|
||||
NSString* jsString = @"document.readystate";
|
||||
[self.webViewEngine evaluateJavaScript:jsString
|
||||
completionHandler:^(id object, NSError* error) {
|
||||
if ((error == nil) && [object isKindOfClass:[NSString class]]) {
|
||||
NSString* readyState = (NSString*)object;
|
||||
BOOL ready = [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"];
|
||||
if (ready) {
|
||||
handleOpenUrl();
|
||||
} else {
|
||||
self.url = url;
|
||||
}
|
||||
}
|
||||
}];
|
||||
} else {
|
||||
handleOpenUrl();
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
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>
|
||||
#import <Cordova/CDVWhitelist.h>
|
||||
|
||||
#define CDVWebViewNavigationType int
|
||||
|
||||
typedef NS_ENUM(NSInteger, CDVIntentAndNavigationFilterValue) {
|
||||
CDVIntentAndNavigationFilterValueIntentAllowed,
|
||||
CDVIntentAndNavigationFilterValueNavigationAllowed,
|
||||
CDVIntentAndNavigationFilterValueNoneAllowed
|
||||
};
|
||||
|
||||
@interface CDVIntentAndNavigationFilter : CDVPlugin <NSXMLParserDelegate>
|
||||
|
||||
+ (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url intentsWhitelist:(CDVWhitelist*)intentsWhitelist navigationsWhitelist:(CDVWhitelist*)navigationsWhitelist;
|
||||
+ (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType filterValue:(CDVIntentAndNavigationFilterValue)filterValue;
|
||||
+ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType;
|
||||
@end
|
@ -0,0 +1,151 @@
|
||||
/*
|
||||
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 "CDVIntentAndNavigationFilter.h"
|
||||
#import <Cordova/CDV.h>
|
||||
|
||||
@interface CDVIntentAndNavigationFilter ()
|
||||
|
||||
@property (nonatomic, readwrite) NSMutableArray* allowIntents;
|
||||
@property (nonatomic, readwrite) NSMutableArray* allowNavigations;
|
||||
@property (nonatomic, readwrite) CDVWhitelist* allowIntentsWhitelist;
|
||||
@property (nonatomic, readwrite) CDVWhitelist* allowNavigationsWhitelist;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CDVIntentAndNavigationFilter
|
||||
|
||||
#pragma mark NSXMLParserDelegate
|
||||
|
||||
- (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName attributes:(NSDictionary*)attributeDict
|
||||
{
|
||||
if ([elementName isEqualToString:@"allow-navigation"]) {
|
||||
[self.allowNavigations addObject:attributeDict[@"href"]];
|
||||
}
|
||||
if ([elementName isEqualToString:@"allow-intent"]) {
|
||||
[self.allowIntents addObject:attributeDict[@"href"]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)parserDidStartDocument:(NSXMLParser*)parser
|
||||
{
|
||||
// file: url <allow-navigations> are added by default
|
||||
// navigation to the scheme used by the app is also allowed
|
||||
self.allowNavigations = [[NSMutableArray alloc] initWithArray:@[ @"file://"]];
|
||||
|
||||
// If the custom app scheme is defined, append it to the allow navigation as default
|
||||
NSString* scheme = ((CDVViewController*)self.viewController).appScheme;
|
||||
if (scheme) {
|
||||
[self.allowNavigations addObject: [NSString stringWithFormat:@"%@://", scheme]];
|
||||
}
|
||||
|
||||
// no intents are added by default
|
||||
self.allowIntents = [[NSMutableArray alloc] init];
|
||||
}
|
||||
|
||||
- (void)parserDidEndDocument:(NSXMLParser*)parser
|
||||
{
|
||||
self.allowIntentsWhitelist = [[CDVWhitelist alloc] initWithArray:self.allowIntents];
|
||||
self.allowNavigationsWhitelist = [[CDVWhitelist alloc] initWithArray:self.allowNavigations];
|
||||
}
|
||||
|
||||
- (void)parser:(NSXMLParser*)parser parseErrorOccurred:(NSError*)parseError
|
||||
{
|
||||
NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]);
|
||||
}
|
||||
|
||||
#pragma mark CDVPlugin
|
||||
|
||||
- (void)pluginInitialize
|
||||
{
|
||||
if ([self.viewController isKindOfClass:[CDVViewController class]]) {
|
||||
[(CDVViewController*)self.viewController parseSettingsWithParser:self];
|
||||
}
|
||||
}
|
||||
|
||||
+ (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url intentsWhitelist:(CDVWhitelist*)intentsWhitelist navigationsWhitelist:(CDVWhitelist*)navigationsWhitelist
|
||||
{
|
||||
// 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];
|
||||
|
||||
if (allowNavigationsPass && allowIntentPass) {
|
||||
return CDVIntentAndNavigationFilterValueNavigationAllowed;
|
||||
} else if (allowNavigationsPass) {
|
||||
return CDVIntentAndNavigationFilterValueNavigationAllowed;
|
||||
} else if (allowIntentPass) {
|
||||
return CDVIntentAndNavigationFilterValueIntentAllowed;
|
||||
}
|
||||
|
||||
return CDVIntentAndNavigationFilterValueNoneAllowed;
|
||||
}
|
||||
|
||||
- (CDVIntentAndNavigationFilterValue) filterUrl:(NSURL*)url
|
||||
{
|
||||
return [[self class] filterUrl:url intentsWhitelist:self.allowIntentsWhitelist navigationsWhitelist:self.allowNavigationsWhitelist];
|
||||
}
|
||||
|
||||
#define CDVWebViewNavigationTypeLinkClicked 0
|
||||
#define CDVWebViewNavigationTypeLinkOther -1
|
||||
|
||||
+ (BOOL)shouldOpenURLRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType
|
||||
{
|
||||
return (
|
||||
navigationType == CDVWebViewNavigationTypeLinkClicked ||
|
||||
navigationType == CDVWebViewNavigationTypeLinkOther
|
||||
);
|
||||
}
|
||||
|
||||
+ (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='%@'";
|
||||
|
||||
NSURL* url = [request URL];
|
||||
|
||||
switch (filterValue) {
|
||||
case CDVIntentAndNavigationFilterValueNavigationAllowed:
|
||||
return YES;
|
||||
case CDVIntentAndNavigationFilterValueIntentAllowed:
|
||||
// only allow-intent if it's a CDVWebViewNavigationTypeLinkClicked (anchor tag) or CDVWebViewNavigationTypeOther and it's an internal link
|
||||
if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){
|
||||
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
|
||||
}
|
||||
|
||||
// consume the request (i.e. no error) if it wasn't handled above
|
||||
return NO;
|
||||
case CDVIntentAndNavigationFilterValueNoneAllowed:
|
||||
// allow-navigation attempt failed for sure
|
||||
NSLog(@"%@", [NSString stringWithFormat:allowNavigations_whitelistRejectionFormatString, [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]]);
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)shouldOverrideLoadWithRequest:(NSURLRequest*)request navigationType:(CDVWebViewNavigationType)navigationType
|
||||
{
|
||||
return [[self class] shouldOverrideLoadWithRequest:request navigationType:navigationType filterValue:[self filterUrl:request.URL]];
|
||||
}
|
||||
|
||||
@end
|
@ -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 CDVLaunchScreen : CDVPlugin
|
||||
|
||||
- (void)show:(CDVInvokedUrlCommand*)command;
|
||||
- (void)hide:(CDVInvokedUrlCommand*)command;
|
||||
|
||||
@end
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
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 "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];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
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 CDVLogger : CDVPlugin
|
||||
|
||||
- (void)logLevel:(CDVInvokedUrlCommand*)command;
|
||||
|
||||
@end
|
@ -0,0 +1,37 @@
|
||||
/*
|
||||
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 "CDVLogger.h"
|
||||
|
||||
@implementation CDVLogger
|
||||
|
||||
/* log a message */
|
||||
- (void)logLevel:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
id level = [command argumentAtIndex:0];
|
||||
id message = [command argumentAtIndex:1];
|
||||
|
||||
if ([level isEqualToString:@"LOG"]) {
|
||||
NSLog(@"%@", message);
|
||||
} else {
|
||||
NSLog(@"%@: %@", level, message);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
@ -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 <WebKit/WebKit.h>
|
||||
#import <Cordova/CDV.h>
|
||||
|
||||
@interface CDVWebViewEngine : CDVPlugin <CDVWebViewEngineProtocol, WKScriptMessageHandler, WKNavigationDelegate>
|
||||
|
||||
@property (nonatomic, strong, readonly) id <WKUIDelegate> uiDelegate;
|
||||
|
||||
- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
|
||||
|
||||
@end
|
@ -0,0 +1,607 @@
|
||||
/*
|
||||
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 "CDVWebViewEngine.h"
|
||||
#import "CDVWebViewUIDelegate.h"
|
||||
#import "CDVWebViewProcessPoolFactory.h"
|
||||
#import <Cordova/NSDictionary+CordovaPreferences.h>
|
||||
#import "CDVURLSchemeHandler.h"
|
||||
|
||||
#import <objc/message.h>
|
||||
|
||||
#define CDV_BRIDGE_NAME @"cordova"
|
||||
#define CDV_WKWEBVIEW_FILE_URL_LOAD_SELECTOR @"loadFileURL:allowingReadAccessToURL:"
|
||||
|
||||
@interface CDVWebViewWeakScriptMessageHandler : NSObject <WKScriptMessageHandler>
|
||||
|
||||
@property (nonatomic, weak, readonly) id<WKScriptMessageHandler>scriptMessageHandler;
|
||||
|
||||
- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface CDVWebViewEngine ()
|
||||
|
||||
@property (nonatomic, strong, readwrite) UIView* engineWebView;
|
||||
@property (nonatomic, strong, readwrite) id <WKUIDelegate> uiDelegate;
|
||||
@property (nonatomic, weak) id <WKScriptMessageHandler> weakScriptMessageHandler;
|
||||
@property (nonatomic, strong) CDVURLSchemeHandler * schemeHandler;
|
||||
@property (nonatomic, readwrite) NSString *CDV_ASSETS_URL;
|
||||
@property (nonatomic, readwrite) Boolean cdvIsFileScheme;
|
||||
|
||||
@end
|
||||
|
||||
// see forwardingTargetForSelector: selector comment for the reason for this pragma
|
||||
#pragma clang diagnostic ignored "-Wprotocol"
|
||||
|
||||
@implementation CDVWebViewEngine
|
||||
|
||||
@synthesize engineWebView = _engineWebView;
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
if (NSClassFromString(@"WKWebView") == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
self.engineWebView = [[WKWebView alloc] initWithFrame:frame];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)settings
|
||||
{
|
||||
WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
|
||||
configuration.processPool = [[CDVWebViewProcessPoolFactory sharedFactory] sharedProcessPool];
|
||||
if (settings == nil) {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
configuration.allowsInlineMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowInlineMediaPlayback" defaultValue:NO];
|
||||
|
||||
// Set the media types that are required for user action for playback
|
||||
WKAudiovisualMediaTypes mediaType = WKAudiovisualMediaTypeAll; // default
|
||||
|
||||
// targetMediaType will always exist, either from user's "config.xml" or default ("defaults.xml").
|
||||
id targetMediaType = [settings cordovaSettingForKey:@"MediaTypesRequiringUserActionForPlayback"];
|
||||
if ([targetMediaType isEqualToString:@"none"]) {
|
||||
mediaType = WKAudiovisualMediaTypeNone;
|
||||
} else if ([targetMediaType isEqualToString:@"audio"]) {
|
||||
mediaType = WKAudiovisualMediaTypeAudio;
|
||||
} else if ([targetMediaType isEqualToString:@"video"]) {
|
||||
mediaType = WKAudiovisualMediaTypeVideo;
|
||||
} else if ([targetMediaType isEqualToString:@"all"]) {
|
||||
mediaType = WKAudiovisualMediaTypeAll;
|
||||
} else {
|
||||
NSLog(@"Invalid \"MediaTypesRequiringUserActionForPlayback\" was detected. Fallback to default value of \"all\" types.");
|
||||
}
|
||||
configuration.mediaTypesRequiringUserActionForPlayback = mediaType;
|
||||
|
||||
configuration.suppressesIncrementalRendering = [settings cordovaBoolSettingForKey:@"SuppressesIncrementalRendering" defaultValue:NO];
|
||||
|
||||
/*
|
||||
* If the old preference key "MediaPlaybackAllowsAirPlay" exists, use it or default to "YES".
|
||||
* Check if the new preference key "AllowsAirPlayForMediaPlayback" exists and overwrite the "MediaPlaybackAllowsAirPlay" value.
|
||||
*/
|
||||
BOOL allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"MediaPlaybackAllowsAirPlay" defaultValue:YES];
|
||||
if([settings cordovaSettingForKey:@"AllowsAirPlayForMediaPlayback"] != nil) {
|
||||
allowsAirPlayForMediaPlayback = [settings cordovaBoolSettingForKey:@"AllowsAirPlayForMediaPlayback" defaultValue:YES];
|
||||
}
|
||||
configuration.allowsAirPlayForMediaPlayback = allowsAirPlayForMediaPlayback;
|
||||
|
||||
/*
|
||||
* Sets Custom User Agents
|
||||
* - (Default) "userAgent" is set the the clean user agent.
|
||||
* E.g.
|
||||
* UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
|
||||
*
|
||||
* - If "OverrideUserAgent" is set, it will overwrite the entire "userAgent" value. The "AppendUserAgent" will be iggnored if set.
|
||||
* Notice: The override logic is handled in the "pluginInitialize" method.
|
||||
* E.g.
|
||||
* OverrideUserAgent = "foobar"
|
||||
* UserAgent = "foobar"
|
||||
*
|
||||
* - If "AppendUserAgent" is set and "OverrideUserAgent" is not set, the user defined "AppendUserAgent" will be appended to the "userAgent"
|
||||
* E.g.
|
||||
* AppendUserAgent = "foobar"
|
||||
* UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 foobar"
|
||||
*/
|
||||
NSString *userAgent = configuration.applicationNameForUserAgent;
|
||||
if (
|
||||
[settings cordovaSettingForKey:@"OverrideUserAgent"] == nil &&
|
||||
[settings cordovaSettingForKey:@"AppendUserAgent"] != nil
|
||||
) {
|
||||
userAgent = [NSString stringWithFormat:@"%@ %@", userAgent, [settings cordovaSettingForKey:@"AppendUserAgent"]];
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
NSString *scheme = [settings cordovaSettingForKey:@"scheme"];
|
||||
|
||||
// If scheme is file or nil, then default to file scheme
|
||||
self.cdvIsFileScheme = [scheme isEqualToString: @"file"] || scheme == nil;
|
||||
|
||||
NSString *hostname = @"";
|
||||
if(!self.cdvIsFileScheme) {
|
||||
if(scheme == nil || [WKWebView handlesURLScheme:scheme]){
|
||||
scheme = @"app";
|
||||
}
|
||||
vc.appScheme = scheme;
|
||||
|
||||
hostname = [settings cordovaSettingForKey:@"hostname"];
|
||||
if(hostname == nil){
|
||||
hostname = @"localhost";
|
||||
}
|
||||
|
||||
self.CDV_ASSETS_URL = [NSString stringWithFormat:@"%@://%@", scheme, hostname];
|
||||
}
|
||||
|
||||
CDVWebViewUIDelegate* uiDelegate = [[CDVWebViewUIDelegate alloc] initWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]];
|
||||
uiDelegate.allowNewWindows = [settings cordovaBoolSettingForKey:@"AllowNewWindows" defaultValue:NO];
|
||||
self.uiDelegate = uiDelegate;
|
||||
|
||||
CDVWebViewWeakScriptMessageHandler *weakScriptMessageHandler = [[CDVWebViewWeakScriptMessageHandler alloc] initWithScriptMessageHandler:self];
|
||||
|
||||
WKUserContentController* userContentController = [[WKUserContentController alloc] init];
|
||||
[userContentController addScriptMessageHandler:weakScriptMessageHandler name:CDV_BRIDGE_NAME];
|
||||
|
||||
if(self.CDV_ASSETS_URL) {
|
||||
NSString *scriptCode = [NSString stringWithFormat:@"window.CDV_ASSETS_URL = '%@';", self.CDV_ASSETS_URL];
|
||||
WKUserScript *wkScript = [[WKUserScript alloc] initWithSource:scriptCode injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
|
||||
|
||||
if (wkScript) {
|
||||
[userContentController addUserScript:wkScript];
|
||||
}
|
||||
}
|
||||
|
||||
WKWebViewConfiguration* configuration = [self createConfigurationFromSettings:settings];
|
||||
configuration.userContentController = userContentController;
|
||||
|
||||
// Do not configure the scheme handler if the scheme is default (file)
|
||||
if(!self.cdvIsFileScheme) {
|
||||
self.schemeHandler = [[CDVURLSchemeHandler alloc] initWithVC:vc];
|
||||
[configuration setURLSchemeHandler:self.schemeHandler forURLScheme:scheme];
|
||||
}
|
||||
|
||||
// re-create WKWebView, since we need to update configuration
|
||||
WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration];
|
||||
wkWebView.UIDelegate = self.uiDelegate;
|
||||
|
||||
/*
|
||||
* This is where the "OverrideUserAgent" is handled. This will replace the entire UserAgent
|
||||
* with the user defined custom UserAgent.
|
||||
*/
|
||||
if ([settings cordovaSettingForKey:@"OverrideUserAgent"] != nil) {
|
||||
wkWebView.customUserAgent = [settings cordovaSettingForKey:@"OverrideUserAgent"];
|
||||
}
|
||||
|
||||
self.engineWebView = wkWebView;
|
||||
|
||||
if ([self.viewController conformsToProtocol:@protocol(WKUIDelegate)]) {
|
||||
wkWebView.UIDelegate = (id <WKUIDelegate>)self.viewController;
|
||||
}
|
||||
|
||||
if ([self.viewController conformsToProtocol:@protocol(WKNavigationDelegate)]) {
|
||||
wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self.viewController;
|
||||
} else {
|
||||
wkWebView.navigationDelegate = (id <WKNavigationDelegate>)self;
|
||||
}
|
||||
|
||||
if ([self.viewController conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
|
||||
[wkWebView.configuration.userContentController addScriptMessageHandler:(id < WKScriptMessageHandler >)self.viewController name:CDV_BRIDGE_NAME];
|
||||
}
|
||||
|
||||
[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
|
||||
{
|
||||
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"];
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
- (id)loadRequest:(NSURLRequest*)request
|
||||
{
|
||||
if ([self canLoadRequest:request]) { // can load, differentiate between file urls and other schemes
|
||||
if(request.URL.fileURL && self.cdvIsFileScheme) {
|
||||
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];
|
||||
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]) {
|
||||
url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", self.CDV_ASSETS_URL, startURL]];
|
||||
}
|
||||
if(request.URL.query) {
|
||||
url = [NSURL URLWithString:[@"?" stringByAppendingString:request.URL.query] relativeToURL:url];
|
||||
}
|
||||
if(request.URL.fragment) {
|
||||
url = [NSURL URLWithString:[@"#" stringByAppendingString:request.URL.fragment] relativeToURL:url];
|
||||
}
|
||||
request = [NSURLRequest requestWithURL:url];
|
||||
}
|
||||
return [(WKWebView*)_engineWebView loadRequest:request];
|
||||
} else { // can't load, print out error
|
||||
NSString* errorHtml = [NSString stringWithFormat:
|
||||
@"<!doctype html>"
|
||||
@"<title>Error</title>"
|
||||
@"<div style='font-size:2em'>"
|
||||
@" <p>The WebView engine '%@' is unable to load the request: %@</p>"
|
||||
@" <p>Most likely the cause of the error is that the loading of file urls is not supported in iOS %@.</p>"
|
||||
@"</div>",
|
||||
NSStringFromClass([self class]),
|
||||
[request.URL description],
|
||||
[[UIDevice currentDevice] systemVersion]
|
||||
];
|
||||
return [self loadHTMLString:errorHtml baseURL:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (id)loadHTMLString:(NSString*)string baseURL:(NSURL*)baseURL
|
||||
{
|
||||
return [(WKWebView*)_engineWebView loadHTMLString:string baseURL:baseURL];
|
||||
}
|
||||
|
||||
- (NSURL*) URL
|
||||
{
|
||||
return [(WKWebView*)_engineWebView URL];
|
||||
}
|
||||
|
||||
- (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;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateSettings:(NSDictionary*)settings
|
||||
{
|
||||
WKWebView* wkWebView = (WKWebView*)_engineWebView;
|
||||
|
||||
wkWebView.configuration.preferences.minimumFontSize = [settings cordovaFloatSettingForKey:@"MinimumFontSize" defaultValue:0.0];
|
||||
|
||||
/*
|
||||
wkWebView.configuration.preferences.javaScriptEnabled = [settings cordovaBoolSettingForKey:@"JavaScriptEnabled" default:YES];
|
||||
wkWebView.configuration.preferences.javaScriptCanOpenWindowsAutomatically = [settings cordovaBoolSettingForKey:@"JavaScriptCanOpenWindowsAutomatically" default:NO];
|
||||
*/
|
||||
|
||||
// By default, DisallowOverscroll is false (thus bounce is allowed)
|
||||
BOOL bounceAllowed = !([settings cordovaBoolSettingForKey:@"DisallowOverscroll" defaultValue:NO]);
|
||||
|
||||
// prevent webView from bouncing
|
||||
if (!bounceAllowed) {
|
||||
if ([wkWebView respondsToSelector:@selector(scrollView)]) {
|
||||
((UIScrollView*)[wkWebView scrollView]).bounces = NO;
|
||||
} else {
|
||||
for (id subview in wkWebView.subviews) {
|
||||
if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
|
||||
((UIScrollView*)subview).bounces = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NSString* decelerationSetting = [settings cordovaSettingForKey:@"WKWebViewDecelerationSpeed"];
|
||||
|
||||
if (![@"fast" isEqualToString:decelerationSetting]) {
|
||||
[wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];
|
||||
} else {
|
||||
[wkWebView.scrollView setDecelerationRate:UIScrollViewDecelerationRateFast];
|
||||
}
|
||||
|
||||
wkWebView.allowsBackForwardNavigationGestures = [settings cordovaBoolSettingForKey:@"AllowBackForwardNavigationGestures" defaultValue:NO];
|
||||
wkWebView.allowsLinkPreview = [settings cordovaBoolSettingForKey:@"Allow3DTouchLinkPreview" defaultValue:YES];
|
||||
}
|
||||
|
||||
- (void)updateWithInfo:(NSDictionary*)info
|
||||
{
|
||||
NSDictionary* scriptMessageHandlers = [info objectForKey:kCDVWebViewEngineScriptMessageHandlers];
|
||||
NSDictionary* settings = [info objectForKey:kCDVWebViewEngineWebViewPreferences];
|
||||
id navigationDelegate = [info objectForKey:kCDVWebViewEngineWKNavigationDelegate];
|
||||
id uiDelegate = [info objectForKey:kCDVWebViewEngineWKUIDelegate];
|
||||
|
||||
WKWebView* wkWebView = (WKWebView*)_engineWebView;
|
||||
|
||||
if (scriptMessageHandlers && [scriptMessageHandlers isKindOfClass:[NSDictionary class]]) {
|
||||
NSArray* allKeys = [scriptMessageHandlers allKeys];
|
||||
|
||||
for (NSString* key in allKeys) {
|
||||
id object = [scriptMessageHandlers objectForKey:key];
|
||||
if ([object conformsToProtocol:@protocol(WKScriptMessageHandler)]) {
|
||||
[wkWebView.configuration.userContentController addScriptMessageHandler:object name:key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (navigationDelegate && [navigationDelegate conformsToProtocol:@protocol(WKNavigationDelegate)]) {
|
||||
wkWebView.navigationDelegate = navigationDelegate;
|
||||
}
|
||||
|
||||
if (uiDelegate && [uiDelegate conformsToProtocol:@protocol(WKUIDelegate)]) {
|
||||
wkWebView.UIDelegate = uiDelegate;
|
||||
}
|
||||
|
||||
if (settings && [settings isKindOfClass:[NSDictionary class]]) {
|
||||
[self updateSettings:settings];
|
||||
}
|
||||
}
|
||||
|
||||
// This forwards the methods that are in the header that are not implemented here.
|
||||
// Both WKWebView implement the below:
|
||||
// loadHTMLString:baseURL:
|
||||
// loadRequest:
|
||||
- (id)forwardingTargetForSelector:(SEL)aSelector
|
||||
{
|
||||
return _engineWebView;
|
||||
}
|
||||
|
||||
- (UIView*)webView
|
||||
{
|
||||
return self.engineWebView;
|
||||
}
|
||||
|
||||
#pragma mark WKScriptMessageHandler implementation
|
||||
|
||||
- (void)userContentController:(WKUserContentController*)userContentController didReceiveScriptMessage:(WKScriptMessage*)message
|
||||
{
|
||||
if (![message.name isEqualToString:CDV_BRIDGE_NAME]) {
|
||||
return;
|
||||
}
|
||||
|
||||
CDVViewController* vc = (CDVViewController*)self.viewController;
|
||||
|
||||
NSArray* jsonEntry = message.body; // NSString:callbackId, NSString:service, NSString:action, NSArray:args
|
||||
CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry];
|
||||
CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName);
|
||||
|
||||
if (![vc.commandQueue execute:command]) {
|
||||
#ifdef DEBUG
|
||||
NSError* error = nil;
|
||||
NSString* commandJson = nil;
|
||||
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonEntry
|
||||
options:0
|
||||
error:&error];
|
||||
|
||||
if (error == nil) {
|
||||
commandJson = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||
}
|
||||
|
||||
static NSUInteger maxLogLength = 1024;
|
||||
NSString* commandString = ([commandJson length] > maxLogLength) ?
|
||||
[NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] :
|
||||
commandJson;
|
||||
|
||||
NSLog(@"FAILED pluginJSON = %@", commandString);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark WKNavigationDelegate implementation
|
||||
|
||||
- (void)webView:(WKWebView*)webView didStartProvisionalNavigation:(WKNavigation*)navigation
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:webView]];
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView*)webView didFinishNavigation:(WKNavigation*)navigation
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:webView]];
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView*)theWebView didFailProvisionalNavigation:(WKNavigation*)navigation withError:(NSError*)error
|
||||
{
|
||||
[self webView:theWebView didFailNavigation:navigation withError:error];
|
||||
}
|
||||
|
||||
- (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]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView
|
||||
{
|
||||
[webView reload];
|
||||
}
|
||||
|
||||
- (BOOL)defaultResourcePolicyForURL:(NSURL*)url
|
||||
{
|
||||
// all file:// urls are allowed
|
||||
if ([url isFileURL]) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) webView: (WKWebView *) webView decidePolicyForNavigationAction: (WKNavigationAction*) navigationAction decisionHandler: (void (^)(WKNavigationActionPolicy)) decisionHandler
|
||||
{
|
||||
NSURL* url = [navigationAction.request URL];
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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:url];
|
||||
if (shouldAllowNavigation) {
|
||||
return decisionHandler(YES);
|
||||
} else {
|
||||
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
|
||||
}
|
||||
|
||||
return decisionHandler(NO);
|
||||
}
|
||||
|
||||
#pragma mark - Plugin interface
|
||||
|
||||
- (void)allowsBackForwardNavigationGestures:(CDVInvokedUrlCommand*)command;
|
||||
{
|
||||
id value = [command argumentAtIndex:0];
|
||||
if (!([value isKindOfClass:[NSNumber class]])) {
|
||||
value = [NSNumber numberWithBool:NO];
|
||||
}
|
||||
|
||||
WKWebView* wkWebView = (WKWebView*)_engineWebView;
|
||||
wkWebView.allowsBackForwardNavigationGestures = [value boolValue];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark - CDVWebViewWeakScriptMessageHandler
|
||||
|
||||
@implementation CDVWebViewWeakScriptMessageHandler
|
||||
|
||||
- (instancetype)initWithScriptMessageHandler:(id<WKScriptMessageHandler>)scriptMessageHandler
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_scriptMessageHandler = scriptMessageHandler;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message
|
||||
{
|
||||
[self.scriptMessageHandler userContentController:userContentController didReceiveScriptMessage:message];
|
||||
}
|
||||
|
||||
@end
|
@ -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 <WebKit/WebKit.h>
|
||||
|
||||
@interface CDVWebViewProcessPoolFactory : NSObject
|
||||
@property (nonatomic, retain) WKProcessPool* sharedPool;
|
||||
|
||||
+(instancetype) sharedFactory;
|
||||
-(WKProcessPool*) sharedProcessPool;
|
||||
@end
|
@ -0,0 +1,49 @@
|
||||
/*
|
||||
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 <WebKit/WebKit.h>
|
||||
#import "CDVWebViewProcessPoolFactory.h"
|
||||
|
||||
static CDVWebViewProcessPoolFactory *factory = nil;
|
||||
|
||||
@implementation CDVWebViewProcessPoolFactory
|
||||
|
||||
+ (instancetype)sharedFactory
|
||||
{
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
factory = [[CDVWebViewProcessPoolFactory alloc] init];
|
||||
});
|
||||
|
||||
return factory;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
if (self = [super init]) {
|
||||
_sharedPool = [[WKProcessPool alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (WKProcessPool*) sharedProcessPool {
|
||||
return _sharedPool;
|
||||
}
|
||||
@end
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
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>
|
||||
|
||||
@interface CDVWebViewUIDelegate : NSObject <WKUIDelegate>
|
||||
{
|
||||
NSMutableArray<UIViewController*>* windows;
|
||||
}
|
||||
|
||||
@property (nonatomic, copy) NSString* title;
|
||||
@property (nonatomic, assign) BOOL allowNewWindows;
|
||||
|
||||
- (instancetype)initWithTitle:(NSString*)title;
|
||||
|
||||
@end
|
@ -0,0 +1,163 @@
|
||||
/*
|
||||
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 "CDVWebViewUIDelegate.h"
|
||||
|
||||
@implementation CDVWebViewUIDelegate
|
||||
|
||||
- (instancetype)initWithTitle:(NSString*)title
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.title = title;
|
||||
windows = [[NSMutableArray alloc] init];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) webView:(WKWebView*)webView runJavaScriptAlertPanelWithMessage:(NSString*)message
|
||||
initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(void))completionHandler
|
||||
{
|
||||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
|
||||
message:message
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction* action)
|
||||
{
|
||||
completionHandler();
|
||||
[alert dismissViewControllerAnimated:YES completion:nil];
|
||||
}];
|
||||
|
||||
[alert addAction:ok];
|
||||
|
||||
UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
||||
|
||||
[rootController presentViewController:alert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void) webView:(WKWebView*)webView runJavaScriptConfirmPanelWithMessage:(NSString*)message
|
||||
initiatedByFrame:(WKFrameInfo*)frame completionHandler:(void (^)(BOOL result))completionHandler
|
||||
{
|
||||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
|
||||
message:message
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction* action)
|
||||
{
|
||||
completionHandler(YES);
|
||||
[alert dismissViewControllerAnimated:YES completion:nil];
|
||||
}];
|
||||
|
||||
[alert addAction:ok];
|
||||
|
||||
UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction* action)
|
||||
{
|
||||
completionHandler(NO);
|
||||
[alert dismissViewControllerAnimated:YES completion:nil];
|
||||
}];
|
||||
[alert addAction:cancel];
|
||||
|
||||
UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
||||
|
||||
[rootController presentViewController:alert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void) webView:(WKWebView*)webView runJavaScriptTextInputPanelWithPrompt:(NSString*)prompt
|
||||
defaultText:(NSString*)defaultText initiatedByFrame:(WKFrameInfo*)frame
|
||||
completionHandler:(void (^)(NSString* result))completionHandler
|
||||
{
|
||||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:self.title
|
||||
message:prompt
|
||||
preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK")
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction* action)
|
||||
{
|
||||
completionHandler(((UITextField*)alert.textFields[0]).text);
|
||||
[alert dismissViewControllerAnimated:YES completion:nil];
|
||||
}];
|
||||
|
||||
[alert addAction:ok];
|
||||
|
||||
UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"Cancel")
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction* action)
|
||||
{
|
||||
completionHandler(nil);
|
||||
[alert dismissViewControllerAnimated:YES completion:nil];
|
||||
}];
|
||||
[alert addAction:cancel];
|
||||
|
||||
[alert addTextFieldWithConfigurationHandler:^(UITextField* textField) {
|
||||
textField.text = defaultText;
|
||||
}];
|
||||
|
||||
UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
||||
|
||||
[rootController presentViewController:alert animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (WKWebView*) webView:(WKWebView*)webView createWebViewWithConfiguration:(WKWebViewConfiguration*)configuration forNavigationAction:(WKNavigationAction*)navigationAction windowFeatures:(WKWindowFeatures*)windowFeatures
|
||||
{
|
||||
if (!navigationAction.targetFrame.isMainFrame) {
|
||||
if (self.allowNewWindows) {
|
||||
WKWebView* v = [[WKWebView alloc] initWithFrame:webView.frame configuration:configuration];
|
||||
v.UIDelegate = webView.UIDelegate;
|
||||
v.navigationDelegate = webView.navigationDelegate;
|
||||
|
||||
UIViewController* vc = [[UIViewController alloc] init];
|
||||
vc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
|
||||
vc.view = v;
|
||||
|
||||
[windows addObject:vc];
|
||||
|
||||
UIViewController* rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
||||
[rootController presentViewController:vc animated:YES completion:nil];
|
||||
return v;
|
||||
} else {
|
||||
[webView loadRequest:navigationAction.request];
|
||||
}
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)webViewDidClose:(WKWebView*)webView
|
||||
{
|
||||
for (UIViewController* vc in windows) {
|
||||
if (vc.view == webView) {
|
||||
[vc dismissViewControllerAnimated:YES completion:nil];
|
||||
[windows removeObject:vc];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// We do not allow closing the primary WebView
|
||||
}
|
||||
|
||||
|
||||
@end
|
30
platforms/ios/CordovaLib/Classes/Public/CDV.h
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
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"
|
28
platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.h
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
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 "CDVViewController.h"
|
||||
|
||||
@interface CDVAppDelegate : NSObject <UIApplicationDelegate>{}
|
||||
|
||||
@property (nonatomic, strong) IBOutlet UIWindow* window;
|
||||
@property (nonatomic, strong) IBOutlet CDVViewController* viewController;
|
||||
|
||||
@end
|
97
platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m
Normal file
@ -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 "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
|
118
platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h
Normal file
@ -0,0 +1,118 @@
|
||||
/*
|
||||
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 "CDVAvailabilityDeprecated.h"
|
||||
|
||||
#define __CORDOVA_IOS__
|
||||
|
||||
#define __CORDOVA_0_9_6 906
|
||||
#define __CORDOVA_1_0_0 10000
|
||||
#define __CORDOVA_1_1_0 10100
|
||||
#define __CORDOVA_1_2_0 10200
|
||||
#define __CORDOVA_1_3_0 10300
|
||||
#define __CORDOVA_1_4_0 10400
|
||||
#define __CORDOVA_1_4_1 10401
|
||||
#define __CORDOVA_1_5_0 10500
|
||||
#define __CORDOVA_1_6_0 10600
|
||||
#define __CORDOVA_1_6_1 10601
|
||||
#define __CORDOVA_1_7_0 10700
|
||||
#define __CORDOVA_1_8_0 10800
|
||||
#define __CORDOVA_1_8_1 10801
|
||||
#define __CORDOVA_1_9_0 10900
|
||||
#define __CORDOVA_2_0_0 20000
|
||||
#define __CORDOVA_2_1_0 20100
|
||||
#define __CORDOVA_2_2_0 20200
|
||||
#define __CORDOVA_2_3_0 20300
|
||||
#define __CORDOVA_2_4_0 20400
|
||||
#define __CORDOVA_2_5_0 20500
|
||||
#define __CORDOVA_2_6_0 20600
|
||||
#define __CORDOVA_2_7_0 20700
|
||||
#define __CORDOVA_2_8_0 20800
|
||||
#define __CORDOVA_2_9_0 20900
|
||||
#define __CORDOVA_3_0_0 30000
|
||||
#define __CORDOVA_3_1_0 30100
|
||||
#define __CORDOVA_3_2_0 30200
|
||||
#define __CORDOVA_3_3_0 30300
|
||||
#define __CORDOVA_3_4_0 30400
|
||||
#define __CORDOVA_3_4_1 30401
|
||||
#define __CORDOVA_3_5_0 30500
|
||||
#define __CORDOVA_3_6_0 30600
|
||||
#define __CORDOVA_3_7_0 30700
|
||||
#define __CORDOVA_3_8_0 30800
|
||||
#define __CORDOVA_3_9_0 30900
|
||||
#define __CORDOVA_3_9_1 30901
|
||||
#define __CORDOVA_3_9_2 30902
|
||||
#define __CORDOVA_4_0_0 40000
|
||||
#define __CORDOVA_4_0_1 40001
|
||||
#define __CORDOVA_4_1_0 40100
|
||||
#define __CORDOVA_4_1_1 40101
|
||||
#define __CORDOVA_4_2_0 40200
|
||||
#define __CORDOVA_4_2_1 40201
|
||||
#define __CORDOVA_4_3_0 40300
|
||||
#define __CORDOVA_4_3_1 40301
|
||||
#define __CORDOVA_4_4_0 40400
|
||||
#define __CORDOVA_4_5_0 40500
|
||||
#define __CORDOVA_4_5_1 40501
|
||||
#define __CORDOVA_4_5_2 40502
|
||||
#define __CORDOVA_4_5_4 40504
|
||||
#define __CORDOVA_5_0_0 50000
|
||||
#define __CORDOVA_5_0_1 50001
|
||||
#define __CORDOVA_5_1_0 50100
|
||||
#define __CORDOVA_5_1_1 50101
|
||||
#define __CORDOVA_6_0_0 60000
|
||||
#define __CORDOVA_6_1_0 60100
|
||||
#define __CORDOVA_6_1_1 60101
|
||||
/* coho:next-version,insert-before */
|
||||
#define __CORDOVA_NA 99999 /* not available */
|
||||
|
||||
/*
|
||||
#if CORDOVA_VERSION_MIN_REQUIRED >= __CORDOVA_4_0_0
|
||||
// do something when its at least 4.0.0
|
||||
#else
|
||||
// do something else (non 4.0.0)
|
||||
#endif
|
||||
*/
|
||||
#ifndef CORDOVA_VERSION_MIN_REQUIRED
|
||||
/* coho:next-version-min-required,replace-after */
|
||||
#define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_6_1_1
|
||||
#endif
|
||||
|
||||
/*
|
||||
Returns YES if it is at least version specified as NSString(X)
|
||||
Usage:
|
||||
if (IsAtLeastiOSVersion(@"5.1")) {
|
||||
// do something for iOS 5.1 or greater
|
||||
}
|
||||
*/
|
||||
#define IsAtLeastiOSVersion(X) ([[[UIDevice currentDevice] systemVersion] compare:X options:NSNumericSearch] != NSOrderedAscending)
|
||||
|
||||
/* 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, \
|
||||
(CORDOVA_VERSION_MIN_REQUIRED % 10000) % 100]
|
||||
|
||||
// Enable this to log all exec() calls.
|
||||
#define CDV_ENABLE_EXEC_LOGGING 0
|
||||
#if CDV_ENABLE_EXEC_LOGGING
|
||||
#define CDV_EXEC_LOG NSLog
|
||||
#else
|
||||
#define CDV_EXEC_LOG(...) do { \
|
||||
} while (NO)
|
||||
#endif
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
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>
|
||||
|
||||
#ifdef __clang__
|
||||
#define CDV_DEPRECATED(version, msg) __attribute__((deprecated("Deprecated in Cordova " #version ". " msg)))
|
||||
#else
|
||||
#define CDV_DEPRECATED(version, msg) __attribute__((deprecated()))
|
||||
#endif
|
49
platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegate.h
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
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
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
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 "CDVCommandDelegate.h"
|
||||
|
||||
@class CDVViewController;
|
||||
@class CDVCommandQueue;
|
||||
|
||||
@interface CDVCommandDelegateImpl : NSObject <CDVCommandDelegate>{
|
||||
@private
|
||||
__weak CDVViewController* _viewController;
|
||||
NSRegularExpression* _callbackIdPattern;
|
||||
@protected
|
||||
__weak CDVCommandQueue* _commandQueue;
|
||||
BOOL _delayResponses;
|
||||
}
|
||||
- (id)initWithViewController:(CDVViewController*)viewController;
|
||||
- (void)flushCommandQueueWithDelayedJs;
|
||||
@end
|
181
platforms/ios/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m
Normal file
@ -0,0 +1,181 @@
|
||||
/*
|
||||
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 "CDVCommandDelegateImpl.h"
|
||||
#import "CDVJSON_private.h"
|
||||
#import "CDVCommandQueue.h"
|
||||
#import "CDVPluginResult.h"
|
||||
#import "CDVViewController.h"
|
||||
|
||||
@implementation CDVCommandDelegateImpl
|
||||
|
||||
@synthesize urlTransformer;
|
||||
|
||||
- (id)initWithViewController:(CDVViewController*)viewController
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_viewController = viewController;
|
||||
_commandQueue = _viewController.commandQueue;
|
||||
|
||||
NSError* err = nil;
|
||||
_callbackIdPattern = [NSRegularExpression regularExpressionWithPattern:@"[^A-Za-z0-9._-]" options:0 error:&err];
|
||||
if (err != nil) {
|
||||
// Couldn't initialize Regex
|
||||
NSLog(@"Error: Couldn't initialize regex");
|
||||
_callbackIdPattern = nil;
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString*)pathForResource:(NSString*)resourcepath
|
||||
{
|
||||
NSBundle* mainBundle = [NSBundle mainBundle];
|
||||
NSMutableArray* directoryParts = [NSMutableArray arrayWithArray:[resourcepath componentsSeparatedByString:@"/"]];
|
||||
NSString* filename = [directoryParts lastObject];
|
||||
|
||||
[directoryParts removeLastObject];
|
||||
|
||||
NSString* directoryPartsJoined = [directoryParts componentsJoinedByString:@"/"];
|
||||
NSString* directoryStr = _viewController.wwwFolderName;
|
||||
|
||||
if ([directoryPartsJoined length] > 0) {
|
||||
directoryStr = [NSString stringWithFormat:@"%@/%@", _viewController.wwwFolderName, [directoryParts componentsJoinedByString:@"/"]];
|
||||
}
|
||||
|
||||
return [mainBundle pathForResource:filename ofType:@"" inDirectory:directoryStr];
|
||||
}
|
||||
|
||||
- (void)flushCommandQueueWithDelayedJs
|
||||
{
|
||||
_delayResponses = YES;
|
||||
[_commandQueue executePending];
|
||||
_delayResponses = NO;
|
||||
}
|
||||
|
||||
- (void)evalJsHelper2:(NSString*)js
|
||||
{
|
||||
CDV_EXEC_LOG(@"Exec: evalling: %@", [js substringToIndex:MIN([js length], 160)]);
|
||||
[_viewController.webViewEngine evaluateJavaScript:js completionHandler:^(id obj, NSError* error) {
|
||||
// TODO: obj can be something other than string
|
||||
if ([obj isKindOfClass:[NSString class]]) {
|
||||
NSString* commandsJSON = (NSString*)obj;
|
||||
if ([commandsJSON length] > 0) {
|
||||
CDV_EXEC_LOG(@"Exec: Retrieved new exec messages by chaining.");
|
||||
}
|
||||
|
||||
[self->_commandQueue enqueueCommandBatch:commandsJSON];
|
||||
[self->_commandQueue executePending];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)evalJsHelper:(NSString*)js
|
||||
{
|
||||
// Cycle the run-loop before executing the JS.
|
||||
// For _delayResponses -
|
||||
// This ensures that we don't eval JS during the middle of an existing JS
|
||||
// function (possible since WKWebViewDelegate callbacks can be synchronous).
|
||||
// For !isMainThread -
|
||||
// It's a hard error to eval on the non-UI thread.
|
||||
// For !_commandQueue.currentlyExecuting -
|
||||
// This works around a bug where sometimes alerts() within callbacks can cause
|
||||
// dead-lock.
|
||||
// If the commandQueue is currently executing, then we know that it is safe to
|
||||
// execute the callback immediately.
|
||||
// Using (dispatch_get_main_queue()) does *not* fix deadlocks for some reason,
|
||||
// but performSelectorOnMainThread: does.
|
||||
if (_delayResponses || ![NSThread isMainThread] || !_commandQueue.currentlyExecuting) {
|
||||
[self performSelectorOnMainThread:@selector(evalJsHelper2:) withObject:js waitUntilDone:NO];
|
||||
} else {
|
||||
[self evalJsHelper2:js];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)isValidCallbackId:(NSString*)callbackId
|
||||
{
|
||||
if ((callbackId == nil) || (_callbackIdPattern == nil)) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
// Disallow if too long or if any invalid characters were found.
|
||||
if (([callbackId length] > 100) || [_callbackIdPattern firstMatchInString:callbackId options:0 range:NSMakeRange(0, [callbackId length])]) {
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId
|
||||
{
|
||||
CDV_EXEC_LOG(@"Exec(%@): Sending result. Status=%@", callbackId, result.status);
|
||||
// This occurs when there is are no win/fail callbacks for the call.
|
||||
if ([@"INVALID" isEqualToString:callbackId]) {
|
||||
return;
|
||||
}
|
||||
// This occurs when the callback id is malformed.
|
||||
if (![self isValidCallbackId:callbackId]) {
|
||||
NSLog(@"Invalid callback id received by sendPluginResult");
|
||||
return;
|
||||
}
|
||||
int status = [result.status intValue];
|
||||
BOOL keepCallback = [result.keepCallback boolValue];
|
||||
NSString* argumentsAsJSON = [result argumentsAsJSON];
|
||||
BOOL debug = NO;
|
||||
|
||||
#ifdef DEBUG
|
||||
debug = YES;
|
||||
#endif
|
||||
|
||||
NSString* js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeCallback('%@',%d,%@,%d, %d)", callbackId, status, argumentsAsJSON, keepCallback, debug];
|
||||
|
||||
[self evalJsHelper:js];
|
||||
}
|
||||
|
||||
- (void)evalJs:(NSString*)js
|
||||
{
|
||||
[self evalJs:js scheduledOnRunLoop:YES];
|
||||
}
|
||||
|
||||
- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop
|
||||
{
|
||||
js = [NSString stringWithFormat:@"try{cordova.require('cordova/exec').nativeEvalAndFetch(function(){%@})}catch(e){console.log('exception nativeEvalAndFetch : '+e);};", js];
|
||||
if (scheduledOnRunLoop) {
|
||||
[self evalJsHelper:js];
|
||||
} else {
|
||||
[self evalJsHelper2:js];
|
||||
}
|
||||
}
|
||||
|
||||
- (id)getCommandInstance:(NSString*)pluginName
|
||||
{
|
||||
return [_viewController getCommandInstance:pluginName];
|
||||
}
|
||||
|
||||
- (void)runInBackground:(void (^)(void))block
|
||||
{
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
|
||||
}
|
||||
|
||||
- (NSDictionary*)settings
|
||||
{
|
||||
return _viewController.settings;
|
||||
}
|
||||
|
||||
@end
|
39
platforms/ios/CordovaLib/Classes/Public/CDVCommandQueue.h
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
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>
|
||||
|
||||
@class CDVInvokedUrlCommand;
|
||||
@class CDVViewController;
|
||||
|
||||
@interface CDVCommandQueue : NSObject
|
||||
|
||||
@property (nonatomic, readonly) BOOL currentlyExecuting;
|
||||
|
||||
- (id)initWithViewController:(CDVViewController*)viewController;
|
||||
- (void)dispose;
|
||||
|
||||
- (void)resetRequestId;
|
||||
- (void)enqueueCommandBatch:(NSString*)batchJSON;
|
||||
|
||||
- (void)fetchCommandsFromJs;
|
||||
- (void)executePending;
|
||||
- (BOOL)execute:(CDVInvokedUrlCommand*)command;
|
||||
|
||||
@end
|
194
platforms/ios/CordovaLib/Classes/Public/CDVCommandQueue.m
Normal file
@ -0,0 +1,194 @@
|
||||
/*
|
||||
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 <objc/message.h>
|
||||
#import "CDVCommandQueue.h"
|
||||
#import "CDVViewController.h"
|
||||
#import "CDVCommandDelegateImpl.h"
|
||||
#import "CDVJSON_private.h"
|
||||
#import "CDVDebug.h"
|
||||
|
||||
// Parse JS on the main thread if it's shorter than this.
|
||||
static const NSInteger JSON_SIZE_FOR_MAIN_THREAD = 4 * 1024; // Chosen arbitrarily.
|
||||
// Execute multiple commands in one go until this many seconds have passed.
|
||||
static const double MAX_EXECUTION_TIME = .008; // Half of a 60fps frame.
|
||||
|
||||
@interface CDVCommandQueue () {
|
||||
NSInteger _lastCommandQueueFlushRequestId;
|
||||
__weak CDVViewController* _viewController;
|
||||
NSMutableArray* _queue;
|
||||
NSTimeInterval _startExecutionTime;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation CDVCommandQueue
|
||||
|
||||
- (BOOL)currentlyExecuting
|
||||
{
|
||||
return _startExecutionTime > 0;
|
||||
}
|
||||
|
||||
- (id)initWithViewController:(CDVViewController*)viewController
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_viewController = viewController;
|
||||
_queue = [[NSMutableArray alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dispose
|
||||
{
|
||||
// TODO(agrieve): Make this a zeroing weak ref once we drop support for 4.3.
|
||||
_viewController = nil;
|
||||
}
|
||||
|
||||
- (void)resetRequestId
|
||||
{
|
||||
_lastCommandQueueFlushRequestId = 0;
|
||||
}
|
||||
|
||||
- (void)enqueueCommandBatch:(NSString*)batchJSON
|
||||
{
|
||||
if ([batchJSON length] > 0) {
|
||||
NSMutableArray* commandBatchHolder = [[NSMutableArray alloc] init];
|
||||
[_queue addObject:commandBatchHolder];
|
||||
if ([batchJSON length] < JSON_SIZE_FOR_MAIN_THREAD) {
|
||||
[commandBatchHolder addObject:[batchJSON cdv_JSONObject]];
|
||||
} else {
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() {
|
||||
NSMutableArray* result = [batchJSON cdv_JSONObject];
|
||||
@synchronized(commandBatchHolder) {
|
||||
[commandBatchHolder addObject:result];
|
||||
}
|
||||
[self performSelectorOnMainThread:@selector(executePending) withObject:nil waitUntilDone:NO];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)fetchCommandsFromJs
|
||||
{
|
||||
__weak CDVCommandQueue* weakSelf = self;
|
||||
NSString* js = @"cordova.require('cordova/exec').nativeFetchMessages()";
|
||||
|
||||
[_viewController.webViewEngine evaluateJavaScript:js
|
||||
completionHandler:^(id obj, NSError* error) {
|
||||
if ((error == nil) && [obj isKindOfClass:[NSString class]]) {
|
||||
NSString* queuedCommandsJSON = (NSString*)obj;
|
||||
CDV_EXEC_LOG(@"Exec: Flushed JS->native queue (hadCommands=%d).", [queuedCommandsJSON length] > 0);
|
||||
[weakSelf enqueueCommandBatch:queuedCommandsJSON];
|
||||
// this has to be called here now, because fetchCommandsFromJs is now async (previously: synchronous)
|
||||
[self executePending];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)executePending
|
||||
{
|
||||
// Make us re-entrant-safe.
|
||||
if (_startExecutionTime > 0) {
|
||||
return;
|
||||
}
|
||||
@try {
|
||||
_startExecutionTime = [NSDate timeIntervalSinceReferenceDate];
|
||||
|
||||
while ([_queue count] > 0) {
|
||||
NSMutableArray* commandBatchHolder = _queue[0];
|
||||
NSMutableArray* commandBatch = nil;
|
||||
@synchronized(commandBatchHolder) {
|
||||
// If the next-up command is still being decoded, wait for it.
|
||||
if ([commandBatchHolder count] == 0) {
|
||||
break;
|
||||
}
|
||||
commandBatch = commandBatchHolder[0];
|
||||
}
|
||||
|
||||
while ([commandBatch count] > 0) {
|
||||
@autoreleasepool {
|
||||
// Execute the commands one-at-a-time.
|
||||
NSArray* jsonEntry = [commandBatch cdv_dequeue];
|
||||
if ([commandBatch count] == 0) {
|
||||
[_queue removeObjectAtIndex:0];
|
||||
}
|
||||
CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry];
|
||||
CDV_EXEC_LOG(@"Exec(%@): Calling %@.%@", command.callbackId, command.className, command.methodName);
|
||||
|
||||
if (![self execute:command]) {
|
||||
#ifdef DEBUG
|
||||
NSString* commandJson = [jsonEntry cdv_JSONString];
|
||||
static NSUInteger maxLogLength = 1024;
|
||||
NSString* commandString = ([commandJson length] > maxLogLength) ?
|
||||
[NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] :
|
||||
commandJson;
|
||||
|
||||
DLog(@"FAILED pluginJSON = %@", commandString);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// Yield if we're taking too long.
|
||||
if (([_queue count] > 0) && ([NSDate timeIntervalSinceReferenceDate] - _startExecutionTime > MAX_EXECUTION_TIME)) {
|
||||
[self performSelector:@selector(executePending) withObject:nil afterDelay:0];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} @finally
|
||||
{
|
||||
_startExecutionTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)execute:(CDVInvokedUrlCommand*)command
|
||||
{
|
||||
if ((command.className == nil) || (command.methodName == nil)) {
|
||||
NSLog(@"ERROR: Classname and/or methodName not found for command.");
|
||||
return NO;
|
||||
}
|
||||
|
||||
// Fetch an instance of this class
|
||||
CDVPlugin* obj = [_viewController.commandDelegate getCommandInstance:command.className];
|
||||
|
||||
if (!([obj isKindOfClass:[CDVPlugin class]])) {
|
||||
NSLog(@"ERROR: Plugin '%@' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.", command.className);
|
||||
return NO;
|
||||
}
|
||||
BOOL retVal = YES;
|
||||
double started = [[NSDate date] timeIntervalSince1970] * 1000.0;
|
||||
// Find the proper selector to call.
|
||||
NSString* methodName = [NSString stringWithFormat:@"%@:", command.methodName];
|
||||
SEL normalSelector = NSSelectorFromString(methodName);
|
||||
if ([obj respondsToSelector:normalSelector]) {
|
||||
// [obj performSelector:normalSelector withObject:command];
|
||||
((void (*)(id, SEL, id))objc_msgSend)(obj, normalSelector, command);
|
||||
} else {
|
||||
// There's no method to call, so throw an error.
|
||||
NSLog(@"ERROR: Method '%@' not defined in Plugin '%@'", methodName, command.className);
|
||||
retVal = NO;
|
||||
}
|
||||
double elapsed = [[NSDate date] timeIntervalSince1970] * 1000.0 - started;
|
||||
if (elapsed > 10) {
|
||||
NSLog(@"THREAD WARNING: ['%@'] took '%f' ms. Plugin should use a background thread.", command.className, elapsed);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@end
|
30
platforms/ios/CordovaLib/Classes/Public/CDVConfigParser.h
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
@interface CDVConfigParser : NSObject <NSXMLParserDelegate>
|
||||
{
|
||||
NSString* featureName;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly, strong) NSMutableDictionary* pluginsDict;
|
||||
@property (nonatomic, readonly, strong) NSMutableDictionary* settings;
|
||||
@property (nonatomic, readonly, strong) NSMutableArray* startupPluginNames;
|
||||
@property (nonatomic, readonly, strong) NSString* startPage;
|
||||
|
||||
@end
|
81
platforms/ios/CordovaLib/Classes/Public/CDVConfigParser.m
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
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 "CDVConfigParser.h"
|
||||
|
||||
@interface CDVConfigParser ()
|
||||
|
||||
@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;
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
self.pluginsDict = [[NSMutableDictionary alloc] initWithCapacity:30];
|
||||
self.settings = [[NSMutableDictionary alloc] initWithCapacity:30];
|
||||
self.startupPluginNames = [[NSMutableArray alloc] initWithCapacity:8];
|
||||
featureName = nil;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (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];
|
||||
id value = attributeDict[@"value"];
|
||||
if ([paramName isEqualToString:@"ios-package"]) {
|
||||
pluginsDict[featureName] = value;
|
||||
}
|
||||
BOOL paramIsOnload = ([paramName isEqualToString:@"onload"] && [@"true" isEqualToString : value]);
|
||||
BOOL attribIsOnload = [@"true" isEqualToString :[attributeDict[@"onload"] lowercaseString]];
|
||||
if (paramIsOnload || attribIsOnload) {
|
||||
[self.startupPluginNames addObject:featureName];
|
||||
}
|
||||
} else if ([elementName isEqualToString:@"content"]) {
|
||||
self.startPage = attributeDict[@"src"];
|
||||
}
|
||||
}
|
||||
|
||||
- (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
|
||||
{
|
||||
NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]);
|
||||
}
|
||||
|
||||
@end
|
@ -0,0 +1,52 @@
|
||||
/*
|
||||
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 CDVInvokedUrlCommand : NSObject {
|
||||
NSString* _callbackId;
|
||||
NSString* _className;
|
||||
NSString* _methodName;
|
||||
NSArray* _arguments;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) NSArray* arguments;
|
||||
@property (nonatomic, readonly) NSString* callbackId;
|
||||
@property (nonatomic, readonly) NSString* className;
|
||||
@property (nonatomic, readonly) NSString* methodName;
|
||||
|
||||
+ (CDVInvokedUrlCommand*)commandFromJson:(NSArray*)jsonEntry;
|
||||
|
||||
- (id)initWithArguments:(NSArray*)arguments
|
||||
callbackId:(NSString*)callbackId
|
||||
className:(NSString*)className
|
||||
methodName:(NSString*)methodName;
|
||||
|
||||
- (id)initFromJson:(NSArray*)jsonEntry;
|
||||
|
||||
// Returns the argument at the given index.
|
||||
// If index >= the number of arguments, returns nil.
|
||||
// If the argument at the given index is NSNull, returns nil.
|
||||
- (id)argumentAtIndex:(NSUInteger)index;
|
||||
// Same as above, but returns defaultValue instead of nil.
|
||||
- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue;
|
||||
// Same as above, but returns defaultValue instead of nil, and if the argument is not of the expected class, returns defaultValue
|
||||
- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue andClass:(Class)aClass;
|
||||
|
||||
@end
|
116
platforms/ios/CordovaLib/Classes/Public/CDVInvokedUrlCommand.m
Normal file
@ -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 "CDVInvokedUrlCommand.h"
|
||||
#import "CDVJSON_private.h"
|
||||
|
||||
@implementation CDVInvokedUrlCommand
|
||||
|
||||
@synthesize arguments = _arguments;
|
||||
@synthesize callbackId = _callbackId;
|
||||
@synthesize className = _className;
|
||||
@synthesize methodName = _methodName;
|
||||
|
||||
+ (CDVInvokedUrlCommand*)commandFromJson:(NSArray*)jsonEntry
|
||||
{
|
||||
return [[CDVInvokedUrlCommand alloc] initFromJson:jsonEntry];
|
||||
}
|
||||
|
||||
- (id)initFromJson:(NSArray*)jsonEntry
|
||||
{
|
||||
id tmp = [jsonEntry objectAtIndex:0];
|
||||
NSString* callbackId = tmp == [NSNull null] ? nil : tmp;
|
||||
NSString* className = [jsonEntry objectAtIndex:1];
|
||||
NSString* methodName = [jsonEntry objectAtIndex:2];
|
||||
NSMutableArray* arguments = [jsonEntry objectAtIndex:3];
|
||||
|
||||
return [self initWithArguments:arguments
|
||||
callbackId:callbackId
|
||||
className:className
|
||||
methodName:methodName];
|
||||
}
|
||||
|
||||
- (id)initWithArguments:(NSArray*)arguments
|
||||
callbackId:(NSString*)callbackId
|
||||
className:(NSString*)className
|
||||
methodName:(NSString*)methodName
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_arguments = arguments;
|
||||
_callbackId = callbackId;
|
||||
_className = className;
|
||||
_methodName = methodName;
|
||||
}
|
||||
[self massageArguments];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)massageArguments
|
||||
{
|
||||
NSMutableArray* newArgs = nil;
|
||||
|
||||
for (NSUInteger i = 0, count = [_arguments count]; i < count; ++i) {
|
||||
id arg = [_arguments objectAtIndex:i];
|
||||
if (![arg isKindOfClass:[NSDictionary class]]) {
|
||||
continue;
|
||||
}
|
||||
NSDictionary* dict = arg;
|
||||
NSString* type = [dict objectForKey:@"CDVType"];
|
||||
if (!type || ![type isEqualToString:@"ArrayBuffer"]) {
|
||||
continue;
|
||||
}
|
||||
NSString* data = [dict objectForKey:@"data"];
|
||||
if (!data) {
|
||||
continue;
|
||||
}
|
||||
if (newArgs == nil) {
|
||||
newArgs = [NSMutableArray arrayWithArray:_arguments];
|
||||
_arguments = newArgs;
|
||||
}
|
||||
[newArgs replaceObjectAtIndex:i withObject:[[NSData alloc] initWithBase64EncodedString:data options:0]];
|
||||
}
|
||||
}
|
||||
|
||||
- (id)argumentAtIndex:(NSUInteger)index
|
||||
{
|
||||
return [self argumentAtIndex:index withDefault:nil];
|
||||
}
|
||||
|
||||
- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue
|
||||
{
|
||||
return [self argumentAtIndex:index withDefault:defaultValue andClass:nil];
|
||||
}
|
||||
|
||||
- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue andClass:(Class)aClass
|
||||
{
|
||||
if (index >= [_arguments count]) {
|
||||
return defaultValue;
|
||||
}
|
||||
id ret = [_arguments objectAtIndex:index];
|
||||
if (ret == [NSNull null]) {
|
||||
ret = defaultValue;
|
||||
}
|
||||
if ((aClass != nil) && ![ret isKindOfClass:aClass]) {
|
||||
ret = defaultValue;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@end
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
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
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
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 "CDVPlugin+Resources.h"
|
||||
|
||||
@implementation CDVPlugin (CDVPluginResources)
|
||||
|
||||
- (NSString*)pluginLocalizedString:(NSString*)key
|
||||
{
|
||||
NSBundle* bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:NSStringFromClass([self class]) ofType:@"bundle"]];
|
||||
|
||||
return [bundle localizedStringForKey:(key) value:nil table:nil];
|
||||
}
|
||||
|
||||
- (UIImage*)pluginImageResource:(NSString*)name
|
||||
{
|
||||
NSString* resourceIdentifier = [NSString stringWithFormat:@"%@.bundle/%@", NSStringFromClass([self class]), name];
|
||||
|
||||
return [UIImage imageNamed:resourceIdentifier];
|
||||
}
|
||||
|
||||
@end
|
74
platforms/ios/CordovaLib/Classes/Public/CDVPlugin.h
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
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
|
199
platforms/ios/CordovaLib/Classes/Public/CDVPlugin.m
Normal file
@ -0,0 +1,199 @@
|
||||
/*
|
||||
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 "CDVPlugin.h"
|
||||
#import "CDVPlugin+Private.h"
|
||||
#import "CDVPlugin+Resources.h"
|
||||
#import "CDVViewController.h"
|
||||
#include <objc/message.h>
|
||||
|
||||
@implementation UIView (org_apache_cordova_UIView_Extension)
|
||||
|
||||
@dynamic scrollView;
|
||||
|
||||
- (UIScrollView*)scrollView
|
||||
{
|
||||
SEL scrollViewSelector = NSSelectorFromString(@"scrollView");
|
||||
|
||||
if ([self respondsToSelector:scrollViewSelector]) {
|
||||
return ((id (*)(id, SEL))objc_msgSend)(self, scrollViewSelector);
|
||||
}
|
||||
|
||||
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";
|
||||
|
||||
@interface CDVPlugin ()
|
||||
|
||||
@property (readwrite, assign) BOOL hasPendingOperation;
|
||||
@property (nonatomic, readwrite, weak) id <CDVWebViewEngineProtocol> webViewEngine;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CDVPlugin
|
||||
@synthesize webViewEngine, viewController, commandDelegate, hasPendingOperation;
|
||||
@dynamic webView;
|
||||
|
||||
// Do not override these methods. Use pluginInitialize instead.
|
||||
- (instancetype)initWithWebViewEngine:(id <CDVWebViewEngineProtocol>)theWebViewEngine
|
||||
{
|
||||
self = [super 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];
|
||||
|
||||
self.webViewEngine = theWebViewEngine;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)pluginInitialize
|
||||
{
|
||||
// You can listen to more app notifications, see:
|
||||
// http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006728-CH3-DontLinkElementID_4
|
||||
|
||||
// NOTE: if you want to use these, make sure you uncomment the corresponding notification handler
|
||||
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPause) name:UIApplicationDidEnterBackgroundNotification object:nil];
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResume) name:UIApplicationWillEnterForegroundNotification object:nil];
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationWillChange) name:UIApplicationWillChangeStatusBarOrientationNotification object:nil];
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationDidChange) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
|
||||
|
||||
// Added in 2.5.0
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad:) name:CDVPageDidLoadNotification object:self.webView];
|
||||
//Added in 4.3.0
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillAppear:) name:CDVViewWillAppearNotification object:nil];
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidAppear:) name:CDVViewDidAppearNotification object:nil];
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillDisappear:) name:CDVViewWillDisappearNotification object:nil];
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidDisappear:) name:CDVViewDidDisappearNotification object:nil];
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillLayoutSubviews:) name:CDVViewWillLayoutSubviewsNotification object:nil];
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidLayoutSubviews:) name:CDVViewDidLayoutSubviewsNotification object:nil];
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillTransitionToSize:) name:CDVViewWillTransitionToSizeNotification object:nil];
|
||||
}
|
||||
|
||||
- (void)dispose
|
||||
{
|
||||
viewController = nil;
|
||||
commandDelegate = nil;
|
||||
}
|
||||
|
||||
- (UIView*)webView
|
||||
{
|
||||
if (self.webViewEngine != nil) {
|
||||
return self.webViewEngine.engineWebView;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
/*
|
||||
// NOTE: for onPause and onResume, calls into JavaScript must not call or trigger any blocking UI, like alerts
|
||||
- (void) onPause {}
|
||||
- (void) onResume {}
|
||||
- (void) onOrientationWillChange {}
|
||||
- (void) onOrientationDidChange {}
|
||||
*/
|
||||
|
||||
/* NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts */
|
||||
- (void)handleOpenURL:(NSNotification*)notification
|
||||
{
|
||||
// override to handle urls sent to your app
|
||||
// register your url schemes in your App-Info.plist
|
||||
|
||||
NSURL* url = [notification object];
|
||||
|
||||
if ([url isKindOfClass:[NSURL class]]) {
|
||||
/* Do your thing! */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts
|
||||
*/
|
||||
- (void)handleOpenURLWithApplicationSourceAndAnnotation: (NSNotification*)notification
|
||||
{
|
||||
|
||||
// override to handle urls sent to your app
|
||||
// register your url schemes in your App-Info.plist
|
||||
|
||||
// The notification object is an NSDictionary which contains
|
||||
// - url which is a type of NSURL
|
||||
// - sourceApplication which is a type of NSString and represents the package
|
||||
// id of the app that calls our app
|
||||
// - annotation which a type of Property list which can be several different types
|
||||
// please see https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/PropertyList.html
|
||||
|
||||
NSDictionary* notificationData = [notification object];
|
||||
|
||||
if ([notificationData isKindOfClass: NSDictionary.class]){
|
||||
|
||||
NSURL* url = notificationData[@"url"];
|
||||
NSString* sourceApplication = notificationData[@"sourceApplication"];
|
||||
id annotation = notificationData[@"annotation"];
|
||||
|
||||
if ([url isKindOfClass:NSURL.class] && [sourceApplication isKindOfClass:NSString.class] && annotation) {
|
||||
/* Do your thing! */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts */
|
||||
- (void)onAppTerminate
|
||||
{
|
||||
// override this if you need to do any cleanup on app exit
|
||||
}
|
||||
|
||||
- (void)onMemoryWarning
|
||||
{
|
||||
// override to remove caches, etc
|
||||
}
|
||||
|
||||
- (void)onReset
|
||||
{
|
||||
// Override to cancel any long-running requests when the WebView navigates or refreshes.
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self]; // this will remove all notifications unless added using addObserverForName:object:queue:usingBlock:
|
||||
}
|
||||
|
||||
- (id)appDelegate
|
||||
{
|
||||
return [[UIApplication sharedApplication] delegate];
|
||||
}
|
||||
|
||||
@end
|
83
platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.h
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
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
|
203
platforms/ios/CordovaLib/Classes/Public/CDVPluginResult.m
Normal file
@ -0,0 +1,203 @@
|
||||
/*
|
||||
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 "CDVPluginResult.h"
|
||||
#import "CDVJSON_private.h"
|
||||
#import "CDVDebug.h"
|
||||
|
||||
// This exists to preserve compatibility with early Swift plugins, who are
|
||||
// using CDVCommandStatus as ObjC-style constants rather than as Swift enum
|
||||
// values.
|
||||
// These constants alias the enum values back to their previous names.
|
||||
#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);
|
||||
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 ()
|
||||
|
||||
- (CDVPluginResult*)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)theMessage;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CDVPluginResult
|
||||
@synthesize status, message, keepCallback, associatedObject;
|
||||
|
||||
static NSArray* org_apache_cordova_CommandStatusMsgs;
|
||||
|
||||
id messageFromArrayBuffer(NSData* data)
|
||||
{
|
||||
return @{
|
||||
@"CDVType" : @"ArrayBuffer",
|
||||
@"data" :[data base64EncodedStringWithOptions:0]
|
||||
};
|
||||
}
|
||||
|
||||
id massageMessage(id message)
|
||||
{
|
||||
if ([message isKindOfClass:[NSData class]]) {
|
||||
return messageFromArrayBuffer(message);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
id messageFromMultipart(NSArray* theMessages)
|
||||
{
|
||||
NSMutableArray* messages = [NSMutableArray arrayWithArray:theMessages];
|
||||
|
||||
for (NSUInteger i = 0; i < messages.count; ++i) {
|
||||
[messages replaceObjectAtIndex:i withObject:massageMessage([messages objectAtIndex:i])];
|
||||
}
|
||||
|
||||
return @{
|
||||
@"CDVType" : @"MultiPart",
|
||||
@"messages" : messages
|
||||
};
|
||||
}
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
org_apache_cordova_CommandStatusMsgs = [[NSArray alloc] initWithObjects:@"No result",
|
||||
@"OK",
|
||||
@"Class not found",
|
||||
@"Illegal access",
|
||||
@"Instantiation error",
|
||||
@"Malformed url",
|
||||
@"IO error",
|
||||
@"Invalid action",
|
||||
@"JSON error",
|
||||
@"Error",
|
||||
nil];
|
||||
}
|
||||
|
||||
- (CDVPluginResult*)init
|
||||
{
|
||||
return [self initWithStatus:CDVCommandStatus_NO_RESULT message:nil];
|
||||
}
|
||||
|
||||
- (CDVPluginResult*)initWithStatus:(CDVCommandStatus)statusOrdinal message:(id)theMessage
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
status = @(statusOrdinal);
|
||||
message = theMessage;
|
||||
keepCallback = [NSNumber numberWithBool:NO];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal
|
||||
{
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:nil];
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsString:(NSString*)theMessage
|
||||
{
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:theMessage];
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArray:(NSArray*)theMessage
|
||||
{
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:theMessage];
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsInt:(int)theMessage
|
||||
{
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithInt:theMessage]];
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSInteger:(NSInteger)theMessage
|
||||
{
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithInteger:theMessage]];
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsNSUInteger:(NSUInteger)theMessage
|
||||
{
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithUnsignedInteger:theMessage]];
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDouble:(double)theMessage
|
||||
{
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithDouble:theMessage]];
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsBool:(BOOL)theMessage
|
||||
{
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:[NSNumber numberWithBool:theMessage]];
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsDictionary:(NSDictionary*)theMessage
|
||||
{
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:theMessage];
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsArrayBuffer:(NSData*)theMessage
|
||||
{
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:messageFromArrayBuffer(theMessage)];
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAsMultipart:(NSArray*)theMessages
|
||||
{
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:messageFromMultipart(theMessages)];
|
||||
}
|
||||
|
||||
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageToErrorObject:(int)errorCode
|
||||
{
|
||||
NSDictionary* errDict = @{@"code" :[NSNumber numberWithInt:errorCode]};
|
||||
|
||||
return [[self alloc] initWithStatus:statusOrdinal message:errDict];
|
||||
}
|
||||
|
||||
- (void)setKeepCallbackAsBool:(BOOL)bKeepCallback
|
||||
{
|
||||
[self setKeepCallback:[NSNumber numberWithBool:bKeepCallback]];
|
||||
}
|
||||
|
||||
- (NSString*)argumentsAsJSON
|
||||
{
|
||||
id arguments = (self.message == nil ? [NSNull null] : self.message);
|
||||
NSArray* argumentsWrappedInArray = [NSArray arrayWithObject:arguments];
|
||||
|
||||
NSString* argumentsJSON = [argumentsWrappedInArray cdv_JSONString];
|
||||
|
||||
argumentsJSON = [argumentsJSON substringWithRange:NSMakeRange(1, [argumentsJSON length] - 2)];
|
||||
|
||||
return argumentsJSON;
|
||||
}
|
||||
|
||||
static BOOL gIsVerbose = NO;
|
||||
+ (void)setVerbose:(BOOL)verbose
|
||||
{
|
||||
gIsVerbose = verbose;
|
||||
}
|
||||
|
||||
+ (BOOL)isVerbose
|
||||
{
|
||||
return gIsVerbose;
|
||||
}
|
||||
|
||||
@end
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
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>
|
||||
|
||||
@protocol CDVScreenOrientationDelegate <NSObject>
|
||||
|
||||
- (UIInterfaceOrientationMask)supportedInterfaceOrientations;
|
||||
|
||||
- (BOOL)shouldAutorotate;
|
||||
|
||||
@end
|
27
platforms/ios/CordovaLib/Classes/Public/CDVTimer.h
Normal file
@ -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 <Foundation/Foundation.h>
|
||||
|
||||
@interface CDVTimer : NSObject
|
||||
|
||||
+ (void)start:(NSString*)name;
|
||||
+ (void)stop:(NSString*)name;
|
||||
|
||||
@end
|
123
platforms/ios/CordovaLib/Classes/Public/CDVTimer.m
Normal file
@ -0,0 +1,123 @@
|
||||
/*
|
||||
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 "CDVTimer.h"
|
||||
|
||||
#pragma mark CDVTimerItem
|
||||
|
||||
@interface CDVTimerItem : NSObject
|
||||
|
||||
@property (nonatomic, strong) NSString* name;
|
||||
@property (nonatomic, strong) NSDate* started;
|
||||
@property (nonatomic, strong) NSDate* ended;
|
||||
|
||||
- (void)log;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CDVTimerItem
|
||||
|
||||
- (void)log
|
||||
{
|
||||
NSLog(@"[CDVTimer][%@] %fms", self.name, [self.ended timeIntervalSinceDate:self.started] * 1000.0);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark CDVTimer
|
||||
|
||||
@interface CDVTimer ()
|
||||
|
||||
@property (nonatomic, strong) NSMutableDictionary* items;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CDVTimer
|
||||
|
||||
#pragma mark object methods
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if (self = [super init]) {
|
||||
self.items = [NSMutableDictionary dictionaryWithCapacity:6];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)add:(NSString*)name
|
||||
{
|
||||
if ([self.items objectForKey:[name lowercaseString]] == nil) {
|
||||
CDVTimerItem* item = [CDVTimerItem new];
|
||||
item.name = name;
|
||||
item.started = [NSDate new];
|
||||
[self.items setObject:item forKey:[name lowercaseString]];
|
||||
} else {
|
||||
NSLog(@"Timer called '%@' already exists.", name);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)remove:(NSString*)name
|
||||
{
|
||||
CDVTimerItem* item = [self.items objectForKey:[name lowercaseString]];
|
||||
|
||||
if (item != nil) {
|
||||
item.ended = [NSDate new];
|
||||
[item log];
|
||||
[self.items removeObjectForKey:[name lowercaseString]];
|
||||
} else {
|
||||
NSLog(@"Timer called '%@' does not exist.", name);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)removeAll
|
||||
{
|
||||
[self.items removeAllObjects];
|
||||
}
|
||||
|
||||
#pragma mark class methods
|
||||
|
||||
+ (void)start:(NSString*)name
|
||||
{
|
||||
[[CDVTimer sharedInstance] add:name];
|
||||
}
|
||||
|
||||
+ (void)stop:(NSString*)name
|
||||
{
|
||||
[[CDVTimer sharedInstance] remove:name];
|
||||
}
|
||||
|
||||
+ (void)clearAll
|
||||
{
|
||||
[[CDVTimer sharedInstance] removeAll];
|
||||
}
|
||||
|
||||
+ (CDVTimer*)sharedInstance
|
||||
{
|
||||
static dispatch_once_t pred = 0;
|
||||
__strong static CDVTimer* _sharedObject = nil;
|
||||
|
||||
dispatch_once(&pred, ^{
|
||||
_sharedObject = [[self alloc] init];
|
||||
});
|
||||
|
||||
return _sharedObject;
|
||||
}
|
||||
|
||||
@end
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
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 <WebKit/WebKit.h>
|
||||
#import "CDVViewController.h"
|
||||
|
||||
|
||||
@interface CDVURLSchemeHandler : NSObject <WKURLSchemeHandler>
|
||||
|
||||
@property (nonatomic, strong) CDVViewController* viewController;
|
||||
|
||||
- (instancetype)initWithVC:(CDVViewController *)controller;
|
||||
|
||||
|
||||
@end
|
108
platforms/ios/CordovaLib/Classes/Public/CDVURLSchemeHandler.m
Normal file
@ -0,0 +1,108 @@
|
||||
/*
|
||||
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>
|
||||
|
||||
@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;
|
||||
|
||||
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];
|
||||
[urlSchemeTask didReceiveData:data];
|
||||
[urlSchemeTask didFinish];
|
||||
|
||||
}
|
||||
|
||||
- (void)webView:(nonnull WKWebView *)webView stopURLSchemeTask:(nonnull id<WKURLSchemeTask>)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
|
77
platforms/ios/CordovaLib/Classes/Public/CDVViewController.h
Normal file
@ -0,0 +1,77 @@
|
||||
/*
|
||||
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) 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
|
813
platforms/ios/CordovaLib/Classes/Public/CDVViewController.m
Normal file
@ -0,0 +1,813 @@
|
||||
/*
|
||||
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];
|
||||
|
||||
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]) {
|
||||
[self showLaunchScreen:NO];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Method to be called from the plugin JavaScript to show or hide the launch screen.
|
||||
*/
|
||||
- (void)showLaunchScreen:(BOOL)visible
|
||||
{
|
||||
CGFloat splashScreenDelay = [self.settings cordovaFloatSettingForKey:@"SplashScreenDelay" defaultValue:0];
|
||||
|
||||
// AnimateWithDuration takes seconds but cordova documentation specifies milliseconds
|
||||
CGFloat fadeSplashScreenDuration = [self.settings cordovaFloatSettingForKey:@"FadeSplashScreenDuration" defaultValue:250];
|
||||
|
||||
// Setting minimum value for fade to 0.25 seconds
|
||||
fadeSplashScreenDuration = fadeSplashScreenDuration < 250 ? 250 : fadeSplashScreenDuration;
|
||||
|
||||
// Divide by 1000 because config returns milliseconds and NSTimer takes seconds
|
||||
CGFloat delayToFade = (MAX(splashScreenDelay, fadeSplashScreenDuration) - fadeSplashScreenDuration)/1000;
|
||||
CGFloat fadeDuration = fadeSplashScreenDuration/1000;
|
||||
|
||||
[NSTimer scheduledTimerWithTimeInterval:delayToFade repeats:NO block:^(NSTimer * _Nonnull timer) {
|
||||
[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
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
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>
|
||||
|
||||
#define kCDVWebViewEngineScriptMessageHandlers @"kCDVWebViewEngineScriptMessageHandlers"
|
||||
#define kCDVWebViewEngineWKNavigationDelegate @"kCDVWebViewEngineWKNavigationDelegate"
|
||||
#define kCDVWebViewEngineWKUIDelegate @"kCDVWebViewEngineWKUIDelegate"
|
||||
#define kCDVWebViewEngineWebViewPreferences @"kCDVWebViewEngineWebViewPreferences"
|
||||
|
||||
@protocol CDVWebViewEngineProtocol <NSObject>
|
||||
|
||||
@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;
|
||||
|
||||
- (NSURL*)URL;
|
||||
- (BOOL)canLoadRequest:(NSURLRequest*)request;
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame;
|
||||
- (void)updateWithInfo:(NSDictionary*)info;
|
||||
|
||||
@end
|
34
platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.h
Normal file
@ -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>
|
||||
|
||||
extern NSString* const kCDVDefaultWhitelistRejectionString;
|
||||
|
||||
@interface CDVWhitelist : NSObject
|
||||
|
||||
@property (nonatomic, copy) NSString* whitelistRejectionFormatString;
|
||||
|
||||
- (id)initWithArray:(NSArray*)array;
|
||||
- (BOOL)schemeIsAllowed:(NSString*)scheme;
|
||||
- (BOOL)URLIsAllowed:(NSURL*)url;
|
||||
- (BOOL)URLIsAllowed:(NSURL*)url logFailure:(BOOL)logFailure;
|
||||
- (NSString*)errorStringForURL:(NSURL*)url;
|
||||
|
||||
@end
|
285
platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.m
Normal file
@ -0,0 +1,285 @@
|
||||
/*
|
||||
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 "CDVWhitelist.h"
|
||||
|
||||
NSString* const kCDVDefaultWhitelistRejectionString = @"ERROR whitelist rejection: url='%@'";
|
||||
NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
|
||||
|
||||
@interface CDVWhitelistPattern : NSObject {
|
||||
@private
|
||||
NSRegularExpression* _scheme;
|
||||
NSRegularExpression* _host;
|
||||
NSNumber* _port;
|
||||
NSRegularExpression* _path;
|
||||
}
|
||||
|
||||
+ (NSString*)regexFromPattern:(NSString*)pattern allowWildcards:(bool)allowWildcards;
|
||||
- (id)initWithScheme:(NSString*)scheme host:(NSString*)host port:(NSString*)port path:(NSString*)path;
|
||||
- (bool)matches:(NSURL*)url;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CDVWhitelistPattern
|
||||
|
||||
+ (NSString*)regexFromPattern:(NSString*)pattern allowWildcards:(bool)allowWildcards
|
||||
{
|
||||
NSString* regex = [NSRegularExpression escapedPatternForString:pattern];
|
||||
|
||||
if (allowWildcards) {
|
||||
regex = [regex stringByReplacingOccurrencesOfString:@"\\*" withString:@".*"];
|
||||
|
||||
/* [NSURL path] has the peculiarity that a trailing slash at the end of a path
|
||||
* will be omitted. This regex tweak compensates for that.
|
||||
*/
|
||||
if ([regex hasSuffix:@"\\/.*"]) {
|
||||
regex = [NSString stringWithFormat:@"%@(\\/.*)?", [regex substringToIndex:([regex length] - 4)]];
|
||||
}
|
||||
}
|
||||
return [NSString stringWithFormat:@"%@$", regex];
|
||||
}
|
||||
|
||||
- (id)initWithScheme:(NSString*)scheme host:(NSString*)host port:(NSString*)port path:(NSString*)path
|
||||
{
|
||||
self = [super init]; // Potentially change "self"
|
||||
if (self) {
|
||||
if ((scheme == nil) || [scheme isEqualToString:@"*"]) {
|
||||
_scheme = nil;
|
||||
} else {
|
||||
_scheme = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern 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];
|
||||
} else {
|
||||
_host = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:host allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil];
|
||||
}
|
||||
if ((port == nil) || [port isEqualToString:@"*"]) {
|
||||
_port = nil;
|
||||
} else {
|
||||
_port = [[NSNumber alloc] initWithInteger:[port integerValue]];
|
||||
}
|
||||
if ((path == nil) || [path isEqualToString:@"/*"]) {
|
||||
_path = nil;
|
||||
} else {
|
||||
_path = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:path allowWildcards:YES] options:0 error:nil];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (bool)matches:(NSURL*)url
|
||||
{
|
||||
return (_scheme == nil || [_scheme numberOfMatchesInString:[url scheme] options:NSMatchingAnchored range:NSMakeRange(0, [[url scheme] length])]) &&
|
||||
(_host == nil || ([url host] != nil && [_host numberOfMatchesInString:[url host] options:NSMatchingAnchored range:NSMakeRange(0, [[url host] length])])) &&
|
||||
(_port == nil || [[url port] isEqualToNumber:_port]) &&
|
||||
(_path == nil || [_path numberOfMatchesInString:[url path] options:NSMatchingAnchored range:NSMakeRange(0, [[url path] length])])
|
||||
;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface CDVWhitelist ()
|
||||
|
||||
@property (nonatomic, readwrite, strong) NSMutableArray* whitelist;
|
||||
@property (nonatomic, readwrite, strong) NSMutableSet* permittedSchemes;
|
||||
|
||||
- (void)addWhiteListEntry:(NSString*)pattern;
|
||||
|
||||
@end
|
||||
|
||||
@implementation CDVWhitelist
|
||||
|
||||
@synthesize whitelist, permittedSchemes, whitelistRejectionFormatString;
|
||||
|
||||
- (id)initWithArray:(NSArray*)array
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.whitelist = [[NSMutableArray alloc] init];
|
||||
self.permittedSchemes = [[NSMutableSet alloc] init];
|
||||
self.whitelistRejectionFormatString = kCDVDefaultWhitelistRejectionString;
|
||||
|
||||
for (NSString* pattern in array) {
|
||||
[self addWhiteListEntry:pattern];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (BOOL)isIPv4Address:(NSString*)externalHost
|
||||
{
|
||||
// an IPv4 address has 4 octets b.b.b.b where b is a number between 0 and 255.
|
||||
// for our purposes, b can also be the wildcard character '*'
|
||||
|
||||
// we could use a regex to solve this problem but then I would have two problems
|
||||
// anyways, this is much clearer and maintainable
|
||||
NSArray* octets = [externalHost componentsSeparatedByString:@"."];
|
||||
NSUInteger num_octets = [octets count];
|
||||
|
||||
// quick check
|
||||
if (num_octets != 4) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
// restrict number parsing to 0-255
|
||||
NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];
|
||||
[numberFormatter setMinimum:[NSNumber numberWithUnsignedInteger:0]];
|
||||
[numberFormatter setMaximum:[NSNumber numberWithUnsignedInteger:255]];
|
||||
|
||||
// iterate through each octet, and test for a number between 0-255 or if it equals '*'
|
||||
for (NSUInteger i = 0; i < num_octets; ++i) {
|
||||
NSString* octet = [octets objectAtIndex:i];
|
||||
|
||||
if ([octet isEqualToString:@"*"]) { // passes - check next octet
|
||||
continue;
|
||||
} else if ([numberFormatter numberFromString:octet] == nil) { // fails - not a number and not within our range, return
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)addWhiteListEntry:(NSString*)origin
|
||||
{
|
||||
if (self.whitelist == nil) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ([origin isEqualToString:@"*"]) {
|
||||
NSLog(@"Unlimited access to network resources");
|
||||
self.whitelist = nil;
|
||||
self.permittedSchemes = nil;
|
||||
} else { // specific access
|
||||
NSRegularExpression* parts = [NSRegularExpression regularExpressionWithPattern:@"^((\\*|[A-Za-z-]+):/?/?)?(((\\*\\.)?[^*/:]+)|\\*)?(:(\\d+))?(/.*)?" options:0 error:nil];
|
||||
NSTextCheckingResult* m = [parts firstMatchInString:origin options:NSMatchingAnchored range:NSMakeRange(0, [origin length])];
|
||||
if (m != nil) {
|
||||
NSRange r;
|
||||
NSString* scheme = nil;
|
||||
r = [m rangeAtIndex:2];
|
||||
if (r.location != NSNotFound) {
|
||||
scheme = [origin substringWithRange:r];
|
||||
}
|
||||
|
||||
NSString* host = nil;
|
||||
r = [m rangeAtIndex:3];
|
||||
if (r.location != NSNotFound) {
|
||||
host = [origin substringWithRange:r];
|
||||
}
|
||||
|
||||
// Special case for two urls which are allowed to have empty hosts
|
||||
if (([scheme isEqualToString:@"file"] || [scheme isEqualToString:@"content"]) && (host == nil)) {
|
||||
host = @"*";
|
||||
}
|
||||
|
||||
NSString* port = nil;
|
||||
r = [m rangeAtIndex:7];
|
||||
if (r.location != NSNotFound) {
|
||||
port = [origin substringWithRange:r];
|
||||
}
|
||||
|
||||
NSString* path = nil;
|
||||
r = [m rangeAtIndex:8];
|
||||
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]];
|
||||
} else {
|
||||
[self.whitelist addObject:[[CDVWhitelistPattern alloc] initWithScheme:scheme host:host port:port path:path]];
|
||||
}
|
||||
|
||||
if (self.permittedSchemes != nil) {
|
||||
if ([scheme isEqualToString:@"*"]) {
|
||||
self.permittedSchemes = nil;
|
||||
} else if (scheme != nil) {
|
||||
[self.permittedSchemes addObject:scheme];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)schemeIsAllowed:(NSString*)scheme
|
||||
{
|
||||
if ([scheme isEqualToString:@"http"] ||
|
||||
[scheme isEqualToString:@"https"] ||
|
||||
[scheme isEqualToString:@"ftp"] ||
|
||||
[scheme isEqualToString:@"ftps"]) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
return (self.permittedSchemes == nil) || [self.permittedSchemes containsObject:scheme];
|
||||
}
|
||||
|
||||
- (BOOL)URLIsAllowed:(NSURL*)url
|
||||
{
|
||||
return [self URLIsAllowed:url logFailure:YES];
|
||||
}
|
||||
|
||||
- (BOOL)URLIsAllowed:(NSURL*)url logFailure:(BOOL)logFailure
|
||||
{
|
||||
// Shortcut acceptance: Are all urls whitelisted ("*" in whitelist)?
|
||||
if (whitelist == nil) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
// Shortcut rejection: Check that the scheme is supported
|
||||
NSString* scheme = [[url scheme] lowercaseString];
|
||||
if (![self schemeIsAllowed:scheme]) {
|
||||
if (logFailure) {
|
||||
NSLog(@"%@", [self errorStringForURL:url]);
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
// http[s] and ftp[s] should also validate against the common set in the kCDVDefaultSchemeName list
|
||||
if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [scheme isEqualToString:@"ftp"] || [scheme isEqualToString:@"ftps"]) {
|
||||
NSURL* newUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@%@", kCDVDefaultSchemeName, [url host], [[url path] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]]];
|
||||
// If it is allowed, we are done. If not, continue to check for the actual scheme-specific list
|
||||
if ([self URLIsAllowed:newUrl logFailure:NO]) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
// Check the url against patterns in the whitelist
|
||||
for (CDVWhitelistPattern* p in self.whitelist) {
|
||||
if ([p matches:url]) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
if (logFailure) {
|
||||
NSLog(@"%@", [self errorStringForURL:url]);
|
||||
}
|
||||
// if we got here, the url host is not in the white-list, do nothing
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSString*)errorStringForURL:(NSURL*)url
|
||||
{
|
||||
return [NSString stringWithFormat:self.whitelistRejectionFormatString, [url absoluteString]];
|
||||
}
|
||||
|
||||
@end
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
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>
|
||||
|
||||
@interface NSDictionary (CordovaPreferences)
|
||||
|
||||
- (id)cordovaSettingForKey:(NSString*)key;
|
||||
- (BOOL)cordovaBoolSettingForKey:(NSString*)key defaultValue:(BOOL)defaultValue;
|
||||
- (CGFloat)cordovaFloatSettingForKey:(NSString*)key defaultValue:(CGFloat)defaultValue;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSMutableDictionary (CordovaPreferences)
|
||||
|
||||
- (void)setCordovaSetting:(id)value forKey:(NSString*)key;
|
||||
|
||||
@end
|
@ -0,0 +1,92 @@
|
||||
/*
|
||||
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 "NSDictionary+CordovaPreferences.h"
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@implementation NSDictionary (CordovaPreferences)
|
||||
|
||||
- (id)cordovaSettingForKey:(NSString*)key
|
||||
{
|
||||
return [self objectForKey:[key lowercaseString]];
|
||||
}
|
||||
|
||||
- (BOOL)cordovaBoolSettingForKey:(NSString*)key defaultValue:(BOOL)defaultValue
|
||||
{
|
||||
BOOL value = defaultValue;
|
||||
id prefObj = [self cordovaSettingForKey:key];
|
||||
|
||||
if (prefObj == nil) {
|
||||
NSLog(@"The preference key \"%@\" is not defined and will default to \"%@\"",
|
||||
key,
|
||||
(defaultValue ? @"TRUE" : @"FALSE"));
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
if ([prefObj isKindOfClass:NSString.class]) {
|
||||
prefObj = [prefObj lowercaseString];
|
||||
|
||||
if (
|
||||
// True Case
|
||||
[prefObj isEqualToString:@"true"] ||
|
||||
[prefObj isEqualToString:@"1"] ||
|
||||
// False Case
|
||||
[prefObj isEqualToString:@"false"] ||
|
||||
[prefObj isEqualToString:@"0"]
|
||||
)
|
||||
{
|
||||
value = [prefObj isEqualToString:@"true"] || [prefObj isEqualToString:@"1"];
|
||||
}
|
||||
} else if (
|
||||
[prefObj isKindOfClass:NSNumber.class] &&
|
||||
(
|
||||
[prefObj isEqual: @YES] ||
|
||||
[prefObj isEqual: @NO]
|
||||
)
|
||||
)
|
||||
{
|
||||
value = [prefObj isEqual: @YES];
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
- (CGFloat)cordovaFloatSettingForKey:(NSString*)key defaultValue:(CGFloat)defaultValue
|
||||
{
|
||||
CGFloat value = defaultValue;
|
||||
id prefObj = [self cordovaSettingForKey:key];
|
||||
|
||||
if (prefObj != nil) {
|
||||
value = [prefObj floatValue];
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSMutableDictionary (CordovaPreferences)
|
||||
|
||||
- (void)setCordovaSetting:(id)value forKey:(NSString*)key
|
||||
{
|
||||
[self setObject:value forKey:[key lowercaseString]];
|
||||
}
|
||||
|
||||
@end
|
@ -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 <Foundation/Foundation.h>
|
||||
|
||||
@interface NSMutableArray (QueueAdditions)
|
||||
|
||||
- (id)cdv_pop;
|
||||
- (id)cdv_queueHead;
|
||||
- (id)cdv_dequeue;
|
||||
- (void)cdv_enqueue:(id)obj;
|
||||
|
||||
@end
|
@ -0,0 +1,58 @@
|
||||
/*
|
||||
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 "NSMutableArray+QueueAdditions.h"
|
||||
|
||||
@implementation NSMutableArray (QueueAdditions)
|
||||
|
||||
- (id)cdv_queueHead
|
||||
{
|
||||
if ([self count] == 0) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
return [self objectAtIndex:0];
|
||||
}
|
||||
|
||||
- (__autoreleasing id)cdv_dequeue
|
||||
{
|
||||
if ([self count] == 0) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
id head = [self objectAtIndex:0];
|
||||
if (head != nil) {
|
||||
// [[head retain] autorelease]; ARC - the __autoreleasing on the return value should so the same thing
|
||||
[self removeObjectAtIndex:0];
|
||||
}
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
- (id)cdv_pop
|
||||
{
|
||||
return [self cdv_dequeue];
|
||||
}
|
||||
|
||||
- (void)cdv_enqueue:(id)object
|
||||
{
|
||||
[self addObject:object];
|
||||
}
|
||||
|
||||
@end
|
791
platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,791 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 52;
|
||||
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, ); }; };
|
||||
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 */; };
|
||||
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, ); }; };
|
||||
4E714D3623F535B500A321AF /* CDVLaunchScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E714D3223F535B500A321AF /* CDVLaunchScreen.h */; };
|
||||
4E714D3823F535B500A321AF /* CDVLaunchScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E714D3423F535B500A321AF /* CDVLaunchScreen.m */; };
|
||||
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 */; };
|
||||
7ED95D041AB9028C008C4574 /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */; };
|
||||
7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; };
|
||||
7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; };
|
||||
7ED95D351AB9029B008C4574 /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */; };
|
||||
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, ); }; };
|
||||
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 */; };
|
||||
7ED95D3F1AB9029B008C4574 /* CDVConfigParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */; };
|
||||
7ED95D411AB9029B008C4574 /* CDVInvokedUrlCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */; };
|
||||
7ED95D431AB9029B008C4574 /* CDVPlugin+Resources.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */; };
|
||||
7ED95D451AB9029B008C4574 /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
7ED95D461AB9029B008C4574 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D201AB9029B008C4574 /* CDVPlugin.m */; };
|
||||
7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
7ED95D481AB9029B008C4574 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D221AB9029B008C4574 /* CDVPluginResult.m */; };
|
||||
7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
7ED95D4B1AB9029B008C4574 /* CDVTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D251AB9029B008C4574 /* CDVTimer.m */; };
|
||||
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 */; };
|
||||
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 */; };
|
||||
9052DE742150D040008E83D4 /* CDVConfigParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */; };
|
||||
9052DE752150D040008E83D4 /* CDVInvokedUrlCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */; };
|
||||
9052DE762150D040008E83D4 /* CDVPlugin+Resources.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */; };
|
||||
9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D201AB9029B008C4574 /* CDVPlugin.m */; };
|
||||
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 */; };
|
||||
9052DE812150D040008E83D4 /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 28BFF9131F355A4E00DDF01A /* CDVLogger.m */; };
|
||||
9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; };
|
||||
9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */; };
|
||||
9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */; };
|
||||
9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF21AB9028C008C4574 /* CDVDebug.h */; };
|
||||
9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */; };
|
||||
9052DE8B2150D06B008E83D4 /* CDVPlugin+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */; };
|
||||
9052DE8C2150D06B008E83D4 /* CDVLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BFF9121F355A4E00DDF01A /* CDVLogger.h */; };
|
||||
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 */; };
|
||||
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, ); }; };
|
||||
C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
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, ); }; };
|
||||
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, ); }; };
|
||||
C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
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 */
|
||||
|
||||
/* 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>"; };
|
||||
4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewUIDelegate.h; sourceTree = "<group>"; };
|
||||
4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewUIDelegate.m; sourceTree = "<group>"; };
|
||||
4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewEngine.m; sourceTree = "<group>"; };
|
||||
4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewProcessPoolFactory.h; sourceTree = "<group>"; };
|
||||
4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewEngine.h; sourceTree = "<group>"; };
|
||||
4E714D3223F535B500A321AF /* CDVLaunchScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVLaunchScreen.h; sourceTree = "<group>"; };
|
||||
4E714D3423F535B500A321AF /* CDVLaunchScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVLaunchScreen.m; sourceTree = "<group>"; };
|
||||
68A32D7114102E1C006B237C /* libCordova.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCordova.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7ED95CF21AB9028C008C4574 /* CDVDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVDebug.h; sourceTree = "<group>"; };
|
||||
7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVJSON_private.h; sourceTree = "<group>"; };
|
||||
7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVJSON_private.m; sourceTree = "<group>"; };
|
||||
7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CDVPlugin+Private.h"; sourceTree = "<group>"; };
|
||||
7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVHandleOpenURL.h; sourceTree = "<group>"; };
|
||||
7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVHandleOpenURL.m; sourceTree = "<group>"; };
|
||||
7ED95D0F1AB9029B008C4574 /* CDV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDV.h; sourceTree = "<group>"; };
|
||||
7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAppDelegate.h; sourceTree = "<group>"; };
|
||||
7ED95D111AB9029B008C4574 /* CDVAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVAppDelegate.m; sourceTree = "<group>"; };
|
||||
7ED95D121AB9029B008C4574 /* CDVAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAvailability.h; sourceTree = "<group>"; };
|
||||
7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAvailabilityDeprecated.h; sourceTree = "<group>"; };
|
||||
7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegate.h; sourceTree = "<group>"; };
|
||||
7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegateImpl.h; sourceTree = "<group>"; };
|
||||
7ED95D161AB9029B008C4574 /* CDVCommandDelegateImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandDelegateImpl.m; sourceTree = "<group>"; };
|
||||
7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandQueue.h; sourceTree = "<group>"; };
|
||||
7ED95D181AB9029B008C4574 /* CDVCommandQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandQueue.m; sourceTree = "<group>"; };
|
||||
7ED95D191AB9029B008C4574 /* CDVConfigParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVConfigParser.h; sourceTree = "<group>"; };
|
||||
7ED95D1A1AB9029B008C4574 /* CDVConfigParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVConfigParser.m; sourceTree = "<group>"; };
|
||||
7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVInvokedUrlCommand.h; sourceTree = "<group>"; };
|
||||
7ED95D1C1AB9029B008C4574 /* CDVInvokedUrlCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVInvokedUrlCommand.m; sourceTree = "<group>"; };
|
||||
7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CDVPlugin+Resources.h"; sourceTree = "<group>"; };
|
||||
7ED95D1E1AB9029B008C4574 /* CDVPlugin+Resources.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CDVPlugin+Resources.m"; sourceTree = "<group>"; };
|
||||
7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPlugin.h; sourceTree = "<group>"; };
|
||||
7ED95D201AB9029B008C4574 /* CDVPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPlugin.m; sourceTree = "<group>"; };
|
||||
7ED95D211AB9029B008C4574 /* CDVPluginResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPluginResult.h; sourceTree = "<group>"; };
|
||||
7ED95D221AB9029B008C4574 /* CDVPluginResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPluginResult.m; sourceTree = "<group>"; };
|
||||
7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVScreenOrientationDelegate.h; sourceTree = "<group>"; };
|
||||
7ED95D241AB9029B008C4574 /* CDVTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVTimer.h; sourceTree = "<group>"; };
|
||||
7ED95D251AB9029B008C4574 /* CDVTimer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVTimer.m; sourceTree = "<group>"; };
|
||||
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>"; };
|
||||
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>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
C0C01EAE1E3911D50056E6CB /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D2AAC07C0554694100DB518D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
034768DFFF38A50411DB9C8B /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
68A32D7114102E1C006B237C /* libCordova.a */,
|
||||
C0C01EB21E3911D50056E6CB /* Cordova.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0867D691FE84028FC02AAC07 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7ED95D0E1AB9029B008C4574 /* Public */,
|
||||
7ED95CF11AB9028C008C4574 /* Private */,
|
||||
C0C01EB31E3911D50056E6CB /* Cordova */,
|
||||
034768DFFF38A50411DB9C8B /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
28BFF9111F355A1D00DDF01A /* CDVLogger */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28BFF9121F355A4E00DDF01A /* CDVLogger.h */,
|
||||
28BFF9131F355A4E00DDF01A /* CDVLogger.m */,
|
||||
);
|
||||
path = CDVLogger;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3093E2211B16D6A3003F381A /* CDVIntentAndNavigationFilter.h */,
|
||||
3093E2221B16D6A3003F381A /* CDVIntentAndNavigationFilter.m */,
|
||||
);
|
||||
path = CDVIntentAndNavigationFilter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4E23F8F423E16D30006CD852 /* CDVWebViewEngine */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4E23F8FA23E16E96006CD852 /* CDVWebViewEngine.h */,
|
||||
4E23F8F823E16E96006CD852 /* CDVWebViewEngine.m */,
|
||||
4E23F8F923E16E96006CD852 /* CDVWebViewProcessPoolFactory.h */,
|
||||
4E23F8F523E16E96006CD852 /* CDVWebViewProcessPoolFactory.m */,
|
||||
4E23F8F623E16E96006CD852 /* CDVWebViewUIDelegate.h */,
|
||||
4E23F8F723E16E96006CD852 /* CDVWebViewUIDelegate.m */,
|
||||
);
|
||||
path = CDVWebViewEngine;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4E714D3123F5356700A321AF /* CDVLaunchScreen */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4E714D3223F535B500A321AF /* CDVLaunchScreen.h */,
|
||||
4E714D3423F535B500A321AF /* CDVLaunchScreen.m */,
|
||||
);
|
||||
path = CDVLaunchScreen;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7ED95CF11AB9028C008C4574 /* Private */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AA747D9E0F9514B9006C5449 /* CordovaLib_Prefix.pch */,
|
||||
7ED95CF21AB9028C008C4574 /* CDVDebug.h */,
|
||||
7ED95CF31AB9028C008C4574 /* CDVJSON_private.h */,
|
||||
7ED95CF41AB9028C008C4574 /* CDVJSON_private.m */,
|
||||
7ED95CF51AB9028C008C4574 /* CDVPlugin+Private.h */,
|
||||
7ED95CF61AB9028C008C4574 /* Plugins */,
|
||||
);
|
||||
name = Private;
|
||||
path = Classes/Private;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7ED95CF61AB9028C008C4574 /* Plugins */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4E714D3123F5356700A321AF /* CDVLaunchScreen */,
|
||||
4E23F8F423E16D30006CD852 /* CDVWebViewEngine */,
|
||||
28BFF9111F355A1D00DDF01A /* CDVLogger */,
|
||||
A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */,
|
||||
3093E2201B16D6A3003F381A /* CDVIntentAndNavigationFilter */,
|
||||
7ED95CF71AB9028C008C4574 /* CDVHandleOpenURL */,
|
||||
);
|
||||
path = Plugins;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7ED95CF71AB9028C008C4574 /* CDVHandleOpenURL */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7ED95CF81AB9028C008C4574 /* CDVHandleOpenURL.h */,
|
||||
7ED95CF91AB9028C008C4574 /* CDVHandleOpenURL.m */,
|
||||
);
|
||||
path = CDVHandleOpenURL;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7ED95D0E1AB9029B008C4574 /* Public */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
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 */,
|
||||
7ED95D211AB9029B008C4574 /* CDVPluginResult.h */,
|
||||
7ED95D221AB9029B008C4574 /* CDVPluginResult.m */,
|
||||
7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */,
|
||||
7ED95D241AB9029B008C4574 /* CDVTimer.h */,
|
||||
7ED95D251AB9029B008C4574 /* CDVTimer.m */,
|
||||
7ED95D2A1AB9029B008C4574 /* CDVViewController.h */,
|
||||
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;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A3B082D11BB15CEA00D8DC35 /* CDVGestureHandler */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */,
|
||||
A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */,
|
||||
);
|
||||
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 */
|
||||
C0C01EAF1E3911D50056E6CB /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */,
|
||||
C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */,
|
||||
C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */,
|
||||
C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */,
|
||||
C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */,
|
||||
C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */,
|
||||
C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */,
|
||||
C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */,
|
||||
C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */,
|
||||
C0C01EC31E39131A0056E6CB /* CDVInvokedUrlCommand.h in Headers */,
|
||||
C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */,
|
||||
C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */,
|
||||
C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */,
|
||||
C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */,
|
||||
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 */,
|
||||
9052DE892150D06B008E83D4 /* CDVDebug.h in Headers */,
|
||||
9052DE8A2150D06B008E83D4 /* CDVJSON_private.h in Headers */,
|
||||
9052DE8B2150D06B008E83D4 /* CDVPlugin+Private.h in Headers */,
|
||||
9052DE8C2150D06B008E83D4 /* CDVLogger.h in Headers */,
|
||||
9052DE8D2150D06B008E83D4 /* CDVGestureHandler.h in Headers */,
|
||||
9052DE8E2150D06B008E83D4 /* CDVIntentAndNavigationFilter.h in Headers */,
|
||||
9052DE8F2150D06B008E83D4 /* CDVHandleOpenURL.h in Headers */,
|
||||
2FCCEA18247E7366007276A8 /* CDVLaunchScreen.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D2AAC07A0554694100DB518D /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7ED95D351AB9029B008C4574 /* CDV.h in Headers */,
|
||||
7ED95D361AB9029B008C4574 /* CDVAppDelegate.h in Headers */,
|
||||
7ED95D381AB9029B008C4574 /* CDVAvailability.h in Headers */,
|
||||
7ED95D391AB9029B008C4574 /* CDVAvailabilityDeprecated.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 */,
|
||||
7ED95D471AB9029B008C4574 /* CDVPluginResult.h in Headers */,
|
||||
7ED95D491AB9029B008C4574 /* CDVScreenOrientationDelegate.h in Headers */,
|
||||
4E23F8FC23E16E96006CD852 /* CDVWebViewUIDelegate.h in Headers */,
|
||||
7ED95D4A1AB9029B008C4574 /* CDVTimer.h in Headers */,
|
||||
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 */,
|
||||
7ED95D031AB9028C008C4574 /* CDVJSON_private.h in Headers */,
|
||||
7ED95D051AB9028C008C4574 /* CDVPlugin+Private.h in Headers */,
|
||||
28BFF9141F355A4E00DDF01A /* CDVLogger.h in Headers */,
|
||||
A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */,
|
||||
3093E2231B16D6A3003F381A /* CDVIntentAndNavigationFilter.h in Headers */,
|
||||
7E7F69B91ABA3692007546F4 /* CDVHandleOpenURL.h in Headers */,
|
||||
4E714D3623F535B500A321AF /* CDVLaunchScreen.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
C0C01EB11E3911D50056E6CB /* Cordova */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = C0C01EB91E3911D50056E6CB /* Build configuration list for PBXNativeTarget "Cordova" */;
|
||||
buildPhases = (
|
||||
C0C01EAD1E3911D50056E6CB /* Sources */,
|
||||
C0C01EAE1E3911D50056E6CB /* Frameworks */,
|
||||
C0C01EAF1E3911D50056E6CB /* Headers */,
|
||||
CEDDBB5523948D4C00506451 /* ShellScript */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Cordova;
|
||||
productName = Cordova;
|
||||
productReference = C0C01EB21E3911D50056E6CB /* Cordova.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
D2AAC07D0554694100DB518D /* CordovaLib */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "CordovaLib" */;
|
||||
buildPhases = (
|
||||
D2AAC07A0554694100DB518D /* Headers */,
|
||||
D2AAC07B0554694100DB518D /* Sources */,
|
||||
D2AAC07C0554694100DB518D /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = CordovaLib;
|
||||
productName = CordovaLib;
|
||||
productReference = 68A32D7114102E1C006B237C /* libCordova.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
0867D690FE84028FC02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1010;
|
||||
TargetAttributes = {
|
||||
C0C01EB11E3911D50056E6CB = {
|
||||
CreatedOnToolsVersion = 10.1;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
D2AAC07D0554694100DB518D = {
|
||||
CreatedOnToolsVersion = 10.1;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */;
|
||||
compatibilityVersion = "Xcode 11.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 0867D691FE84028FC02AAC07;
|
||||
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
D2AAC07D0554694100DB518D /* CordovaLib */,
|
||||
C0C01EB11E3911D50056E6CB /* Cordova */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
CEDDBB5523948D4C00506451 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PROJECT_DIR}/../update_podspec.sh\" -s cordova\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
C0C01EAD1E3911D50056E6CB /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9052DE712150D040008E83D4 /* CDVAppDelegate.m in Sources */,
|
||||
9052DE722150D040008E83D4 /* CDVCommandDelegateImpl.m in Sources */,
|
||||
9052DE732150D040008E83D4 /* CDVCommandQueue.m in Sources */,
|
||||
9052DE742150D040008E83D4 /* CDVConfigParser.m in Sources */,
|
||||
9052DE752150D040008E83D4 /* CDVInvokedUrlCommand.m in Sources */,
|
||||
9052DE762150D040008E83D4 /* CDVPlugin+Resources.m in Sources */,
|
||||
9052DE772150D040008E83D4 /* CDVPlugin.m in Sources */,
|
||||
9052DE782150D040008E83D4 /* CDVPluginResult.m in Sources */,
|
||||
9052DE792150D040008E83D4 /* CDVTimer.m in Sources */,
|
||||
9052DE7C2150D040008E83D4 /* CDVViewController.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 */,
|
||||
9052DE822150D040008E83D4 /* CDVGestureHandler.m in Sources */,
|
||||
9052DE832150D040008E83D4 /* CDVIntentAndNavigationFilter.m in Sources */,
|
||||
9052DE842150D040008E83D4 /* CDVHandleOpenURL.m in Sources */,
|
||||
2FCCEA17247E7366007276A8 /* CDVLaunchScreen.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
D2AAC07B0554694100DB518D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7ED95D371AB9029B008C4574 /* CDVAppDelegate.m in Sources */,
|
||||
7ED95D3C1AB9029B008C4574 /* CDVCommandDelegateImpl.m in Sources */,
|
||||
7ED95D3E1AB9029B008C4574 /* CDVCommandQueue.m in Sources */,
|
||||
7ED95D401AB9029B008C4574 /* CDVConfigParser.m in Sources */,
|
||||
7ED95D421AB9029B008C4574 /* CDVInvokedUrlCommand.m in Sources */,
|
||||
7ED95D441AB9029B008C4574 /* CDVPlugin+Resources.m in Sources */,
|
||||
2F4D42BD23F218BA00501999 /* CDVURLSchemeHandler.m in Sources */,
|
||||
7ED95D461AB9029B008C4574 /* CDVPlugin.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 */,
|
||||
A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */,
|
||||
3093E2241B16D6A3003F381A /* CDVIntentAndNavigationFilter.m in Sources */,
|
||||
7ED95D071AB9028C008C4574 /* CDVHandleOpenURL.m in Sources */,
|
||||
4E714D3823F535B500A321AF /* CDVLaunchScreen.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
1DEB921F08733DC00010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB922008733DC00010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
PUBLIC_HEADERS_FOLDER_PATH = include/Cordova;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
1DEB922308733DC00010E9CD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
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_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;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = 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)",
|
||||
);
|
||||
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;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = Cordova;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
1DEB922408733DC00010E9CD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
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_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;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = 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;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = Cordova;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C0C01EB71E3911D50056E6CB /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = Cordova/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C0C01EB81E3911D50056E6CB /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
INFOPLIST_FILE = Cordova/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
"@loader_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "CordovaLib" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB921F08733DC00010E9CD /* Debug */,
|
||||
1DEB922008733DC00010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1DEB922308733DC00010E9CD /* Debug */,
|
||||
1DEB922408733DC00010E9CD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C0C01EB91E3911D50056E6CB /* Build configuration list for PBXNativeTarget "Cordova" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C0C01EB71E3911D50056E6CB /* Debug */,
|
||||
C0C01EB81E3911D50056E6CB /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||
}
|
22
platforms/ios/CordovaLib/CordovaLib_Prefix.pch
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
1
platforms/ios/CordovaLib/VERSION
Normal file
@ -0,0 +1 @@
|
||||
6.1.1
|
2104
platforms/ios/CordovaLib/cordova.js
vendored
Normal file
524
platforms/ios/MyApp.xcodeproj/project.pbxproj
Executable file
@ -0,0 +1,524 @@
|
||||
// !$*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 */; };
|
||||
FCD6C77A095640B09B70F9A8 /* CDVStatusBar.m in Sources */ = {isa = PBXBuildFile; fileRef = B06CF0B22B35405A9006EECC /* CDVStatusBar.m */; };
|
||||
9D94BC80C47E4BAD8A843F91 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 37735BFCD2334F7CB5226BB3 /* CDVDevice.m */; };
|
||||
196339981E114AF69908CB2A /* CDVSplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 012762DEF38B4F3BAB7EFE6A /* CDVSplashScreen.m */; };
|
||||
28E76220B50D4BB48365E128 /* CDVViewController+SplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = C831FFF53B074CBDBED29EB7 /* CDVViewController+SplashScreen.m */; };
|
||||
0083A474F3C247E69256E0B8 /* CDVWKWebViewEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = F13FDB2B0E3847DCA5744FA1 /* CDVWKWebViewEngine.m */; };
|
||||
58863E5D18254006AC92C418 /* CDVWKWebViewUIDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E4712E3EF9041CE997862FB /* CDVWKWebViewUIDelegate.m */; };
|
||||
DE1D94BE18B142A9945C104C /* CDVWKProcessPoolFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = B5093C4050D1426489EC3EFC /* CDVWKProcessPoolFactory.m */; };
|
||||
E6BC407ACF4A47E7A8B04730 /* IONAssetHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DAF515542D5428C87F0C7C5 /* IONAssetHandler.m */; };
|
||||
E739A38BC3494BF787FFFD41 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 544751687C6C472DA7346F33 /* WebKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
A36BB18B2AF348FA92060ABE /* CDVIonicKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = D455F70BDC3546ADA5A2204A /* CDVIonicKeyboard.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 = "MyApp/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 /* MyApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MyApp.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 /* MyApp-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MyApp-Prefix.pch"; sourceTree = "<group>"; };
|
||||
6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = CDVLaunchScreen.storyboard; path = "MyApp/CDVLaunchScreen.storyboard"; sourceTree = SOURCE_ROOT; };
|
||||
8D1107310486CEB800E47090 /* MyApp-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "MyApp-Info.plist"; path = "MyApp/MyApp-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 = "MyApp/config.xml"; sourceTree = "<group>"; };
|
||||
B06CF0B22B35405A9006EECC /* CDVStatusBar.m */ = {isa = PBXFileReference; name = "CDVStatusBar.m"; path = "cordova-plugin-statusbar/CDVStatusBar.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
|
||||
9743ECEE8DAD4067B39F901D /* CDVStatusBar.h */ = {isa = PBXFileReference; name = "CDVStatusBar.h"; path = "cordova-plugin-statusbar/CDVStatusBar.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
|
||||
37735BFCD2334F7CB5226BB3 /* CDVDevice.m */ = {isa = PBXFileReference; name = "CDVDevice.m"; path = "cordova-plugin-device/CDVDevice.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
|
||||
937B0AF4475E4F278376D014 /* CDVDevice.h */ = {isa = PBXFileReference; name = "CDVDevice.h"; path = "cordova-plugin-device/CDVDevice.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
|
||||
012762DEF38B4F3BAB7EFE6A /* CDVSplashScreen.m */ = {isa = PBXFileReference; name = "CDVSplashScreen.m"; path = "cordova-plugin-splashscreen/CDVSplashScreen.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
|
||||
C831FFF53B074CBDBED29EB7 /* CDVViewController+SplashScreen.m */ = {isa = PBXFileReference; name = "CDVViewController+SplashScreen.m"; path = "cordova-plugin-splashscreen/CDVViewController+SplashScreen.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
|
||||
B3AF650B3C5D4DE38F4DFE30 /* CDVSplashScreen.h */ = {isa = PBXFileReference; name = "CDVSplashScreen.h"; path = "cordova-plugin-splashscreen/CDVSplashScreen.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
|
||||
AA8584C0EDDA433E810DBF9B /* CDVViewController+SplashScreen.h */ = {isa = PBXFileReference; name = "CDVViewController+SplashScreen.h"; path = "cordova-plugin-splashscreen/CDVViewController+SplashScreen.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
|
||||
F13FDB2B0E3847DCA5744FA1 /* CDVWKWebViewEngine.m */ = {isa = PBXFileReference; name = "CDVWKWebViewEngine.m"; path = "cordova-plugin-ionic-webview/CDVWKWebViewEngine.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
|
||||
9E4712E3EF9041CE997862FB /* CDVWKWebViewUIDelegate.m */ = {isa = PBXFileReference; name = "CDVWKWebViewUIDelegate.m"; path = "cordova-plugin-ionic-webview/CDVWKWebViewUIDelegate.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
|
||||
B5093C4050D1426489EC3EFC /* CDVWKProcessPoolFactory.m */ = {isa = PBXFileReference; name = "CDVWKProcessPoolFactory.m"; path = "cordova-plugin-ionic-webview/CDVWKProcessPoolFactory.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
|
||||
7DAF515542D5428C87F0C7C5 /* IONAssetHandler.m */ = {isa = PBXFileReference; name = "IONAssetHandler.m"; path = "cordova-plugin-ionic-webview/IONAssetHandler.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
|
||||
CC6A1F8D000047E88C7716C7 /* CDVWKWebViewEngine.h */ = {isa = PBXFileReference; name = "CDVWKWebViewEngine.h"; path = "cordova-plugin-ionic-webview/CDVWKWebViewEngine.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
|
||||
15E944D7707248F4979DEA28 /* CDVWKWebViewUIDelegate.h */ = {isa = PBXFileReference; name = "CDVWKWebViewUIDelegate.h"; path = "cordova-plugin-ionic-webview/CDVWKWebViewUIDelegate.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
|
||||
D261B777A3EE4BC284FB9FFD /* CDVWKProcessPoolFactory.h */ = {isa = PBXFileReference; name = "CDVWKProcessPoolFactory.h"; path = "cordova-plugin-ionic-webview/CDVWKProcessPoolFactory.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
|
||||
2470321473E64474916F2E79 /* IONAssetHandler.h */ = {isa = PBXFileReference; name = "IONAssetHandler.h"; path = "cordova-plugin-ionic-webview/IONAssetHandler.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; };
|
||||
544751687C6C472DA7346F33 /* WebKit.framework */ = {isa = PBXFileReference; name = "WebKit.framework"; path = "System/Library/Frameworks/WebKit.framework"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; };
|
||||
D455F70BDC3546ADA5A2204A /* CDVIonicKeyboard.m */ = {isa = PBXFileReference; name = "CDVIonicKeyboard.m"; path = "cordova-plugin-ionic-keyboard/CDVIonicKeyboard.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; };
|
||||
D4B7C3CB609C40B0A2C56CC0 /* CDVIonicKeyboard.h */ = {isa = PBXFileReference; name = "CDVIonicKeyboard.h"; path = "cordova-plugin-ionic-keyboard/CDVIonicKeyboard.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 */,
|
||||
E739A38BC3494BF787FFFD41 /* WebKit.framework 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 = "MyApp/Classes";
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
19C28FACFE9D520D11CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1D6058910D05DD3D006BFB54 /* MyApp.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 /* MyApp-Prefix.pch */,
|
||||
29B97316FDCFA39411CA2CEA /* main.m */,
|
||||
ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */,
|
||||
);
|
||||
name = "Other Sources";
|
||||
path = "MyApp";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0207DA571B56EA530066E2B4 /* Images.xcassets */,
|
||||
3047A50E1AB8057F00498E2A /* config */,
|
||||
8D1107310486CEB800E47090 /* MyApp-Info.plist */,
|
||||
6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */,
|
||||
);
|
||||
name = Resources;
|
||||
path = "MyApp/Resources";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
544751687C6C472DA7346F33 /* WebKit.framework */,
|
||||
);
|
||||
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 = (
|
||||
B06CF0B22B35405A9006EECC /* CDVStatusBar.m */,
|
||||
9743ECEE8DAD4067B39F901D /* CDVStatusBar.h */,
|
||||
37735BFCD2334F7CB5226BB3 /* CDVDevice.m */,
|
||||
937B0AF4475E4F278376D014 /* CDVDevice.h */,
|
||||
012762DEF38B4F3BAB7EFE6A /* CDVSplashScreen.m */,
|
||||
C831FFF53B074CBDBED29EB7 /* CDVViewController+SplashScreen.m */,
|
||||
B3AF650B3C5D4DE38F4DFE30 /* CDVSplashScreen.h */,
|
||||
AA8584C0EDDA433E810DBF9B /* CDVViewController+SplashScreen.h */,
|
||||
F13FDB2B0E3847DCA5744FA1 /* CDVWKWebViewEngine.m */,
|
||||
9E4712E3EF9041CE997862FB /* CDVWKWebViewUIDelegate.m */,
|
||||
B5093C4050D1426489EC3EFC /* CDVWKProcessPoolFactory.m */,
|
||||
7DAF515542D5428C87F0C7C5 /* IONAssetHandler.m */,
|
||||
CC6A1F8D000047E88C7716C7 /* CDVWKWebViewEngine.h */,
|
||||
15E944D7707248F4979DEA28 /* CDVWKWebViewUIDelegate.h */,
|
||||
D261B777A3EE4BC284FB9FFD /* CDVWKProcessPoolFactory.h */,
|
||||
2470321473E64474916F2E79 /* IONAssetHandler.h */,
|
||||
D455F70BDC3546ADA5A2204A /* CDVIonicKeyboard.m */,
|
||||
D4B7C3CB609C40B0A2C56CC0 /* CDVIonicKeyboard.h */,
|
||||
);
|
||||
name = Plugins;
|
||||
path = "MyApp/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 /* MyApp */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "MyApp" */;
|
||||
buildPhases = (
|
||||
304B58A110DAC018002A0835 /* Copy www directory */,
|
||||
1D60588D0D05DD3D006BFB54 /* Resources */,
|
||||
1D60588E0D05DD3D006BFB54 /* Sources */,
|
||||
1D60588F0D05DD3D006BFB54 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
301BF551109A68C00062928A /* PBXTargetDependency */,
|
||||
);
|
||||
name = "MyApp";
|
||||
productName = "MyApp";
|
||||
productReference = 1D6058910D05DD3D006BFB54 /* MyApp.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 "MyApp" */;
|
||||
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 /* MyApp */,
|
||||
);
|
||||
};
|
||||
/* 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/MyApp/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 */,
|
||||
FCD6C77A095640B09B70F9A8 /* CDVStatusBar.m in Sources */,
|
||||
9D94BC80C47E4BAD8A843F91 /* CDVDevice.m in Sources */,
|
||||
196339981E114AF69908CB2A /* CDVSplashScreen.m in Sources */,
|
||||
28E76220B50D4BB48365E128 /* CDVViewController+SplashScreen.m in Sources */,
|
||||
0083A474F3C247E69256E0B8 /* CDVWKWebViewEngine.m in Sources */,
|
||||
58863E5D18254006AC92C418 /* CDVWKWebViewUIDelegate.m in Sources */,
|
||||
DE1D94BE18B142A9945C104C /* CDVWKProcessPoolFactory.m in Sources */,
|
||||
E6BC407ACF4A47E7A8B04730 /* IONAssetHandler.m in Sources */,
|
||||
A36BB18B2AF348FA92060ABE /* CDVIonicKeyboard.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 = "MyApp/MyApp-Prefix.pch";
|
||||
GCC_THUMB_SUPPORT = NO;
|
||||
GCC_VERSION = "";
|
||||
INFOPLIST_FILE = "MyApp/MyApp-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.ionic.starter;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
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 = "MyApp/MyApp-Prefix.pch";
|
||||
GCC_THUMB_SUPPORT = NO;
|
||||
GCC_VERSION = "";
|
||||
INFOPLIST_FILE = "MyApp/MyApp-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.ionic.starter;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
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;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
};
|
||||
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;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "MyApp" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
1D6058940D05DD3E006BFB54 /* Debug */,
|
||||
1D6058950D05DD3E006BFB54 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MyApp" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4F08A954540054247B /* Debug */,
|
||||
C01FCF5008A954540054247B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||
}
|
7
platforms/ios/MyApp.xcworkspace/contents.xcworkspacedata
generated
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:MyApp.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0730"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
|
||||
BuildableName = "MyApp.app"
|
||||
BlueprintName = "MyApp"
|
||||
ReferencedContainer = "container:MyApp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
|
||||
BuildableName = "MyApp.app"
|
||||
BlueprintName = "MyApp"
|
||||
ReferencedContainer = "container:MyApp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</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">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
|
||||
BuildableName = "MyApp.app"
|
||||
BlueprintName = "MyApp"
|
||||
ReferencedContainer = "container:MyApp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "1D6058900D05DD3D006BFB54"
|
||||
BuildableName = "MyApp.app"
|
||||
BlueprintName = "MyApp"
|
||||
ReferencedContainer = "container:MyApp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
5
platforms/ios/MyApp/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
*.mode1v3
|
||||
*.perspectivev3
|
||||
*.pbxuser
|
||||
.DS_Store
|
||||
build/
|
28
platforms/ios/MyApp/Bridging-Header.h
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
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>
|
65
platforms/ios/MyApp/CDVLaunchScreen.storyboard
Normal file
@ -0,0 +1,65 @@
|
||||
<?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" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<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="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchStoryboard" translatesAutoresizingMaskIntoConstraints="NO" id="2ns-9I-Qjs">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" name="BackgroundColor"/>
|
||||
<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"/>
|
||||
<constraint firstItem="2ns-9I-Qjs" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="oGN-hc-Uzj"/>
|
||||
<constraint firstItem="2ns-9I-Qjs" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="rS9-Wd-zY4"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="LaunchStoryboard" width="1366" height="1366"/>
|
||||
<namedColor name="BackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</namedColor>
|
||||
</resources>
|
||||
</document>
|
33
platforms/ios/MyApp/Classes/AppDelegate.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
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.h
|
||||
// MyApp
|
||||
//
|
||||
// Created by ___FULLUSERNAME___ on ___DATE___.
|
||||
// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cordova/CDVViewController.h>
|
||||
#import <Cordova/CDVAppDelegate.h>
|
||||
|
||||
@interface AppDelegate : CDVAppDelegate {}
|
||||
|
||||
@end
|
39
platforms/ios/MyApp/Classes/AppDelegate.m
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
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
|
||||
// MyApp
|
||||
//
|
||||
// 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
|
40
platforms/ios/MyApp/Classes/MainViewController.h
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
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
|
||||
// MyApp
|
||||
//
|
||||
// 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
|
||||
|
||||
@interface MainCommandDelegate : CDVCommandDelegateImpl
|
||||
@end
|
||||
|
||||
@interface MainCommandQueue : CDVCommandQueue
|
||||
@end
|
112
platforms/ios/MyApp/Classes/MainViewController.m
Normal file
@ -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.
|
||||
*/
|
||||
|
||||
//
|
||||
// MainViewController.h
|
||||
// MyApp
|
||||
//
|
||||
// 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];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
}
|
||||
|
||||
@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
|
138
platforms/ios/MyApp/Classes/MainViewController.xib
Normal file
@ -0,0 +1,138 @@
|
||||
<?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>
|
24
platforms/ios/MyApp/Entitlements-Debug.plist
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
24
platforms/ios/MyApp/Entitlements-Release.plist
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,241 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-20@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-29.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-29@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-60@2x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "57x57",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-20.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-29.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-40.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "50x50",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-50.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "50x50",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-50@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "72x72",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-72.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "72x72",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-72@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-76.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "icon-1024.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "24x24",
|
||||
"idiom" : "watch",
|
||||
"filename" : "icon-24@2x.png",
|
||||
"scale" : "2x",
|
||||
"role" : "notificationCenter",
|
||||
"subtype" : "38mm"
|
||||
},
|
||||
{
|
||||
"size" : "27.5x27.5",
|
||||
"idiom" : "watch",
|
||||
"filename" : "icon-27.5@2x.png",
|
||||
"scale" : "2x",
|
||||
"role" : "notificationCenter",
|
||||
"subtype" : "42mm"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "watch",
|
||||
"filename" : "icon-29@2x.png",
|
||||
"role" : "companionSettings",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "watch",
|
||||
"filename" : "icon-29@3x.png",
|
||||
"role" : "companionSettings",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "watch",
|
||||
"filename" : "icon-40@2x.png",
|
||||
"scale" : "2x",
|
||||
"role" : "appLauncher",
|
||||
"subtype" : "38mm"
|
||||
},
|
||||
{
|
||||
"size" : "44x44",
|
||||
"idiom" : "watch",
|
||||
"filename" : "icon-44@2x.png",
|
||||
"scale" : "2x",
|
||||
"role" : "appLauncher",
|
||||
"subtype" : "40mm"
|
||||
},
|
||||
{
|
||||
"size" : "50x50",
|
||||
"idiom" : "watch",
|
||||
"filename" : "icon-50@2x.png",
|
||||
"scale" : "2x",
|
||||
"role" : "appLauncher",
|
||||
"subtype" : "44mm"
|
||||
},
|
||||
{
|
||||
"size" : "86x86",
|
||||
"idiom" : "watch",
|
||||
"filename" : "icon-86@2x.png",
|
||||
"scale" : "2x",
|
||||
"role" : "quickLook",
|
||||
"subtype" : "38mm"
|
||||
},
|
||||
{
|
||||
"size" : "98x98",
|
||||
"idiom" : "watch",
|
||||
"filename" : "icon-98@2x.png",
|
||||
"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"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 618 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 13 KiB |