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
bennyantony
Posts: 27
Registered: ‎03-27-2011
My Device: Z10,Q10,Z30

Capturing the signals from API (specifically contactsAdded() signal after calling createContact of ContactService)

I am calling ContactService.createContact() . The console is showing that contactsAdded() signal is emited. How I can catpure that signal from C++? I tried to add contactsAdded.connect(fn), but its giving compiler error. How I can define a function in C++, which will be called when the API ContactService emits contactsAdded() signal after contact is added successfully.

 

Or in general, if the APIs we are calling is emiting a signal, how we can catpure it..?

 

 

Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30

Re: Capturing the signals from API (specifically contactsAdded() signal after calling createContact of ContactService)

Try this: https://developer.blackberry.com/native/documentation/cascades/dev/signals_slots/

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Developer
bennyantony
Posts: 27
Registered: ‎03-27-2011
My Device: Z10,Q10,Z30

Re: Capturing the signals from API (specifically contactsAdded() signal after calling createContact of ContactService)

I tried the following

 

 

ContactService service

ContactBuilder builder;

 

QObject::connect(service,
                                                         SIGNAL(contactsAdded()),
                                                         this,
                                                         SLOT(contactAdded()));
                        service->createContact(builder, true);

 

contactsAdded is the signal as per the documentation. but "contactAdded()" is not getting called.

 

if I call  service->createContact(builder, true); without postal address, contact is getting created. But when I call builder.addPostalAddress(), contact is not added to work perimeter contacts, when i call createContact.

 

If there is no postal address, its working.. I am not sure whether its a bug or I am doing it wrong. I tried example from the site and its still not working..

 

 

Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30

Re: Capturing the signals from API (specifically contactsAdded() signal after calling createContact of ContactService)

That's odd. Sounds like it could be a bug, if it's just the postal address that is making the difference. Please log an issue on the Developer Issue Tracker: DIT

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker