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
df93be14
Commit
df93be14
authored
Aug 09, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for attachments (Windows/AdaptiveImages)
parent
ca759b41
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
1 deletions
+61
-1
Builder.cs
...Proxy/LocalNotificationProxy/LocalNotification/Builder.cs
+5
-0
Options.cs
...Proxy/LocalNotificationProxy/LocalNotification/Options.cs
+55
-0
local-notification-util.js
www/local-notification-util.js
+1
-1
No files found.
src/windows/LocalNotificationProxy/LocalNotificationProxy/LocalNotification/Builder.cs
View file @
df93be14
...
...
@@ -78,6 +78,11 @@ namespace LocalNotificationProxy.LocalNotification
}
};
foreach
(
var
image
in
this
.
Options
.
ImageAttachments
)
{
toast
.
Visual
.
BindingGeneric
.
Children
.
Add
(
image
);
}
var
xml
=
toast
.
GetXml
();
var
at
=
this
.
Options
.
TriggerDate
;
ScheduledToastNotification
notification
;
...
...
src/windows/LocalNotificationProxy/LocalNotificationProxy/LocalNotification/Options.cs
View file @
df93be14
...
...
@@ -24,6 +24,8 @@ namespace LocalNotificationProxy.LocalNotification
using
System
;
using
Microsoft.Toolkit.Uwp.Notifications
;
using
Windows.Data.Xml.Dom
;
using
System.Collections
;
using
System.Collections.Generic
;
public
sealed
class
Options
{
...
...
@@ -74,6 +76,11 @@ namespace LocalNotificationProxy.LocalNotification
public
string
Data
{
get
;
set
;
}
/// <summary>
/// Gets or sets the notification attachments.
/// </summary>
public
string
[]
Attachments
{
get
;
set
;
}
/// <summary>
/// Gets the date when to trigger the notification.
/// </summary>
internal
DateTime
TriggerDate
...
...
@@ -249,6 +256,54 @@ namespace LocalNotificationProxy.LocalNotification
}
/// <summary>
/// Gets the parsed image attachments.
/// </summary>
internal
List
<
AdaptiveImage
>
ImageAttachments
{
get
{
var
images
=
new
List
<
AdaptiveImage
>();
if
(
this
.
Attachments
==
null
)
{
return
images
;
}
foreach
(
string
path
in
this
.
Attachments
)
{
var
image
=
new
AdaptiveImage
();
if
(
path
.
StartsWith
(
"file:///"
)
||
path
.
StartsWith
(
"http"
))
{
image
.
Source
=
path
;
}
else
if
(
path
.
StartsWith
(
"file://"
))
{
image
.
Source
=
path
.
Replace
(
"file:/"
,
"ms-appx:///www"
);
}
else
if
(
path
.
StartsWith
(
"res://"
))
{
image
.
Source
=
path
.
Replace
(
"res://"
,
"ms-appx:///images"
);
}
else
if
(
path
.
StartsWith
(
"app://"
))
{
image
.
Source
=
path
.
Replace
(
"app:/"
,
"ms-appdata://local"
);
}
if
(
image
.
Source
!=
null
)
{
images
.
Add
(
image
);
}
}
return
images
;
}
}
/// <summary>
/// Deserializes the XML string into an instance of Options.
/// </summary>
/// <param name="identifier">The serialized instance of Options as an xml string.</param>
...
...
www/local-notification-util.js
View file @
df93be14
...
...
@@ -35,6 +35,7 @@ exports._defaults = {
at
:
undefined
,
actions
:
undefined
,
actionGroupId
:
undefined
,
attachments
:
[]
};
// Listener
...
...
@@ -58,7 +59,6 @@ exports.applyPlatformSpecificOptions = function () {
defaults
.
color
=
undefined
;
break
;
case
'iOS'
:
defaults
.
attachments
=
undefined
;
defaults
.
region
=
undefined
;
defaults
.
radius
=
undefined
;
defaults
.
notifyOnEntry
=
true
;
...
...
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