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
0793559b
Commit
0793559b
authored
Aug 15, 2017
by
Chris Yuen
Committed by
Sebastián Katzer
Aug 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow option to setVibrate() on Android (#1356)
parent
9f317fc2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
Builder.java
src/android/notification/Builder.java
+5
-0
Options.java
src/android/notification/Options.java
+16
-0
local-notification-util.js
www/local-notification-util.js
+1
-0
No files found.
src/android/notification/Builder.java
View file @
0793559b
...
...
@@ -118,6 +118,7 @@ public class Builder {
Uri
sound
=
options
.
getSoundUri
();
int
smallIcon
=
options
.
getSmallIcon
();
int
ledColor
=
options
.
getLedColor
();
long
[]
vibrate
=
options
.
getVibrate
();
NotificationCompat
.
Builder
builder
;
builder
=
new
NotificationCompat
.
Builder
(
context
)
...
...
@@ -138,6 +139,10 @@ public class Builder {
builder
.
setSound
(
sound
);
}
if
(
vibrate
!=
null
)
{
builder
.
setVibrate
(
vibrate
);
}
if
(
smallIcon
==
0
)
{
builder
.
setSmallIcon
(
options
.
getIcon
());
}
else
{
...
...
src/android/notification/Options.java
View file @
0793559b
...
...
@@ -31,6 +31,7 @@ import android.support.v4.app.NotificationCompat;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
org.json.JSONArray
;
import
java.util.Date
;
...
...
@@ -318,6 +319,21 @@ public class Options {
return
uri
;
}
public
long
[]
getVibrate
()
{
JSONArray
array
=
options
.
optJSONArray
(
"vibrate"
);
if
(
array
==
null
)
return
null
;
long
[]
rv
=
new
long
[
array
.
length
()];
for
(
int
i
=
0
;
i
<
array
.
length
();
i
++)
{
rv
[
i
]
=
array
.
optInt
(
i
);
}
return
rv
;
}
/**
* Icon bitmap for the local notification.
*/
...
...
www/local-notification-util.js
View file @
0793559b
...
...
@@ -71,6 +71,7 @@ exports.applyPlatformSpecificOptions = function () {
defaults
.
ledOnTime
=
undefined
;
defaults
.
ledOffTime
=
undefined
;
defaults
.
color
=
undefined
;
defaults
.
vibrate
=
undefined
;
break
;
}
...
...
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