1

我有一个简单的问题,当我使用

var phone_number='12346789';

Titanium.Platform.openURL('tel:'+phone_number);

   it goes to dial pad in android i want it to directly dial the call without prompting the user to press the call button.

我将 AndroidManifest.xml 中的权限添加为

<uses-permission android:name="android.permission.CALL_PHONE" />

但它仍然无法正常工作,仍然要求用户按下通话按钮。任何人对此有所了解,请帮助。

阿里。

4

1 回答 1

5

That should be in your tiapp.xml, slightly differently:

<android xmlns:android="http://schemas.android.com/apk/res/android">
  <manifest>
    <uses-permission android:name="android.permission.CALL_PHONE" />
  </manifest>
</android>

And then use intents to open the dialer:

var intent = Ti.Android.createIntent({
    action: Ti.Android.ACTION_CALL,
    data: 'tel:1234567'
});
Ti.Android.currentActivity.startActivity(intent);

Source: http://shareourideas.com/2012/09/05/appcelerator-titanium-android-click-to-auto-call/

于 2012-12-02T19:15:09.357 回答