Ionic 3 PhoneCallTrap send/post 'incomingNumber' not workingHow to send a PUT/DELETE request in jQuery?How to make HTTP POST web requestHow is an HTTP POST request made in node.js?HTTP plugin is not installed error with ionicionic: add own cordova pluginIonic image picker plugin, showing image not workingIonic socialSharing plugin not working on iOSPost request not working in ionic 3ionic 3 print plugin is not workingMessage Sending in ionic 3 Apps is not working
What is the meaning of "it" in "as luck would have it"?
Can combing bent evaporator coil fins damage it?
Are there advantages in writing by hand over typing out a story?
What prevents a US state from colonizing a smaller state?
Is a ccH, ccX and ccH equivalent to a cH, ccX and cH sequence?
Active wildlife outside the window- Good or Bad for Cat psychology?
Was Wolfgang Unziker the last Amateur GM?
Old story where computer expert digitally animates The Lord of the Rings
How to track mail undetectably?
Why can't i use !(single pattern) in zsh even after i turn on kshglob?
Does the Mac version of BitDefender detect Windows malware?
What does this Pokemon Trainer mean by saying the player is "SHELLOS"?
Why should I allow multiple IP addresses on a website for a single session?
What happens if a caster is surprised while casting a spell with a long casting time?
My mom helped me cosign a car and now she wants to take it
Installed software from source, how to say yum not to install it from package?
Sentences with no verb, but an ablative
Crop production in mountains?
Book about a new laser rifle built by a new inventor
Finding an optimal set without forbidden subsets
Is it OK to say "The situation is pregnant with a crisis"?
I agreed to cancel a long-planned vacation (with travel costs) due to project deadlines, but now the timeline has all changed again
Is it OK to throw pebbles and stones in streams, waterfalls, ponds, etc.?
"Best practices" for formulating MIPs
Ionic 3 PhoneCallTrap send/post 'incomingNumber' not working
How to send a PUT/DELETE request in jQuery?How to make HTTP POST web requestHow is an HTTP POST request made in node.js?HTTP plugin is not installed error with ionicionic: add own cordova pluginIonic image picker plugin, showing image not workingIonic socialSharing plugin not working on iOSPost request not working in ionic 3ionic 3 print plugin is not workingMessage Sending in ionic 3 Apps is not working
I have a simple app and I implemented the Phone Call Trap plugin from here:
https://www.npmjs.com/package/tcg.plugin.phonecalltrap
Everything works fine, when I build my app and install it on real Android device(app-debug.apk) it shows me the incoming call number in an alert only. if I try to put anything instead of alert(any function, or post the number in a http call), is not working.
What am I missing? or what am I doing wrong?
the code is looking looking like this:
declare var window: any;
if (window.PhoneCallTrap)
PhoneCallTrap.onCall(function(obj)
var callObj = JSON.parse(obj),
state = callObj.state,
callingNumber = callObj.incomingNumber;
switch (state)
case "RINGING":
this.postData(callingNumber );
break;
case "OFFHOOK":
alert("Phone is off-hook");
break;
case "IDLE":
alert("Phone is idle");
break;
);
postData(number)
this.http.post("http://example.com/receiver.php",
someData: "data", phone: number
, headers: 'Content-Type': 'application/json' )
.subscribe(data =>
console.log(JSON.stringify(data));
, error =>
console.log(JSON.stringify(error));
);
this.http.get("http://example.com/receiver.php?phoneget=" + number)
.subscribe(data =>
console.log(data);
, error =>
console.log(error);
);
All I want is to get the incoming number and send it to the server!
ionic3 httprequest cordova-plugins
add a comment |
I have a simple app and I implemented the Phone Call Trap plugin from here:
https://www.npmjs.com/package/tcg.plugin.phonecalltrap
Everything works fine, when I build my app and install it on real Android device(app-debug.apk) it shows me the incoming call number in an alert only. if I try to put anything instead of alert(any function, or post the number in a http call), is not working.
What am I missing? or what am I doing wrong?
the code is looking looking like this:
declare var window: any;
if (window.PhoneCallTrap)
PhoneCallTrap.onCall(function(obj)
var callObj = JSON.parse(obj),
state = callObj.state,
callingNumber = callObj.incomingNumber;
switch (state)
case "RINGING":
this.postData(callingNumber );
break;
case "OFFHOOK":
alert("Phone is off-hook");
break;
case "IDLE":
alert("Phone is idle");
break;
);
postData(number)
this.http.post("http://example.com/receiver.php",
someData: "data", phone: number
, headers: 'Content-Type': 'application/json' )
.subscribe(data =>
console.log(JSON.stringify(data));
, error =>
console.log(JSON.stringify(error));
);
this.http.get("http://example.com/receiver.php?phoneget=" + number)
.subscribe(data =>
console.log(data);
, error =>
console.log(error);
);
All I want is to get the incoming number and send it to the server!
ionic3 httprequest cordova-plugins
add a comment |
I have a simple app and I implemented the Phone Call Trap plugin from here:
https://www.npmjs.com/package/tcg.plugin.phonecalltrap
Everything works fine, when I build my app and install it on real Android device(app-debug.apk) it shows me the incoming call number in an alert only. if I try to put anything instead of alert(any function, or post the number in a http call), is not working.
What am I missing? or what am I doing wrong?
the code is looking looking like this:
declare var window: any;
if (window.PhoneCallTrap)
PhoneCallTrap.onCall(function(obj)
var callObj = JSON.parse(obj),
state = callObj.state,
callingNumber = callObj.incomingNumber;
switch (state)
case "RINGING":
this.postData(callingNumber );
break;
case "OFFHOOK":
alert("Phone is off-hook");
break;
case "IDLE":
alert("Phone is idle");
break;
);
postData(number)
this.http.post("http://example.com/receiver.php",
someData: "data", phone: number
, headers: 'Content-Type': 'application/json' )
.subscribe(data =>
console.log(JSON.stringify(data));
, error =>
console.log(JSON.stringify(error));
);
this.http.get("http://example.com/receiver.php?phoneget=" + number)
.subscribe(data =>
console.log(data);
, error =>
console.log(error);
);
All I want is to get the incoming number and send it to the server!
ionic3 httprequest cordova-plugins
I have a simple app and I implemented the Phone Call Trap plugin from here:
https://www.npmjs.com/package/tcg.plugin.phonecalltrap
Everything works fine, when I build my app and install it on real Android device(app-debug.apk) it shows me the incoming call number in an alert only. if I try to put anything instead of alert(any function, or post the number in a http call), is not working.
What am I missing? or what am I doing wrong?
the code is looking looking like this:
declare var window: any;
if (window.PhoneCallTrap)
PhoneCallTrap.onCall(function(obj)
var callObj = JSON.parse(obj),
state = callObj.state,
callingNumber = callObj.incomingNumber;
switch (state)
case "RINGING":
this.postData(callingNumber );
break;
case "OFFHOOK":
alert("Phone is off-hook");
break;
case "IDLE":
alert("Phone is idle");
break;
);
postData(number)
this.http.post("http://example.com/receiver.php",
someData: "data", phone: number
, headers: 'Content-Type': 'application/json' )
.subscribe(data =>
console.log(JSON.stringify(data));
, error =>
console.log(JSON.stringify(error));
);
this.http.get("http://example.com/receiver.php?phoneget=" + number)
.subscribe(data =>
console.log(data);
, error =>
console.log(error);
);
All I want is to get the incoming number and send it to the server!
ionic3 httprequest cordova-plugins
ionic3 httprequest cordova-plugins
asked Mar 25 at 17:04
Ionut HateganIonut Hategan
12 bronze badges
12 bronze badges
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55343019%2fionic-3-phonecalltrap-send-post-incomingnumber-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55343019%2fionic-3-phonecalltrap-send-post-incomingnumber-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown