Picture of mla
Registered 2 years 76 days
mla Friday, 15 March 2024, 12:34 PM
Add gateway to phonesearch
Hello smile
I am alrealy using the phonelookup api to search for names for incoming calls using an api. I just got asked wether I could implement another rest api that looks up contacts in our local database and shows them like other contacts in the search of the phone-App. Is it possible to implement it? I know that the search triggers messages to/from UpdateAppsInfo, Search and com.innovaphone.search. Can I somehow interact with these messages in a useful way?

Kind regards
Miriam Laube

seach.png

Picture of Peter Stock (innovaphone)
Moderator Registered 1 year 114 days
Peter Stock (innovaphone) Monday, 15 April 2024, 08:52 AM
Re: Add gateway to phonesearch
Hello Miriam,

please have a look on:
https://sdk.innovaphone.com/14r1/doc/appgeneric.htm#config-apis

If you add the com.innovaphone.search to your config.json you can probably install it in the same way as your app with the lookup and then also handle the messages in the service.

"apis": {
"manufacturer-appname": {
"com.innovaphone.search": {
"info": {}
},
"presence": true,
"hidden": true
}
}

Does that help you?

Best Regards,

Peter


Picture of mla
Registered 2 years 76 days
mla Tuesday, 23 April 2024, 11:33 AM
Re: Add gateway to phonesearch
Hello Peter,

thanks for the reply. While it does help with searching for contacts I am still unsure how to connect it to the searchfield of the phoneApp. I provided a picture of it in my first question.
Picture of Peter Stock (innovaphone)
Moderator Registered 1 year 114 days
Peter Stock (innovaphone) Tuesday, 23 April 2024, 03:11 PM
Re: Add gateway to phonesearch
Hi Miriam,

in the config.json you need to add the searchApi.

In my case, the app is called "innovaphone-example"...

"apis": {
"innovaphone-example": {
"com.innovaphone.search": {
"info": {}
},
"com.innovaphone.phonelookup": {
"info": {}
},
"hidden": true
}
}


In your clientcode "innovaphone-example.js" (in my case) you can simply
do this :

var phonelookupApi = start.provideApi("com.innovaphone.phonelookup");

phonelookupApi.onmessage.attach(function (sender, phonelookupApiRequest) {
console.log(phonelookupApiRequest.msg);
});

var searchApi = start.provideApi("com.innovaphone.search");

searchApi.onmessage.attach(function (sender, searchApiRequest) {
console.log(searchApiRequest.msg);
});

Now you see your search Request in the Console and you can do what you want with this request ;)

For the Structure, you can have a look on :

← You can define your color theme preference here