apple / live-caller-id-lookup-example

Example service & documentation for Live Caller ID Lookup
https://swiftpackageindex.com/apple/live-caller-id-lookup-example/main/documentation/pirservice
Apache License 2.0
110 stars 6 forks source link

How to fetch the latest identity info after the service is updated? #23

Closed hoocbee closed 3 months ago

hoocbee commented 3 months ago

Hi,

I wonder how the client could fetch the updated number identity info after the server updates input.txtpb?

At first, the content of my input.txtpb file was like this:

图片 1

After executing the ConstructDatabase, PIRProcessDatabase and PIRService commands, I installed my App and turned on the LIVE CALLERID LOOKUP, and successfully displayed "ID1" when the call came in. 图片 2

Then, I changed the name of the input.txtpb file from “ID1” to "ID2". However, after I re-executed the ConstructDatabase, PIRProcessDatabase and PIRService commands:

I wonder what is the correct way to do this? Or is there a bug here? From the API comments of LiveCallerIDLookupManager, it seems that is not necessary to execute the refreshPIRParameters method when just modify the name?

hoocbee commented 3 months ago

In addition, if I only execute the ConstructDatabase and PIRProcessDatabase commands without executing the PIRService command after change the name of input.txtpb from "ID1" to "ID2" :

karulont commented 3 months ago

What happens, is that by restarting the server, you also invalidated a few other things: cached access tokens, evaluation key stored on server.

So that is the reason why you needed to use the refreshPIRParameters.

22 adds some additional information about it.

hoocbee commented 3 months ago

So, if I modify the content of the input.txtpb file, do I have to restart the service? As I added in the comment above, it seems that if the service is not restarted, the client will still fetch the old name ("ID1") . Is this as expected?

karulont commented 3 months ago

This is expected for the example service. It only loads the service-config and the usecases defined there at startup. So following changes to the files fill not affect the service until the service is restarted(which also invalidated a few keys).

hoocbee commented 3 months ago

Got it, thanks!