forked from phonegap/phonegap-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added: PhoneStateChangeListener plugin, see README.md for details
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
PhoneStateChangeListener | ||
======================== | ||
|
||
Cordova plugin to provide callback when Telephony state changes | ||
|
||
Possible states are IDLE, OFFHOOK and RINGING | ||
|
||
Get this at https://github.com/madeinstefano/PhoneStateChangeListener | ||
|
||
# to use: | ||
|
||
1 - Import the .js file plugin right after your cordova.js file (index.html) | ||
2 - Import the .java file inside your src folder | ||
3 - Setup the callback to handle when state changes in your js: | ||
|
||
plugins.PhoneStateChangeListener.start(function (state){ | ||
// do stuff with the state | ||
}); | ||
|
||
3 - Possible values to 'state' variable are: | ||
|
||
plugins.PhoneStateChangeListener.IDLE // when the none call are being made | ||
plugins.PhoneStateChangeListener.RINGING // when the phone is ringing | ||
plugins.PhoneStateChangeListener.OFFHOOK // when the phone is busy | ||
plugins.PhoneStateChangeListener.NONE // when something goes wrong | ||
|
||
4 - To stop listening to this: | ||
|
||
plugins.PhoneStateChangeListener.stop(); | ||
|
||
|
||
# version 1 | ||
- Added basic support to listen when Telephony state changes | ||
- Added feature to remove this listener |