@DCloud_App_Array
self.call = function(number) {
if(plus.os.name=="Android"){
var Intent = plus.android.importClass("android.content.Intent");
var Uri = plus.android.importClass("android.net.Uri");
var main = plus.android.runtimeMainActivity();
var uri = Uri.parse("tel:"+number);
var call = new Intent("android.intent.action.CALL", uri);
main.startActivity(call);
}else{
//plus.device.dial(number, false);
var UIAPP=plus.ios.importClass("UIApplication");
var NSURL=plus.ios.importClass("NSURL");
var app=UIAPP.sharedApplication();
app.openURL(NSURL.URLWithString("tel://"+number));
}
};
self.sms=function(number,text){
if (plus.os.name == "Android") {
var Intent = plus.android.importClass("android.content.Intent");
var Uri = plus.android.importClass("android.net.Uri");
var uri = Uri.parse("smsto:"+number);
var intent = new Intent(Intent.ACTION_SENDTO, uri);
intent.putExtra("sms_body", "");
plus.android.runtimeMainActivity().startActivity(intent);
} else {
var UIAPP=plus.ios.importClass("UIApplication");
var NSURL=plus.ios.importClass("NSURL");
var app=UIAPP.sharedApplication();
app.openURL(NSURL.URLWithString("sms://"+number));
}
};
1 个回复
jojocreator (作者) - xjjamei
@DCloud_App_Array