@capacitor-community/camera-preview 5.0.0-0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -13
- package/android/.gradle/8.0.2/checksums/checksums.lock +0 -0
- package/android/.gradle/8.0.2/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.0.2/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.0.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/8.0.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.0.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/8.0.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.0.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/build.gradle +3 -2
- package/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java +3 -3
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraActivity.java +5 -7
- package/dist/esm/definitions.d.ts +2 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +3 -3
- package/dist/esm/web.js +14 -10
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +155 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +158 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/CameraController.swift +1 -1
- package/ios/Plugin/Plugin.swift +5 -5
- package/ios/Podfile +7 -4
- package/ios/Podfile.lock +9 -10
- package/ios/Pods/CapacitorCordova/LICENSE +23 -0
- package/ios/Pods/CapacitorCordova/README.md +39 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/CapacitorCordova.h +21 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.h +8 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.m +5 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDV.h +28 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVAvailability.h +109 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegate.h +51 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.h +39 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.m +154 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.h +31 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.m +81 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.h +52 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.m +116 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.h +81 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.m +154 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.h +25 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.m +77 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.h +82 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.m +216 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVScreenOrientationDelegate.h +33 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUIWebViewDelegate.h +41 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUIWebViewDelegate.m +399 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.h +27 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.m +74 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUserAgentUtil.h +27 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUserAgentUtil.m +156 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.h +30 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.m +34 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.h +35 -0
- package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.m +63 -0
- package/ios/Pods/Local Podspecs/Capacitor.podspec.json +34 -0
- package/ios/Pods/Local Podspecs/CapacitorCordova.podspec.json +26 -0
- package/ios/Pods/Manifest.lock +22 -0
- package/ios/Pods/Pods.xcodeproj/project.pbxproj +1374 -0
- package/ios/Pods/Pods.xcodeproj/xcuserdata/julionic.xcuserdatad/xcschemes/Capacitor.xcscheme +58 -0
- package/ios/Pods/Pods.xcodeproj/xcuserdata/julionic.xcuserdatad/xcschemes/CapacitorCordova.xcscheme +58 -0
- package/ios/Pods/Pods.xcodeproj/xcuserdata/julionic.xcuserdatad/xcschemes/Pods-Plugin.xcscheme +58 -0
- package/ios/Pods/Pods.xcodeproj/xcuserdata/julionic.xcuserdatad/xcschemes/Pods-PluginTests.xcscheme +58 -0
- package/ios/Pods/Pods.xcodeproj/xcuserdata/julionic.xcuserdatad/xcschemes/xcschememanagement.plist +31 -0
- package/ios/Pods/Target Support Files/Capacitor/Capacitor-Info.plist +26 -0
- package/ios/Pods/Target Support Files/Capacitor/Capacitor-dummy.m +5 -0
- package/ios/Pods/Target Support Files/Capacitor/Capacitor-prefix.pch +12 -0
- package/ios/Pods/Target Support Files/Capacitor/Capacitor.debug.xcconfig +15 -0
- package/ios/Pods/Target Support Files/Capacitor/Capacitor.modulemap +8 -0
- package/ios/Pods/Target Support Files/Capacitor/Capacitor.release.xcconfig +15 -0
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-Info.plist +26 -0
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-dummy.m +5 -0
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-prefix.pch +12 -0
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-umbrella.h +32 -0
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.debug.xcconfig +12 -0
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.modulemap +6 -0
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.release.xcconfig +12 -0
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-Info.plist +26 -0
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.markdown +53 -0
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.plist +91 -0
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-dummy.m +5 -0
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-umbrella.h +16 -0
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig +14 -0
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.modulemap +6 -0
- package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig +14 -0
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-Info.plist +26 -0
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.markdown +53 -0
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.plist +91 -0
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-dummy.m +5 -0
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh +188 -0
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-umbrella.h +16 -0
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig +15 -0
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.modulemap +6 -0
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig +15 -0
- package/package.json +17 -7
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import "CDVCommandDelegateImpl.h"
|
|
21
|
+
#import "CDVPluginResult.h"
|
|
22
|
+
#import <WebKit/WebKit.h>
|
|
23
|
+
|
|
24
|
+
@implementation CDVCommandDelegateImpl
|
|
25
|
+
|
|
26
|
+
@synthesize urlTransformer;
|
|
27
|
+
|
|
28
|
+
- (id)initWithWebView:(WKWebView*)webView pluginManager:(CDVPluginManager *)manager
|
|
29
|
+
{
|
|
30
|
+
self = [super init];
|
|
31
|
+
if (self != nil) {
|
|
32
|
+
_webView = webView;
|
|
33
|
+
_manager = manager;
|
|
34
|
+
NSError* err = nil;
|
|
35
|
+
_callbackIdPattern = [NSRegularExpression regularExpressionWithPattern:@"[^A-Za-z0-9._-]" options:0 error:&err];
|
|
36
|
+
if (err != nil) {
|
|
37
|
+
// Couldn't initialize Regex
|
|
38
|
+
NSLog(@"Error: Couldn't initialize regex");
|
|
39
|
+
_callbackIdPattern = nil;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return self;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
- (NSString*)pathForResource:(NSString*)resourcepath
|
|
46
|
+
{
|
|
47
|
+
NSBundle* mainBundle = [NSBundle mainBundle];
|
|
48
|
+
NSMutableArray* directoryParts = [NSMutableArray arrayWithArray:[resourcepath componentsSeparatedByString:@"/"]];
|
|
49
|
+
NSString* filename = [directoryParts lastObject];
|
|
50
|
+
|
|
51
|
+
[directoryParts removeLastObject];
|
|
52
|
+
|
|
53
|
+
NSString* directoryPartsJoined = [directoryParts componentsJoinedByString:@"/"];
|
|
54
|
+
NSString* baseFolder = @"public";
|
|
55
|
+
NSString* directoryStr = baseFolder;
|
|
56
|
+
|
|
57
|
+
if ([directoryPartsJoined length] > 0) {
|
|
58
|
+
directoryStr = [NSString stringWithFormat:@"%@/%@", baseFolder, [directoryParts componentsJoinedByString:@"/"]];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return [mainBundle pathForResource:filename ofType:@"" inDirectory:directoryStr];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
- (void)flushCommandQueueWithDelayedJs
|
|
65
|
+
{
|
|
66
|
+
_delayResponses = YES;
|
|
67
|
+
_delayResponses = NO;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
- (void)evalJsHelper2:(NSString*)js
|
|
71
|
+
{
|
|
72
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
73
|
+
[_webView evaluateJavaScript:js completionHandler:^(id obj, NSError* error) {
|
|
74
|
+
// TODO: obj can be something other than string
|
|
75
|
+
if ([obj isKindOfClass:[NSString class]]) {
|
|
76
|
+
NSString* commandsJSON = (NSString*)obj;
|
|
77
|
+
if ([commandsJSON length] > 0) {
|
|
78
|
+
NSLog(@"Exec: Retrieved new exec messages by chaining.");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}];
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
- (BOOL)isValidCallbackId:(NSString*)callbackId
|
|
86
|
+
{
|
|
87
|
+
if ((callbackId == nil) || (_callbackIdPattern == nil)) {
|
|
88
|
+
return NO;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Disallow if too long or if any invalid characters were found.
|
|
92
|
+
if (([callbackId length] > 100) || [_callbackIdPattern firstMatchInString:callbackId options:0 range:NSMakeRange(0, [callbackId length])]) {
|
|
93
|
+
return NO;
|
|
94
|
+
}
|
|
95
|
+
return YES;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
- (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId
|
|
99
|
+
{
|
|
100
|
+
// This occurs when there is are no win/fail callbacks for the call.
|
|
101
|
+
if ([@"INVALID" isEqualToString:callbackId]) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
// This occurs when the callback id is malformed.
|
|
105
|
+
if (![self isValidCallbackId:callbackId]) {
|
|
106
|
+
NSLog(@"Invalid callback id received by sendPluginResult");
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
int status = [result.status intValue];
|
|
110
|
+
BOOL keepCallback = [result.keepCallback boolValue];
|
|
111
|
+
NSString* argumentsAsJSON = [result argumentsAsJSON];
|
|
112
|
+
BOOL debug = NO;
|
|
113
|
+
|
|
114
|
+
#ifdef DEBUG
|
|
115
|
+
debug = YES;
|
|
116
|
+
#endif
|
|
117
|
+
|
|
118
|
+
NSString* js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeCallback('%@',%d,%@,%d, %d)", callbackId, status, argumentsAsJSON, keepCallback, debug];
|
|
119
|
+
|
|
120
|
+
[self evalJsHelper2:js];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
- (void)evalJs:(NSString*)js
|
|
124
|
+
{
|
|
125
|
+
[self evalJs:js scheduledOnRunLoop:YES];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop
|
|
129
|
+
{
|
|
130
|
+
js = [NSString stringWithFormat:@"try{cordova.require('cordova/exec').nativeEvalAndFetch(function(){%@})}catch(e){console.log('exception nativeEvalAndFetch : '+e);};", js];
|
|
131
|
+
[self evalJsHelper2:js];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
- (id)getCommandInstance:(NSString*)pluginName
|
|
135
|
+
{
|
|
136
|
+
return [_manager getCommandInstance:pluginName];
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
- (void)runInBackground:(void (^)())block
|
|
140
|
+
{
|
|
141
|
+
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
- (NSString*)userAgent
|
|
145
|
+
{
|
|
146
|
+
return nil;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
- (NSDictionary*)settings
|
|
150
|
+
{
|
|
151
|
+
return _manager.settings;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
#import <Foundation/Foundation.h>
|
|
20
|
+
|
|
21
|
+
@interface CDVConfigParser : NSObject <NSXMLParserDelegate>
|
|
22
|
+
{
|
|
23
|
+
NSString* featureName;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@property (nonatomic, readonly, strong) NSMutableDictionary* pluginsDict;
|
|
27
|
+
@property (nonatomic, readonly, strong) NSMutableDictionary* settings;
|
|
28
|
+
@property (nonatomic, readonly, strong) NSMutableArray* startupPluginNames;
|
|
29
|
+
@property (nonatomic, readonly, strong) NSString* startPage;
|
|
30
|
+
|
|
31
|
+
@end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import "CDVConfigParser.h"
|
|
21
|
+
|
|
22
|
+
@interface CDVConfigParser ()
|
|
23
|
+
|
|
24
|
+
@property (nonatomic, readwrite, strong) NSMutableDictionary* pluginsDict;
|
|
25
|
+
@property (nonatomic, readwrite, strong) NSMutableDictionary* settings;
|
|
26
|
+
@property (nonatomic, readwrite, strong) NSMutableArray* startupPluginNames;
|
|
27
|
+
@property (nonatomic, readwrite, strong) NSString* startPage;
|
|
28
|
+
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
@implementation CDVConfigParser
|
|
32
|
+
|
|
33
|
+
@synthesize pluginsDict, settings, startPage, startupPluginNames;
|
|
34
|
+
|
|
35
|
+
- (id)init
|
|
36
|
+
{
|
|
37
|
+
self = [super init];
|
|
38
|
+
if (self != nil) {
|
|
39
|
+
self.pluginsDict = [[NSMutableDictionary alloc] initWithCapacity:30];
|
|
40
|
+
self.settings = [[NSMutableDictionary alloc] initWithCapacity:30];
|
|
41
|
+
self.startupPluginNames = [[NSMutableArray alloc] initWithCapacity:8];
|
|
42
|
+
featureName = nil;
|
|
43
|
+
}
|
|
44
|
+
return self;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
- (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName attributes:(NSDictionary*)attributeDict
|
|
48
|
+
{
|
|
49
|
+
if ([elementName isEqualToString:@"preference"]) {
|
|
50
|
+
settings[[attributeDict[@"name"] lowercaseString]] = attributeDict[@"value"];
|
|
51
|
+
} else if ([elementName isEqualToString:@"feature"]) { // store feature name to use with correct parameter set
|
|
52
|
+
featureName = [attributeDict[@"name"] lowercaseString];
|
|
53
|
+
} else if ((featureName != nil) && [elementName isEqualToString:@"param"]) {
|
|
54
|
+
NSString* paramName = [attributeDict[@"name"] lowercaseString];
|
|
55
|
+
id value = attributeDict[@"value"];
|
|
56
|
+
if ([paramName isEqualToString:@"ios-package"]) {
|
|
57
|
+
pluginsDict[featureName] = value;
|
|
58
|
+
}
|
|
59
|
+
BOOL paramIsOnload = ([paramName isEqualToString:@"onload"] && [@"true" isEqualToString : value]);
|
|
60
|
+
BOOL attribIsOnload = [@"true" isEqualToString :[attributeDict[@"onload"] lowercaseString]];
|
|
61
|
+
if (paramIsOnload || attribIsOnload) {
|
|
62
|
+
[self.startupPluginNames addObject:featureName];
|
|
63
|
+
}
|
|
64
|
+
} else if ([elementName isEqualToString:@"content"]) {
|
|
65
|
+
self.startPage = attributeDict[@"src"];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
- (void)parser:(NSXMLParser*)parser didEndElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qualifiedName
|
|
70
|
+
{
|
|
71
|
+
if ([elementName isEqualToString:@"feature"]) { // no longer handling a feature so release
|
|
72
|
+
featureName = nil;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
- (void)parser:(NSXMLParser*)parser parseErrorOccurred:(NSError*)parseError
|
|
77
|
+
{
|
|
78
|
+
NSAssert(NO, @"config.xml parse error line %ld col %ld", (long)[parser lineNumber], (long)[parser columnNumber]);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import <Foundation/Foundation.h>
|
|
21
|
+
|
|
22
|
+
@interface CDVInvokedUrlCommand : NSObject {
|
|
23
|
+
NSString* _callbackId;
|
|
24
|
+
NSString* _className;
|
|
25
|
+
NSString* _methodName;
|
|
26
|
+
NSArray* _arguments;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@property (nonatomic, readonly) NSArray* arguments;
|
|
30
|
+
@property (nonatomic, readonly) NSString* callbackId;
|
|
31
|
+
@property (nonatomic, readonly) NSString* className;
|
|
32
|
+
@property (nonatomic, readonly) NSString* methodName;
|
|
33
|
+
|
|
34
|
+
+ (CDVInvokedUrlCommand*)commandFromJson:(NSArray*)jsonEntry;
|
|
35
|
+
|
|
36
|
+
- (id)initWithArguments:(NSArray*)arguments
|
|
37
|
+
callbackId:(NSString*)callbackId
|
|
38
|
+
className:(NSString*)className
|
|
39
|
+
methodName:(NSString*)methodName;
|
|
40
|
+
|
|
41
|
+
- (id)initFromJson:(NSArray*)jsonEntry;
|
|
42
|
+
|
|
43
|
+
// Returns the argument at the given index.
|
|
44
|
+
// If index >= the number of arguments, returns nil.
|
|
45
|
+
// If the argument at the given index is NSNull, returns nil.
|
|
46
|
+
- (id)argumentAtIndex:(NSUInteger)index;
|
|
47
|
+
// Same as above, but returns defaultValue instead of nil.
|
|
48
|
+
- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue;
|
|
49
|
+
// Same as above, but returns defaultValue instead of nil, and if the argument is not of the expected class, returns defaultValue
|
|
50
|
+
- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue andClass:(Class)aClass;
|
|
51
|
+
|
|
52
|
+
@end
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import "CDVInvokedUrlCommand.h"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@implementation CDVInvokedUrlCommand
|
|
24
|
+
|
|
25
|
+
@synthesize arguments = _arguments;
|
|
26
|
+
@synthesize callbackId = _callbackId;
|
|
27
|
+
@synthesize className = _className;
|
|
28
|
+
@synthesize methodName = _methodName;
|
|
29
|
+
|
|
30
|
+
+ (CDVInvokedUrlCommand*)commandFromJson:(NSArray*)jsonEntry
|
|
31
|
+
{
|
|
32
|
+
return [[CDVInvokedUrlCommand alloc] initFromJson:jsonEntry];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
- (id)initFromJson:(NSArray*)jsonEntry
|
|
36
|
+
{
|
|
37
|
+
id tmp = [jsonEntry objectAtIndex:0];
|
|
38
|
+
NSString* callbackId = tmp == [NSNull null] ? nil : tmp;
|
|
39
|
+
NSString* className = [jsonEntry objectAtIndex:1];
|
|
40
|
+
NSString* methodName = [jsonEntry objectAtIndex:2];
|
|
41
|
+
NSMutableArray* arguments = [jsonEntry objectAtIndex:3];
|
|
42
|
+
|
|
43
|
+
return [self initWithArguments:arguments
|
|
44
|
+
callbackId:callbackId
|
|
45
|
+
className:className
|
|
46
|
+
methodName:methodName];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
- (id)initWithArguments:(NSArray*)arguments
|
|
50
|
+
callbackId:(NSString*)callbackId
|
|
51
|
+
className:(NSString*)className
|
|
52
|
+
methodName:(NSString*)methodName
|
|
53
|
+
{
|
|
54
|
+
self = [super init];
|
|
55
|
+
if (self != nil) {
|
|
56
|
+
_arguments = arguments;
|
|
57
|
+
_callbackId = callbackId;
|
|
58
|
+
_className = className;
|
|
59
|
+
_methodName = methodName;
|
|
60
|
+
}
|
|
61
|
+
[self massageArguments];
|
|
62
|
+
return self;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
- (void)massageArguments
|
|
66
|
+
{
|
|
67
|
+
NSMutableArray* newArgs = nil;
|
|
68
|
+
|
|
69
|
+
for (NSUInteger i = 0, count = [_arguments count]; i < count; ++i) {
|
|
70
|
+
id arg = [_arguments objectAtIndex:i];
|
|
71
|
+
if (![arg isKindOfClass:[NSDictionary class]]) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
NSDictionary* dict = arg;
|
|
75
|
+
NSString* type = [dict objectForKey:@"CDVType"];
|
|
76
|
+
if (!type || ![type isEqualToString:@"ArrayBuffer"]) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
NSString* data = [dict objectForKey:@"data"];
|
|
80
|
+
if (!data) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (newArgs == nil) {
|
|
84
|
+
newArgs = [NSMutableArray arrayWithArray:_arguments];
|
|
85
|
+
_arguments = newArgs;
|
|
86
|
+
}
|
|
87
|
+
[newArgs replaceObjectAtIndex:i withObject:[[NSData alloc] initWithBase64EncodedString:data options:0]];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
- (id)argumentAtIndex:(NSUInteger)index
|
|
92
|
+
{
|
|
93
|
+
return [self argumentAtIndex:index withDefault:nil];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue
|
|
97
|
+
{
|
|
98
|
+
return [self argumentAtIndex:index withDefault:defaultValue andClass:nil];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
- (id)argumentAtIndex:(NSUInteger)index withDefault:(id)defaultValue andClass:(Class)aClass
|
|
102
|
+
{
|
|
103
|
+
if (index >= [_arguments count]) {
|
|
104
|
+
return defaultValue;
|
|
105
|
+
}
|
|
106
|
+
id ret = [_arguments objectAtIndex:index];
|
|
107
|
+
if (ret == [NSNull null]) {
|
|
108
|
+
ret = defaultValue;
|
|
109
|
+
}
|
|
110
|
+
if ((aClass != nil) && ![ret isKindOfClass:aClass]) {
|
|
111
|
+
ret = defaultValue;
|
|
112
|
+
}
|
|
113
|
+
return ret;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@end
|
package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.h
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import <Foundation/Foundation.h>
|
|
21
|
+
#import <UIKit/UIKit.h>
|
|
22
|
+
#import "CDVPluginResult.h"
|
|
23
|
+
#import "CDVCommandDelegate.h"
|
|
24
|
+
#import "CDVAvailability.h"
|
|
25
|
+
#import <WebKit/WebKit.h>
|
|
26
|
+
|
|
27
|
+
@interface UIView (org_apache_cordova_UIView_Extension)
|
|
28
|
+
|
|
29
|
+
@property (nonatomic, weak) UIScrollView* scrollView;
|
|
30
|
+
|
|
31
|
+
@end
|
|
32
|
+
|
|
33
|
+
extern NSString* const CDVPageDidLoadNotification;
|
|
34
|
+
extern NSString* const CDVPluginHandleOpenURLNotification;
|
|
35
|
+
extern NSString* const CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification;
|
|
36
|
+
extern NSString* const CDVPluginResetNotification;
|
|
37
|
+
extern NSString* const CDVViewWillAppearNotification;
|
|
38
|
+
extern NSString* const CDVViewDidAppearNotification;
|
|
39
|
+
extern NSString* const CDVViewWillDisappearNotification;
|
|
40
|
+
extern NSString* const CDVViewDidDisappearNotification;
|
|
41
|
+
extern NSString* const CDVViewWillLayoutSubviewsNotification;
|
|
42
|
+
extern NSString* const CDVViewDidLayoutSubviewsNotification;
|
|
43
|
+
extern NSString* const CDVViewWillTransitionToSizeNotification;
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* The local and remote push notification functionality has been removed from the core in cordova-ios 4.x,
|
|
47
|
+
* but these constants have unfortunately have not been removed, but will be removed in 5.x.
|
|
48
|
+
*
|
|
49
|
+
* To have the same functionality as 3.x, use a third-party plugin or the experimental
|
|
50
|
+
* https://github.com/apache/cordova-plugins/tree/master/notification-rebroadcast
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@interface CDVPlugin : NSObject {}
|
|
55
|
+
|
|
56
|
+
@property (nonatomic, weak) UIView* webView;
|
|
57
|
+
@property (nonatomic, weak) WKWebView * webViewEngine;
|
|
58
|
+
@property (nonatomic, strong) NSString * className;
|
|
59
|
+
|
|
60
|
+
@property (nonatomic, weak) UIViewController* viewController;
|
|
61
|
+
@property (nonatomic, weak) id <CDVCommandDelegate> commandDelegate;
|
|
62
|
+
|
|
63
|
+
- (void)pluginInitialize;
|
|
64
|
+
|
|
65
|
+
- (void)handleOpenURL:(NSNotification*)notification;
|
|
66
|
+
- (void)onAppTerminate;
|
|
67
|
+
- (void)onMemoryWarning;
|
|
68
|
+
- (void)onReset;
|
|
69
|
+
- (void)dispose;
|
|
70
|
+
|
|
71
|
+
/*
|
|
72
|
+
// see initWithWebView implementation
|
|
73
|
+
- (void) onPause {}
|
|
74
|
+
- (void) onResume {}
|
|
75
|
+
- (void) onOrientationWillChange {}
|
|
76
|
+
- (void) onOrientationDidChange {}
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
- (id)appDelegate;
|
|
80
|
+
|
|
81
|
+
@end
|
package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.m
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
|
4
|
+
distributed with this work for additional information
|
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
|
7
|
+
"License"); you may not use this file except in compliance
|
|
8
|
+
with the License. You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
|
13
|
+
software distributed under the License is distributed on an
|
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
KIND, either express or implied. See the License for the
|
|
16
|
+
specific language governing permissions and limitations
|
|
17
|
+
under the License.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#import "CDVPlugin.h"
|
|
21
|
+
#include <objc/message.h>
|
|
22
|
+
|
|
23
|
+
@implementation UIView (org_apache_cordova_UIView_Extension)
|
|
24
|
+
|
|
25
|
+
@dynamic scrollView;
|
|
26
|
+
|
|
27
|
+
- (UIScrollView*)scrollView
|
|
28
|
+
{
|
|
29
|
+
SEL scrollViewSelector = NSSelectorFromString(@"scrollView");
|
|
30
|
+
|
|
31
|
+
if ([self respondsToSelector:scrollViewSelector]) {
|
|
32
|
+
return ((id (*)(id, SEL))objc_msgSend)(self, scrollViewSelector);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return nil;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@end
|
|
39
|
+
|
|
40
|
+
NSString* const CDVPageDidLoadNotification = @"CDVPageDidLoadNotification";
|
|
41
|
+
NSString* const CDVPluginHandleOpenURLNotification = @"CDVPluginHandleOpenURLNotification";
|
|
42
|
+
NSString* const CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification = @"CDVPluginHandleOpenURLWithAppSourceAndAnnotationNotification";
|
|
43
|
+
NSString* const CDVPluginResetNotification = @"CDVPluginResetNotification";
|
|
44
|
+
NSString* const CDVLocalNotification = @"CDVLocalNotification";
|
|
45
|
+
NSString* const CDVRemoteNotification = @"CDVRemoteNotification";
|
|
46
|
+
NSString* const CDVRemoteNotificationError = @"CDVRemoteNotificationError";
|
|
47
|
+
NSString* const CDVViewWillAppearNotification = @"CDVViewWillAppearNotification";
|
|
48
|
+
NSString* const CDVViewDidAppearNotification = @"CDVViewDidAppearNotification";
|
|
49
|
+
NSString* const CDVViewWillDisappearNotification = @"CDVViewWillDisappearNotification";
|
|
50
|
+
NSString* const CDVViewDidDisappearNotification = @"CDVViewDidDisappearNotification";
|
|
51
|
+
NSString* const CDVViewWillLayoutSubviewsNotification = @"CDVViewWillLayoutSubviewsNotification";
|
|
52
|
+
NSString* const CDVViewDidLayoutSubviewsNotification = @"CDVViewDidLayoutSubviewsNotification";
|
|
53
|
+
NSString* const CDVViewWillTransitionToSizeNotification = @"CDVViewWillTransitionToSizeNotification";
|
|
54
|
+
|
|
55
|
+
@interface CDVPlugin ()
|
|
56
|
+
|
|
57
|
+
@property (readwrite, assign) BOOL hasPendingOperation;
|
|
58
|
+
|
|
59
|
+
@end
|
|
60
|
+
|
|
61
|
+
@implementation CDVPlugin
|
|
62
|
+
@synthesize webViewEngine, viewController, commandDelegate, hasPendingOperation, webView;
|
|
63
|
+
|
|
64
|
+
// Do not override these methods. Use pluginInitialize instead.
|
|
65
|
+
- (instancetype)initWithWebViewEngine:(WKWebView *)theWebViewEngine
|
|
66
|
+
{
|
|
67
|
+
self = [super init];
|
|
68
|
+
if (self) {
|
|
69
|
+
self.webViewEngine = theWebViewEngine;
|
|
70
|
+
}
|
|
71
|
+
return self;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
- (void)pluginInitialize
|
|
75
|
+
{
|
|
76
|
+
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAppTerminate) name:UIApplicationWillTerminateNotification object:nil];
|
|
77
|
+
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil];
|
|
78
|
+
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleOpenURL:) name:CDVPluginHandleOpenURLNotification object:nil];
|
|
79
|
+
// You can listen to more app notifications, see:
|
|
80
|
+
// http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006728-CH3-DontLinkElementID_4
|
|
81
|
+
|
|
82
|
+
// NOTE: if you want to use these, make sure you uncomment the corresponding notification handler
|
|
83
|
+
|
|
84
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPause) name:UIApplicationDidEnterBackgroundNotification object:nil];
|
|
85
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResume) name:UIApplicationWillEnterForegroundNotification object:nil];
|
|
86
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationWillChange) name:UIApplicationWillChangeStatusBarOrientationNotification object:nil];
|
|
87
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationDidChange) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
|
|
88
|
+
|
|
89
|
+
// Added in 2.5.0
|
|
90
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad:) name:CDVPageDidLoadNotification object:self.webView];
|
|
91
|
+
//Added in 4.3.0
|
|
92
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillAppear:) name:CDVViewWillAppearNotification object:nil];
|
|
93
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidAppear:) name:CDVViewDidAppearNotification object:nil];
|
|
94
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillDisappear:) name:CDVViewWillDisappearNotification object:nil];
|
|
95
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidDisappear:) name:CDVViewDidDisappearNotification object:nil];
|
|
96
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillLayoutSubviews:) name:CDVViewWillLayoutSubviewsNotification object:nil];
|
|
97
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewDidLayoutSubviews:) name:CDVViewDidLayoutSubviewsNotification object:nil];
|
|
98
|
+
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(viewWillTransitionToSize:) name:CDVViewWillTransitionToSizeNotification object:nil];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
- (void)dispose
|
|
102
|
+
{
|
|
103
|
+
viewController = nil;
|
|
104
|
+
commandDelegate = nil;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
// NOTE: for onPause and onResume, calls into JavaScript must not call or trigger any blocking UI, like alerts
|
|
109
|
+
- (void) onPause {}
|
|
110
|
+
- (void) onResume {}
|
|
111
|
+
- (void) onOrientationWillChange {}
|
|
112
|
+
- (void) onOrientationDidChange {}
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
/* NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts */
|
|
116
|
+
- (void)handleOpenURL:(NSNotification*)notification
|
|
117
|
+
{
|
|
118
|
+
// override to handle urls sent to your app
|
|
119
|
+
// register your url schemes in your App-Info.plist
|
|
120
|
+
|
|
121
|
+
NSURL* url = [notification object];
|
|
122
|
+
|
|
123
|
+
if ([url isKindOfClass:[NSURL class]]) {
|
|
124
|
+
/* Do your thing! */
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* NOTE: calls into JavaScript must not call or trigger any blocking UI, like alerts */
|
|
129
|
+
- (void)onAppTerminate
|
|
130
|
+
{
|
|
131
|
+
// override this if you need to do any cleanup on app exit
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
- (void)onMemoryWarning
|
|
135
|
+
{
|
|
136
|
+
// override to remove caches, etc
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
- (void)onReset
|
|
140
|
+
{
|
|
141
|
+
// Override to cancel any long-running requests when the WebView navigates or refreshes.
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
- (void)dealloc
|
|
145
|
+
{
|
|
146
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self]; // this will remove all notifications unless added using addObserverForName:object:queue:usingBlock:
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
- (id)appDelegate
|
|
150
|
+
{
|
|
151
|
+
return [[UIApplication sharedApplication] delegate];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@end
|