12-17-2013 12:15 AM
I need to create an extension using webworks apis to get all contacts data as well as launch contact picker and have to get contact name, numbers and Base 64 string of contact image.
Now i have some quesries listed below:
1. I tried to achieve my requirement with webworks api. For this i did changes in config.xml.
<param name="mode" value="portrait" />
and able to access apis of pim.contact placed here: C:\Program Files\Research In Motion\BlackBerry 10 WebWorks SDK 188.8.131.52\Framework\ext\pim.contacts
But when i tried to get all contacts using getContactAccounts() method, it is giving me two accounts simcontacts and LocalContacts and their ids are 2 and 19 respectively.
I found that i can get list of contacts by using contacts example. but it is limiting the length to 20.
2.I didn't find any proper documentaion to get fields of my contact like: name, numbers and Base 64 string of contact image like the way they have given in Native SDK documentation.
Please share any sample code which is retreiving all the fields of Singla contact data.
3. I need to share my contact plugin and need to expose some methods from my webworks plugin.
How can i achieve it?
Is there any way of getting code of native side for pim.contact plugin, so that i can add more methods in it and can expose these more methods to Web Works app by the making the required chnages in index.js and client.js.
Solved! Go to Solution.
12-18-2013 04:09 PM
12-18-2013 01:04 PM
12-18-2013 02:03 PM - edited 12-18-2013 02:13 PM
I am using find() method to access contacts. and it is working fine. I tried to set limit to -1 and it is returning only 20 contacts. I am using device having OS version 10.0. somewhere i read that it works fine in OS 10.1 devices but not in 10.0 devices. Please confirm.
Also i was asked to create an contact extension that will expose two methods:
1. to invoke contact picker and return single contact data.
2. to get all contacts data with fields name, numbers and image only.
Since contact apis are not supported in native code of custom extension. So, I created a sample webworks app(using pim.contacts webworks extension) that is containing these two methods in .js file. Now please guide me how can i create extension and expose these methods to hybrid app.
12-18-2013 04:09 PM