Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cordova-plugin-local-notifications
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nabil Sadki
cordova-plugin-local-notifications
Commits
ec6e2b68
Commit
ec6e2b68
authored
Mar 20, 2015
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hook for activate event
parent
12496c31
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
plugin.xml
plugin.xml
+4
-0
broadcastActivateEvent.js
scripts/windows/broadcastActivateEvent.js
+48
-0
No files found.
plugin.xml
View file @
ec6e2b68
...
...
@@ -218,6 +218,10 @@
<hook
type=
"after_platform_add"
src=
"scripts/windows/setToastCapable.js"
/>
<hook
type=
"after_plugin_install"
src=
"scripts/windows/setToastCapable.js"
/>
<!-- <hook type="after_platform_add" src="scripts/windows/broadcastActivateEvent.js" /> -->
<!-- <hook type="after_plugin_install" src="scripts/windows/broadcastActivateEvent.js" /> -->
<!-- <hook type="after_prepare" src="scripts/windows/broadcastActivateEvent.js" /> -->
</platform>
</plugin>
scripts/windows/broadcastActivateEvent.js
0 → 100755
View file @
ec6e2b68
#!/usr/bin/env node
// This Plugin-Hook sets ToastCapable on true to allow windows-platform
// cordova apps displaing local-notifications
var
fs
=
require
(
'fs'
),
rootdir
=
process
.
argv
[
2
];
if
(
!
rootdir
)
return
;
function
replace_string_in_file
(
filename
,
to_replace
,
replace_with
)
{
var
data
=
fs
.
readFileSync
(
filename
,
'utf8'
),
result
;
// if (data.indexOf(replace_with) > -1)
// return;
result
=
data
.
replace
(
new
RegExp
(
to_replace
,
'g'
),
replace_with
);
fs
.
writeFileSync
(
filename
,
result
,
'utf8'
);
}
var
snippet
=
"var activatedHandler = function (args) {"
+
"channel.deviceready.subscribe(function () {"
+
"WinJS.Application.queueEvent(args);"
+
"});"
+
"};"
+
"WinJS.Application.addEventListener('activated', activatedHandler, false);"
+
"document.addEventListener('deviceready', function () {"
+
"WinJS.Application.removeEventListener('activated', activatedHandler);"
+
"}, false);"
+
"app.start();"
;
var
files
=
[
'platforms/windows/www/cordova.js'
,
'platforms/windows/platform_www/cordova.js'
];
setTimeout
(
function
()
{
for
(
var
i
=
0
;
i
<
files
.
length
;
i
++
)
{
replace_string_in_file
(
files
[
i
],
'app.start();'
,
'123app.start();'
);
}
},
1000
);
console
.
log
(
123
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment