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
31fee38d
Commit
31fee38d
authored
May 02, 2015
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize imports
parent
e00467af
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
40 deletions
+42
-40
ClickActivity.java
src/android/ClickActivity.java
+2
-1
LocalNotification.java
src/android/LocalNotification.java
+5
-4
TriggerReceiver.java
src/android/TriggerReceiver.java
+2
-1
AssetUtil.java
src/android/notification/AssetUtil.java
+24
-24
Builder.java
src/android/notification/Builder.java
+2
-2
Manager.java
src/android/notification/Manager.java
+2
-3
Options.java
src/android/notification/Options.java
+5
-5
No files found.
src/android/ClickActivity.java
View file @
31fee38d
...
@@ -23,7 +23,8 @@
...
@@ -23,7 +23,8 @@
package
de
.
appplant
.
cordova
.
plugin
.
localnotification
;
package
de
.
appplant
.
cordova
.
plugin
.
localnotification
;
import
de.appplant.cordova.plugin.notification.*
;
import
de.appplant.cordova.plugin.notification.Builder
;
import
de.appplant.cordova.plugin.notification.Notification
;
import
de.appplant.cordova.plugin.notification.TriggerReceiver
;
import
de.appplant.cordova.plugin.notification.TriggerReceiver
;
/**
/**
...
...
src/android/LocalNotification.java
View file @
31fee38d
...
@@ -23,8 +23,7 @@
...
@@ -23,8 +23,7 @@
package
de
.
appplant
.
cordova
.
plugin
.
localnotification
;
package
de
.
appplant
.
cordova
.
plugin
.
localnotification
;
import
java.util.ArrayList
;
import
android.os.Build
;
import
java.util.List
;
import
org.apache.cordova.CallbackContext
;
import
org.apache.cordova.CallbackContext
;
import
org.apache.cordova.CordovaInterface
;
import
org.apache.cordova.CordovaInterface
;
...
@@ -35,9 +34,11 @@ import org.json.JSONArray;
...
@@ -35,9 +34,11 @@ import org.json.JSONArray;
import
org.json.JSONException
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
import
android.os.Build
;
import
java.util.ArrayList
;
import
java.util.List
;
import
de.appplant.cordova.plugin.notification.*
;
import
de.appplant.cordova.plugin.notification.Manager
;
import
de.appplant.cordova.plugin.notification.Notification
;
/**
/**
* This plugin utilizes the Android AlarmManager in combination with local
* This plugin utilizes the Android AlarmManager in combination with local
...
...
src/android/TriggerReceiver.java
View file @
31fee38d
...
@@ -23,7 +23,8 @@
...
@@ -23,7 +23,8 @@
package
de
.
appplant
.
cordova
.
plugin
.
localnotification
;
package
de
.
appplant
.
cordova
.
plugin
.
localnotification
;
import
de.appplant.cordova.plugin.notification.*
;
import
de.appplant.cordova.plugin.notification.Builder
;
import
de.appplant.cordova.plugin.notification.Notification
;
/**
/**
* The alarm receiver is triggered when a scheduled alarm is fired. This class
* The alarm receiver is triggered when a scheduled alarm is fired. This class
...
...
src/android/notification/AssetUtil.java
View file @
31fee38d
...
@@ -23,16 +23,6 @@
...
@@ -23,16 +23,6 @@
package
de
.
appplant
.
cordova
.
plugin
.
notification
;
package
de
.
appplant
.
cordova
.
plugin
.
notification
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.net.HttpURLConnection
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.res.AssetManager
;
import
android.content.res.AssetManager
;
import
android.content.res.Resources
;
import
android.content.res.Resources
;
...
@@ -43,6 +33,16 @@ import android.net.Uri;
...
@@ -43,6 +33,16 @@ import android.net.Uri;
import
android.os.StrictMode
;
import
android.os.StrictMode
;
import
android.util.Log
;
import
android.util.Log
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.net.HttpURLConnection
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
/**
/**
* Util class to map unified asset URIs to native URIs. URIs like file:///
* Util class to map unified asset URIs to native URIs. URIs like file:///
* map to absolute paths while file:// point relatively to the www folder
* map to absolute paths while file:// point relatively to the www folder
...
@@ -60,7 +60,7 @@ class AssetUtil {
...
@@ -60,7 +60,7 @@ class AssetUtil {
// Ref to the context passed through the constructor to access the
// Ref to the context passed through the constructor to access the
// resources and app directory.
// resources and app directory.
private
final
Context
context
;
private
final
Context
context
;
/**
/**
* Constructor
* Constructor
*
*
...
@@ -102,7 +102,7 @@ class AssetUtil {
...
@@ -102,7 +102,7 @@ class AssetUtil {
/**
/**
* The URI for a path.
* The URI for a path.
*
*
* @param path
* @param path
* The given path
* The given path
*/
*/
...
@@ -120,15 +120,15 @@ class AssetUtil {
...
@@ -120,15 +120,15 @@ class AssetUtil {
return
Uri
.
EMPTY
;
return
Uri
.
EMPTY
;
}
}
/**
/**
* URI for a file.
* URI for a file.
*
*
* @param path
* @param path
* Absolute path like file:///...
* Absolute path like file:///...
*
*
* @return
* @return
* URI pointing to the given path
* URI pointing to the given path
*/
*/
...
@@ -146,10 +146,10 @@ class AssetUtil {
...
@@ -146,10 +146,10 @@ class AssetUtil {
/**
/**
* URI for an asset.
* URI for an asset.
*
*
* @param path
* @param path
* Asset path like file://...
* Asset path like file://...
*
*
* @return
* @return
* URI pointing to the given path
* URI pointing to the given path
*/
*/
...
@@ -191,10 +191,10 @@ class AssetUtil {
...
@@ -191,10 +191,10 @@ class AssetUtil {
/**
/**
* The URI for a resource.
* The URI for a resource.
*
*
* @param path
* @param path
* The given relative path
* The given relative path
*
*
* @return
* @return
* URI pointing to the given path
* URI pointing to the given path
*/
*/
...
@@ -240,7 +240,7 @@ class AssetUtil {
...
@@ -240,7 +240,7 @@ class AssetUtil {
return
Uri
.
EMPTY
;
return
Uri
.
EMPTY
;
}
}
/**
/**
* Uri from remote located content.
* Uri from remote located content.
*
*
...
@@ -286,11 +286,11 @@ class AssetUtil {
...
@@ -286,11 +286,11 @@ class AssetUtil {
outStream
.
flush
();
outStream
.
flush
();
outStream
.
close
();
outStream
.
close
();
return
Uri
.
fromFile
(
file
);
return
Uri
.
fromFile
(
file
);
}
catch
(
MalformedURLException
e
)
{
}
catch
(
MalformedURLException
e
)
{
Log
.
e
(
"Asset"
,
"Incorrect URL"
);
Log
.
e
(
"Asset"
,
"Incorrect URL"
);
e
.
printStackTrace
();
e
.
printStackTrace
();
}
catch
(
FileNotFoundException
e
)
{
}
catch
(
FileNotFoundException
e
)
{
Log
.
e
(
"Asset"
,
"Failed to create new File from HTTP Content"
);
Log
.
e
(
"Asset"
,
"Failed to create new File from HTTP Content"
);
...
@@ -305,7 +305,7 @@ class AssetUtil {
...
@@ -305,7 +305,7 @@ class AssetUtil {
/**
/**
* Copy content from input stream into output stream.
* Copy content from input stream into output stream.
*
*
* @param in
* @param in
* The input stream
* The input stream
* @param out
* @param out
...
...
src/android/notification/Builder.java
View file @
31fee38d
...
@@ -23,8 +23,6 @@
...
@@ -23,8 +23,6 @@
package
de
.
appplant
.
cordova
.
plugin
.
notification
;
package
de
.
appplant
.
cordova
.
plugin
.
notification
;
import
java.util.Random
;
import
android.app.PendingIntent
;
import
android.app.PendingIntent
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
...
@@ -33,6 +31,8 @@ import android.support.v4.app.NotificationCompat;
...
@@ -33,6 +31,8 @@ import android.support.v4.app.NotificationCompat;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
import
java.util.Random
;
/**
/**
* Builder class for local notifications. Build fully configured local
* Builder class for local notifications. Build fully configured local
* notification specified by JSON object passed from JS side.
* notification specified by JSON object passed from JS side.
...
...
src/android/notification/Manager.java
View file @
31fee38d
...
@@ -23,8 +23,6 @@
...
@@ -23,8 +23,6 @@
package
de
.
appplant
.
cordova
.
plugin
.
notification
;
package
de
.
appplant
.
cordova
.
plugin
.
notification
;
import
static
de
.
appplant
.
cordova
.
plugin
.
notification
.
Notification
.
PREF_KEY
;
import
android.app.NotificationManager
;
import
android.app.NotificationManager
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.SharedPreferences
;
import
android.content.SharedPreferences
;
...
@@ -34,12 +32,13 @@ import org.json.JSONObject;
...
@@ -34,12 +32,13 @@ import org.json.JSONObject;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
import
static
de
.
appplant
.
cordova
.
plugin
.
notification
.
Notification
.
PREF_KEY
;
/**
/**
* Central way to access all or single local notifications set by specific
* Central way to access all or single local notifications set by specific
* state like triggered or scheduled. Offers shortcut ways to schedule,
* state like triggered or scheduled. Offers shortcut ways to schedule,
...
...
src/android/notification/Options.java
View file @
31fee38d
...
@@ -23,16 +23,16 @@
...
@@ -23,16 +23,16 @@
package
de
.
appplant
.
cordova
.
plugin
.
notification
;
package
de
.
appplant
.
cordova
.
plugin
.
notification
;
import
java.util.Date
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
android.app.AlarmManager
;
import
android.app.AlarmManager
;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.net.Uri
;
import
android.net.Uri
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.util.Date
;
/**
/**
* Wrapper around the JSON object passed through JS which contains all
* Wrapper around the JSON object passed through JS which contains all
* possible option values. Class provides simple readers and more advanced
* possible option values. Class provides simple readers and more advanced
...
...
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