Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Phone call not working?
Started by backend Mar 18 2014 09:23 AM

10 replies to this topic
phone calls

Best Answer backend , 18 March 2014 - 01:21 PM

Permission?

Do you know wich permission do i need?

 

EDIT: I found it :)
Permission needed is:
android.permission.CALL_PHONE

Thank you for your help! :)

[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

backend

[GLOBAL: userInfoPane.html]
backend
  • Observer

  • 16 posts
  • Corona SDK

Hi,

 

I'm developing an app, and I need user to be able to call a phone number.

 

I'm using:
system.openURL("tel:12345678") -->fake phone number

 

In simulator, it tries to open Skype to make the call...

When I compile it for android, nothing happend.
I have a Moto G, with android 4.3... do I have missing something?

 

Thanks in advance :)



[TOPIC: post.html]
#2

piotrz55

[GLOBAL: userInfoPane.html]
piotrz55
  • Contributor

  • 754 posts
  • Corona SDK

What is console output when you debug?



[TOPIC: post.html]
#3

backend

[GLOBAL: userInfoPane.html]
backend
  • Observer

  • 16 posts
  • Corona SDK

What is console output when you debug?

 

My code looks like this:

 

    print("calling...")
    system.openURL("tel:12345678")

 

Nothing is shown about it... this is the log from android device:

 

03-18 15:59:10.783 30207 30224 V Corona  : > Class.forName: network.LuaLoader
03-18 15:59:10.783 30207 30224 V Corona  : < Class.forName: network.LuaLoader
03-18 15:59:10.784 30207 30224 V Corona  : Loading via reflection: network.LuaLo
ader
03-18 15:59:10.876 30207 30224 V Corona  : > Class.forName: CoronaProvider.licen
sing.google.LuaLoader
03-18 15:59:10.876 30207 30224 V Corona  : < Class.forName: CoronaProvider.licen
sing.google.LuaLoader
03-18 15:59:10.885 30207 30224 V Corona  : Loading via reflection: CoronaProvide
r.licensing.google.LuaLoader
03-18 15:59:10.893 30207 30224 I Corona  : calling...

--< Nothing below >--
 
Any suggestion?


[TOPIC: post.html]
#4

piotrz55

[GLOBAL: userInfoPane.html]
piotrz55
  • Contributor

  • 754 posts
  • Corona SDK

Permission?



[TOPIC: post.html]
#5

backend

[GLOBAL: userInfoPane.html]
backend
  • Observer

  • 16 posts
  • Corona SDK

  Best Answer

Permission?

Do you know wich permission do i need?

 

EDIT: I found it :)
Permission needed is:
android.permission.CALL_PHONE

Thank you for your help! :)



[TOPIC: post.html]
#6

piotrz55

[GLOBAL: userInfoPane.html]
piotrz55
  • Contributor

  • 754 posts
  • Corona SDK

Glad you found it ;) (never used calling service so wasn't sure)

 

03-18 15:59:10.893 30207 30224 I Corona  : calling...

It was the hint - it was trying to do it but couldn't finish :)



[TOPIC: post.html]
#7

MatthewCharlesHarrop

[GLOBAL: userInfoPane.html]
MatthewCharlesHarrop
  • Contributor

  • 139 posts
  • Corona SDK

Hi,

 

I'm sorry to resurrect an old topic but I too am struggling with making a phone call.

 

I use system.openURL("tel:1234567890") but the only response I get is:

 

 

2014-08-26 12:01:06.096 Corona Simulator[329:507]
Copyright © 2009-2014  C o r o n a   L a b s   I n c .
2014-08-26 12:01:06.097 Corona Simulator[329:507]     Version: 3.0.0
2014-08-26 12:01:06.097 Corona Simulator[329:507]     Build: 2014.2393
2014-08-26 12:01:06.160 Corona Simulator[329:507] Platform: iPhone / x86_64 / 10.9 / NVIDIA GeForce 320M OpenGL Engine / 2.1 NVIDIA-8.24.15 310.90.9.05f01 / 2014.2393
2014-08-26 12:01:06.251 Corona Simulator[329:507] The file sandbox for this project is located at the following folder:
    (/Users/XXXXX/Library/Application Support/Corona Simulator/PhoneCallTest-1F7D702B2B7F0D5D0455BEE6AF59FE8D)
2014-08-26 12:01:06.316 Corona Simulator[329:507] WARNING: url( tel:1234567890 ) is not supported by the simulator
Warning: /Users/XXXXX/Documents/XXXXX/XXX/PhoneCallTest/main.lua:1: system.openURL() failed to open URL: tel:1234567890

 

I've tried it in the Xcode sim too but get the same response, anybody got any ideas? Am I missing a library?

 

EDIT: I've also tried this on an Android phone (MotoG) and it failed to do anything...



[TOPIC: post.html]
#8

bjsorrentino

[GLOBAL: userInfoPane.html]
bjsorrentino
  • Veteran

  • 8,506 posts
  • Corona SDK

Hi @MatthewCharlesHarrop,

What happens when you try it on an actual iOS device?

 

Brent



[TOPIC: post.html]
#9

Gremlin Interactive

[GLOBAL: userInfoPane.html]
Gremlin Interactive
  • Contributor

  • 700 posts
  • Enterprise

You need to include an extra permission (iirc) for android.

The android developer site lists all these permissions, i would imagine the system.openURL doc page lists them too?

[TOPIC: post.html]
#10

backend

[GLOBAL: userInfoPane.html]
backend
  • Observer

  • 16 posts
  • Corona SDK

Hi,

 

I'm sorry to resurrect an old topic but I too am struggling with making a phone call.

 

I use system.openURL("tel:1234567890") but the only response I get is:

 

 

I've tried it in the Xcode sim too but get the same response, anybody got any ideas? Am I missing a library?

 

EDIT: I've also tried this on an Android phone (MotoG) and it failed to do anything...

 

Calls doesn't work in Simulator... I solved my problem including this in build.settings:

android =
{
        usesPermissions =
        {
                "android.permission.CALL_PHONE", 
        },
}
And testing directly on device.


[TOPIC: post.html]
#11

MatthewCharlesHarrop

[GLOBAL: userInfoPane.html]
MatthewCharlesHarrop
  • Contributor

  • 139 posts
  • Corona SDK

Ok, so it works on Android now :D

 

I've just got to try it on iOS, but I am sure it'll work. Thanks very much for your help!




[topic_controls]
 
[/topic_controls]