Igor Sokolovsky
Igor Sokolovsky

Reputation: 87

Swift CNContact did changed when app is not active

Update: Ok i will explain again i want to know if the phone contacts changed not my data

is there a way to know if contacts were changed without looping all contacts while the app were close

Notification.name.CNContactStoreDidChange work only after app is lunched

Note: android version is broudcastreceiver notify you for that change even if your app is killed

Upvotes: 2

Views: 1084

Answers (1)

Benjamin Lowry
Benjamin Lowry

Reputation: 3799

The short answer is no. In iOS, apps do not support operations that happen when your app is inactive. Thus it is impossible for something like a contact changing to be registered in your app when it is in this inactive state.

The only way that your app can receive data is for example if it comes from an external source (i.e. an online notification) or if you have a time-specific notification that is pre-set when your app is running.

In order to check for something like this you would have to manually search through the contacts upon app startup.

You can see these answers for more details: Broadcast receiver / service in Android vs. iPhone and Can iOS receive broadcasts like Android?

Upvotes: 3

Related Questions