-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added On/Off Scheduling and Frequency Limiting (Android and iOS) #136
Open
QuantumRand
wants to merge
40
commits into
cowbell:master
Choose a base branch
from
QuantumRand:dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+238
−12
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
2c03d02
Adding scheduling and frequency limits.
52bb594
Adding scheduling and frequency limits.
6eccd34
Trying play services dependency instead
QuantumRand 9913fe6
Adding scheduling and frequency limits iOS
083ee07
Merge branch 'master' of https://github.com/QuantumRand/cordova-plugi…
af40f0a
Including latest play-services
de4afd1
Using google-play-services plugin v28.0.0
56e6f6d
Using google-play-services plugin v28.0.0
d0e782f
Dependencies
06a726d
Dependencies
aabc32f
Dependencies
d8ca4d1
Dependencies
9f0c433
Dependencies
448fece
Update plugin.xml
QuantumRand 268f26a
Dependencies
be00b9c
Update plugin.xml
QuantumRand b8d5730
Update plugin.xml
QuantumRand 9b4f209
Update plugin.xml
QuantumRand 6de8d14
Update plugin.xml
QuantumRand 04ad4d8
Update plugin.xml
QuantumRand a3dbb65
Update plugin.xml
QuantumRand f8efdf0
Google Play Services error
11ce688
Google Play Services error
10b11e6
Google Play Services error
d6d2da2
Google Play Services error
0e6c480
Google Play Services error
6165f18
Google Play Services error
7fae388
Google Play Services error
cca11cb
Google Play Services error
d6b1745
Scheduling fix, onNotificationClicked fix
5eeb942
Use NEVER_EXPIRE
87afeab
iOS Scheduling fix
9c0786f
iOS Scheduling fix
c866ffc
Merge pull request #1 from cowbell/master
QuantumRand 3c4bbbe
Added Schedule and Frequency examples
QuantumRand 5d65dcc
Merge pull request #2 from QuantumRand/master
QuantumRand 3052bd8
cleanup
QuantumRand caa2e15
cleanup
QuantumRand 2d5d504
cleanup
QuantumRand 5cd188f
Merge pull request #3 from cowbell/master
QuantumRand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,6 +217,95 @@ window.geofence.getWatched().then(function (geofencesJson) { | |
}); | ||
``` | ||
|
||
## Frequency Limiting | ||
|
||
```javascript | ||
notification: { | ||
frequency: Number(600), //Seconds required between retriggering a fence. | ||
} | ||
``` | ||
|
||
## Using On/Off Schedule Data | ||
|
||
ScheduleData is an array consisting of a start and end time for each day. Array begins on Sunday. All times are local to the device. | ||
|
||
```javascript | ||
notification: { | ||
scheduleData: [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm thinking how to make this simpler. How about:
but actually, parse this in javascript and send to a Java code using your way. |
||
{ | ||
"on": { | ||
"hour": "0", | ||
"minute": "0" | ||
}, | ||
"off": { | ||
"hour": "23", | ||
"minute": "59" | ||
} | ||
}, | ||
{ | ||
"on": { | ||
"hour": "0", | ||
"minute": "0" | ||
}, | ||
"off": { | ||
"hour": "23", | ||
"minute": "59" | ||
} | ||
}, | ||
{ | ||
"on": { | ||
"hour": "0", | ||
"minute": "0" | ||
}, | ||
"off": { | ||
"hour": "23", | ||
"minute": "59" | ||
} | ||
}, | ||
{ | ||
"on": { | ||
"hour": "0", | ||
"minute": "0" | ||
}, | ||
"off": { | ||
"hour": "23", | ||
"minute": "59" | ||
} | ||
}, | ||
{ | ||
"on": { | ||
"hour": "0", | ||
"minute": "0" | ||
}, | ||
"off": { | ||
"hour": "23", | ||
"minute": "59" | ||
} | ||
}, | ||
{ | ||
"on": { | ||
"hour": "0", | ||
"minute": "0" | ||
}, | ||
"off": { | ||
"hour": "23", | ||
"minute": "59" | ||
} | ||
}, | ||
{ | ||
"on": { | ||
"hour": "0", | ||
"minute": "0" | ||
}, | ||
"off": { | ||
"hour": "23", | ||
"minute": "59" | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
## Listening for geofence transitions | ||
|
||
```javascript | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.cowbell.cordova.geofence; | ||
|
||
import com.google.gson.annotations.Expose; | ||
|
||
public class Schedule { | ||
public class WeekDay{ | ||
public class On{ | ||
@Expose public int hour; | ||
@Expose public int minute; | ||
} | ||
public class Off{ | ||
@Expose public int hour; | ||
@Expose public int minute; | ||
} | ||
|
||
@Expose public On on; | ||
@Expose public Off off; | ||
|
||
public WeekDay(String json){ | ||
on = Gson.get().fromJson(json, On.class); | ||
off = Gson.get().fromJson(json, Off.class); | ||
} | ||
} | ||
|
||
@Expose public WeekDay[] week; | ||
|
||
public Schedule(String json){ | ||
week = Gson.get().fromJson(json, WeekDay[].class); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering about the name here. Maybe
throttle