Skip to content

Commit a3b3959

Browse files
committed
misc
0 parents  commit a3b3959

File tree

4 files changed

+121
-0
lines changed

4 files changed

+121
-0
lines changed

package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "cordova-plugin-memory-warning",
3+
"version": "0.0.1",
4+
"description": "Cordova plugin for memory warning process",
5+
"scripts": {
6+
"test": "echo \"Error: no test specified\" && exit 1"
7+
},
8+
"repository": {
9+
"type": "git",
10+
"url": "git+https://github.com/uuke/cordova-plugin-memory-warning.git"
11+
},
12+
"keywords": [
13+
"cordova",
14+
"ecosystem:cordova",
15+
"app",
16+
"plugin"
17+
],
18+
"author": "tidycoder",
19+
"license": "MIT",
20+
"bugs": {
21+
"url": "https://github.com/uuke/cordova-plugin-memory-warning/issues"
22+
},
23+
"homepage": "https://github.com/uuke/cordova-plugin-memory-warning#readme"
24+
}

plugin.xml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
xml version="1.0" encoding="UTF-8"?>
2+
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
id="cordova-plugin-app-version"
5+
version="0.1.8">
6+
7+
<name>AppVersionname>
8+
<description>
9+
This plugin will return the version of your App that you have set in
10+
packaging it. I.e. it will always match the version in the app store.
11+
description>
12+
<license>MITlicense>
13+
14+
<engines>
15+
19+
<engine name="cordova" version=">=3.0.0" />
20+
engines>
21+
22+
23+
<platform name="android">
24+
<config-file target="res/xml/config.xml" parent="/*">
25+
<feature name="AppVersion">
26+
<param name="android-package" value="uk.co.whiteoctober.cordova.AppVersion"/>
27+
feature>
28+
config-file>
29+
<source-file src="src/android/AppVersion.java" target-dir="src/uk/co/whiteoctober/cordova" />
30+
platform>
31+
32+
33+
<platform name="blackberry10">
34+
<dependency id="com.blackberry.app" />
35+
36+
<config-file target="www/config.xml" parent="/widget">
37+
<feature name="AppVersion" value="AppVersion" />
38+
config-file>
39+
<js-module src="www/blackberry10/AppVersionProxy.js" name="AppVersionProxy.js" >
40+
<runs />
41+
js-module>
42+
platform>
43+
44+
45+
<platform name="ios">
46+
<plugins-plist key="AppVersion" string="AppVersion" />
47+
48+
<config-file target="config.xml" parent="/*">
49+
<feature name="AppVersion">
50+
<param name="ios-package" value="AppVersion" />
51+
feature>
52+
config-file>
53+
54+
<header-file src="src/ios/AppVersion.h" />
55+
<source-file src="src/ios/AppVersion.m" />
56+
platform>
57+
58+
59+
<platform name="windows8">
60+
<js-module src="src/windows8/AppVersionProxy.js" name="AppVersionProxy">
61+
<merges target=""/>
62+
js-module>
63+
platform>
64+
65+
66+
<platform name="wp8">
67+
<config-file target="config.xml" parent="/*">
68+
<feature name="AppVersion">
69+
<param name="wp-package" value="AppVersion"/>
70+
feature>
71+
config-file>
72+
73+
<source-file src="src/wp8/AppVersion.cs" />
74+
platform>
75+
plugin>

src/ios/CDVMemoryWarning.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#import <Cordova/CDVPlugin.h>
2+
3+
@interface CDVMemoryWarning : CDVPlugin
4+
5+
- (void)onMemoryWarning;
6+
7+
@end

src/ios/CDVMemoryWarning.m

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#import "CDVMemoryWarning.h"
2+
#import <Cordova/CDVPluginResult.h>
3+
4+
@implementation CDVMemoryWarning
5+
6+
- (void)onMemoryWarning
7+
{
8+
// override to remove caches, etc
9+
NSLog(@"onMemoryWarning");
10+
NSString * javascriptString = @"cleanMemoryCache();";
11+
[self.webView stringByEvaluatingJavaScriptFromString:javascriptString];
12+
}
13+
14+
15+
@end

0 commit comments

Comments
 (0)