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
0d85c72c
Commit
0d85c72c
authored
Jul 04, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for text input actions
parent
82eb458e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
APPLocalNotification.m
src/ios/APPLocalNotification.m
+2
-2
APPNotificationOptions.m
src/ios/APPNotificationOptions.m
+23
-1
No files found.
src/ios/APPLocalNotification.m
View file @
0d85c72c
...
...
@@ -693,12 +693,12 @@
-
(
void
)
fireEvent
:
(
NSString
*
)
event
notification
:
(
UNNotificationRequest
*
)
request
{
NSString
*
js
,
*
args
;
NSString
*
js
;
NSString
*
appState
=
[
self
applicationState
];
NSString
*
params
=
[
NSString
stringWithFormat
:
@"
\"
%@
\"
"
,
appState
];
if
(
request
)
{
args
=
[
request
encodeToJSON
];
NSString
*
args
=
[
request
encodeToJSON
];
params
=
[
NSString
stringWithFormat
:
@"%@,'%@'"
,
args
,
appState
];
}
...
...
src/ios/APPNotificationOptions.m
View file @
0d85c72c
...
...
@@ -212,7 +212,10 @@
for
(
NSDictionary
*
item
in
items
)
{
NSString
*
id
=
[
item
objectForKey
:
@"id"
];
NSString
*
title
=
[
item
objectForKey
:
@"title"
];
NSString
*
type
=
[
item
objectForKey
:
@"type"
];
UNNotificationActionOptions
options
=
UNNotificationActionOptionNone
;
UNNotificationAction
*
action
;
if
([[
item
objectForKey
:
@"launch"
]
boolValue
])
{
options
=
UNNotificationActionOptionForeground
;
...
...
@@ -226,13 +229,32 @@
options
=
options
|
UNNotificationActionOptionAuthenticationRequired
;
}
UNNotificationAction
*
action
;
if
([
type
isEqualToString
:
@"input"
])
{
NSString
*
submitTitle
=
[
item
objectForKey
:
@"submitTitle"
];
NSString
*
placeholder
=
[
item
objectForKey
:
@"emptyText"
];
if
(
!
submitTitle
.
length
)
{
submitTitle
=
@"Submit"
;
}
action
=
[
UNTextInputNotificationAction
actionWithIdentifier
:
id
title
:
title
options
:
options
textInputButtonTitle
:
submitTitle
textInputPlaceholder
:
placeholder
];
}
else
if
(
!
type
.
length
||
[
type
isEqualToString
:
@"button"
])
{
action
=
[
UNNotificationAction
actionWithIdentifier
:
id
title
:
title
options
:
options
];
}
else
{
NSLog
(
@"Unknown action type: %@"
,
type
);
}
if
(
action
)
{
[
actions
addObject
:
action
];
}
}
return
actions
;
}
...
...
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