Instance Method

peripheral:didModifyServices:

Invoked when a peripheral’s services have changed.

Declaration

- (void)peripheral:(CBPeripheral *)peripheral didModifyServices:(NSArray<CBService *> *)invalidatedServices;

Parameters

peripheral

The peripheral providing this information.

invalidatedServices

A list of services that have been invalidated.

Discussion

This method is invoked whenever one or more services of a peripheral have changed. A peripheral’s services have changed if:

  • A service is removed from the peripheral’s database

  • A new service is added to the peripheral’s database

  • A service that was previously removed from the peripheral’s database is readded to the database at a different location

If you previously discovered any of the services that have changed, they are provided in the invalidatedServices parameter and can no longer be used. You can use the discoverServices: method to discover any new services that have been added to the peripheral’s database or to find out whether any of the invalidated services that you were using (and want to continue using) have been added back to a different location in the peripheral’s database.

See Also

Monitoring Changes to a Peripheral’s Name or Services

- peripheralDidUpdateName:

Invoked when a peripheral’s name changes.

- peripheralDidInvalidateServices:

Invoked when a peripheral’s services have changed.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software