How to do BLE multi-advertisement from single iOS App?

I have an iOS App as peripheral which advertises packets.

     NSDictionary *advertise = @{CBAdvertisementDataLocalNameKey : shortName, CBAdvertisementDataServiceUUIDsKey: @[[CBUUID UUIDWithString:uuidA]]};     
    [self.manager startAdvertising:advertise];

Then, my other centratl app will scan and filter by the same serviceUUID.

[self.manager scanForPeripheralsWithServices:@[[CBUUID UUIDWithString:uuidA] options:@{CBCentralManagerScanOptionAllowDuplicatesKey: @(true)}];

Now, we want to change the ServiceUUID (uuidA -> uuidB), but we hope that the old version of the central app can still scan for the new peripheral app, so I need do multi-advertisement of BLE.

// 1
NSDictionary *advertise = @{CBAdvertisementDataLocalNameKey : shortName, CBAdvertisementDataServiceUUIDsKey: @[[CBUUID UUIDWithString:uuidA], [CBUUID UUIDWithString:uuidB]]};
[self.manager startAdvertising:advertise];

// 2
NSDictionary *advertise = @{CBAdvertisementDataLocalNameKey : shortName, CBAdvertisementDataServiceUUIDsKey: @[[CBUUID UUIDWithString:uuidA]]};
[self.manager startAdvertising:advertise];

NSDictionary *advertise = @{CBAdvertisementDataLocalNameKey : shortName, CBAdvertisementDataServiceUUIDsKey: @[[CBUUID UUIDWithString:uuidB]]};
[self.manager2 startAdvertising:advertise];

However, these two implementations, on the central side, it can always scan only one broadcast packet.

Can somebody suggest any method to do this task? From the central (scanner) app, I should get two different advertisements.

When you start advertising a new UUID, the old advertisement is implicitly stopped. If your UUIDs are short (16 or 32 bit) you should be able to stuff them both into a single advertisement. iOS shoves so much other stuff in the advertisement packets that you don't get a lot of space.

If you want to get two different advertisement UUIDs to appear to your scanner app, you should implement a loop to toggle between the two different forms of advertising. I can't make a recommendation on how frequently to switch between the two advertisement payloads--that'd have to be something you experiment with.

How to do BLE multi-advertisement from single iOS App?
 
 
Q