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
2b8b21a7
Commit
2b8b21a7
authored
Mar 16, 2014
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Application state support for WP8
parent
8950fdeb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletions
+31
-1
LocalNotification.cs
src/wp8/LocalNotification.cs
+31
-1
No files found.
src/wp8/LocalNotification.cs
View file @
2b8b21a7
...
@@ -39,6 +39,11 @@ namespace Cordova.Extension.Commands
...
@@ -39,6 +39,11 @@ namespace Cordova.Extension.Commands
public
class
LocalNotification
:
BaseCommand
public
class
LocalNotification
:
BaseCommand
{
{
/// <summary>
/// <summary>
/// Informs either the app is running in background or foreground
/// </summary>
private
bool
isInBackground
=
true
;
/// <summary>
/// Sets application live tile
/// Sets application live tile
/// </summary>
/// </summary>
public
void
add
(
string
jsonArgs
)
public
void
add
(
string
jsonArgs
)
...
@@ -123,6 +128,22 @@ namespace Cordova.Extension.Commands
...
@@ -123,6 +128,22 @@ namespace Cordova.Extension.Commands
}
}
/// <summary>
/// <summary>
/// Called when the application has been switched to background
/// </summary>
public
void
pause
(
string
jsonArgs
)
{
isInBackground
=
true
;
}
/// <summary>
/// Called when the application has been switched to foreground
/// </summary>
public
void
resume
(
string
jsonArgs
)
{
isInBackground
=
false
;
}
/// <summary>
/// Creates tile data
/// Creates tile data
/// </summary>
/// </summary>
private
FlipTileData
CreateTileData
(
Options
options
)
private
FlipTileData
CreateTileData
(
Options
options
)
...
@@ -162,7 +183,7 @@ namespace Cordova.Extension.Commands
...
@@ -162,7 +183,7 @@ namespace Cordova.Extension.Commands
/// </summary>
/// </summary>
private
void
FireEvent
(
string
Event
,
string
Id
,
string
JSON
=
""
)
private
void
FireEvent
(
string
Event
,
string
Id
,
string
JSON
=
""
)
{
{
string
state
=
"foreground"
;
string
state
=
ApplicationState
()
;
string
args
=
String
.
Format
(
"\'{0}\',\'{1}\',\'{2}\'"
,
Id
,
state
,
JSON
);
string
args
=
String
.
Format
(
"\'{0}\',\'{1}\',\'{2}\'"
,
Id
,
state
,
JSON
);
string
js
=
String
.
Format
(
"window.plugin.notification.local.on{0}({1})"
,
Event
,
args
);
string
js
=
String
.
Format
(
"window.plugin.notification.local.on{0}({1})"
,
Event
,
args
);
...
@@ -172,5 +193,14 @@ namespace Cordova.Extension.Commands
...
@@ -172,5 +193,14 @@ namespace Cordova.Extension.Commands
DispatchCommandResult
(
pluginResult
);
DispatchCommandResult
(
pluginResult
);
}
}
/// <summary>
/// Retrieves the application state
/// Either "background" or "foreground"
/// </summary>
private
String
ApplicationState
()
{
return
isInBackground
?
"background"
:
"foreground"
;
}
}
}
}
}
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