Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 85
Registered: ‎06-22-2013
My Device: N/A
Accepted Solution

Invoke Phone Call

Hello Guys,

 

I'm trying to invoke a phone call, i have used this code but when i call it the application crashes.

 

void invokePhone()
 {
	InvokeRequest request;
	request.setMimeType("application/vnd.blackberry.phone.startcall");
	request.setAction("bb.action.DIAL");

	QVariantMap map;
	map.insert("number","858");
	map.insert("line_id", "Mobile");
	map.insert("apply_smart_dialing", false); 
	QByteArray requestData = bb::PpsObject::encode(map, NULL);
	request.setData(requestData);
	m_invokeManager->invoke(request);
}


 What is wrong with this function.

Developer
Posts: 85
Registered: ‎06-22-2013
My Device: N/A

Re: Invoke Phone Call

import bb.system 1.0

attachedObjects: [
    Phone {
        id:phone
    }
]
Button
{
   onClicked
   {
      phone.requestDialpad("654654","Mobile")
   }
}

QML Code.