MPRemoteCommandCenter 与 AVAudioSession 有关系。
如果增加AVAudioSessionCategoryOptionMixWithOthers,远程控制会消失。
I faced the same related issue. AVAudioSessionCategory should be mixwithothers, and you will no longer can update Lock Screen Control Center with info.
@startuml
WWLoginController -> WWThirdPartyLoginManager : press apple sign in button
WWThirdPartyLoginManager --> WWLoginController : apple sigin and send (userId, accessToken) back
WWLoginController -> WWThirdPartyAccountManager : send (loginType, userId, accessToken) to third party account manager
WWThirdPartyAccountManager --> WWLoginController : send (loginType, userId, accessToken) to server and send login status back
WWLoginController -> WWAccountRelatedManager : login succeeded, save (loginType, userId, responseObject)
WWLoginController -> WWRegisterInputNumberController : login failed, register phone number
@enduml
@startwbs
* SpeechSDK
** Buf
*** set address
*** get address
*** set size
*** get size
** CallBackBase
*** call back with parameter
** Value
** SpeechSDS
*** make instance
*** set parameter
*** get parameter
*** get service
*** release service
*** clear up
*** destroy instance
** Service
*** invoke parameter
** Parameter
*** set parameter
*** get parameter
*** has parameter
*** drop parameter
*** clear parameter
@endwbs
制作git patch:git format-patch commitID
应用git patch:git am patchName
查看修改:git apply patchName --reject
对照修改解决问题删除rej文件之后:git add .git am --continue
2019.07.29
Core Bluetooth
Devices that implement the central role in Bluetooth low energy communication perform a number of common tasks—for example, discovering and connecting to available peripherals, and exploring and interacting with the data that peripherals have to offer.
Devices that implement the peripheral role also perform a number of common, but different, tasks—for example, publishing and advertising services, and responding to read, write, and subscription requests from connected centrals.
A peripheral typically has data that is needed by other devices.
A central typically uses the information served up by a peripheral to accomplish some task.
Peripherals make their presence known by advertising the data(services、characteristics) they have over the air.
Centrals scan for nearby peripherals that might have data they’re interested in, or interact with a peripheral’s service by reading or writing the value of that service’s characteristic.
When a central discovers such a peripheral,
the central requests to connect to the peripheral and begins exploring and interacting with the peripheral’s data.
The peripheral is responsible for responding to the central in appropriate ways.
You can retrieve the value of a characteristic by reading it directly or by subscribing to it.
Discover and connect to peripheral devices that are advertising
123456789101112131415
// specify services CBUUID to discover peripherials you are interested in[myCentralManagerscanForPeripheralsWithServices:niloptions:nil];-(void)centralManager:(CBCentralManager*)centraldidDiscoverPeripheral:(CBPeripheral*)peripheraladvertisementData:(NSDictionary*)advertisementDataRSSI:(NSNumber*)RSSI{// If you plan to connect to the discovered peripheral, keep a strong reference to it so the system does not deallocate it.NSLog(@"Discovered %@",peripheral.name);self.discoveredPeripheral=peripheral;...}// save power[myCentralManagerstopScan];
Connecting to a Peripheral Device After You’ve Discovered It
123456789101112131415
[myCentralManagerconnectPeripheral:peripheraloptions:nil];-(void)centralManager:(CBCentralManager*)centraldidConnectPeripheral:(CBPeripheral*)peripheral{NSLog(@"Peripheral connected");// set peripheral delegateperipheral.delegate=self;// specify services CBUUID to discover services you are interested in[peripheraldiscoverServices:nil];...}
Discovering the Services of a Peripheral That You’re Connected To
12345678910111213
-(void)peripheral:(CBPeripheral*)peripheraldidDiscoverServices:(NSError*)error{for(CBService*serviceinperipheral.services){NSLog(@"Discovered service %@",service);NSLog(@"Discovering characteristics for service %@",service);[peripheraldiscoverCharacteristics:nilforService:service];...}...}
-(void)peripheral:(CBPeripheral*)peripheraldidUpdateValueForCharacteristic:(CBCharacteristic*)characteristicerror:(NSError*)error{NSData*data=characteristic.value;// parse the data as needed...}-(void)peripheral:(CBPeripheral*)peripheraldidUpdateNotificationStateForCharacteristic:(CBCharacteristic*)characteristicerror:(NSError*)error{if(error){NSLog(@"Error changing notification state: %@",[errorlocalizedDescription]);}...}
Writing the Value of a Characteristic
12345678910111213
NSLog(@"Writing value for characteristic %@",interestingCharacteristic);[peripheralwriteValue:dataToWriteforCharacteristic:interestingCharacteristictype:CBCharacteristicWriteWithResponse];-(void)peripheral:(CBPeripheral*)peripheraldidWriteValueForCharacteristic:(CBCharacteristic*)characteristicerror:(NSError*)error{if(error){NSLog(@"Error writing characteristic value: %@",[errorlocalizedDescription]);}...}
Sending Updated Characteristic Values to Subscribed Centrals
12345678910
-(void)peripheralManager:(CBPeripheralManager*)peripheralcentral:(CBCentral*)centraldidSubscribeToCharacteristic:(CBCharacteristic*)characteristic{NSLog(@"Central subscribed to characteristic %@",characteristic);NSData*updatedValue=// fetch the characteristic's new valueBOOLdidSendValue=[myPeripheralManagerupdateValue:updatedValueforCharacteristic:characteristiconSubscribedCentrals:nil];}-(void)peripherialManagerIsReadyToUpdateSubscribers:(CBPeripheralManager*)peripheral{}
Background Processing
That said, you can declare your app to support the Core Bluetooth background execution modes to allow your app to be woken up from a suspended state to process certain Bluetooth-related events. Even if your app doesn’t need the full range of background processing support, it can still ask to be alerted by the system when important events occur.
All Bluetooth-related events that occur while a foreground-only app is in the suspended state are queued by the system and delivered to the app only when it resumes to the foreground. That said, Core Bluetooth provides a way to alert the user when certain central role events occur. The user can then use these alerts to decide whether a particular event warrants bringing the app back to the foreground.
bluetooth-central bluetooth-peripheral
While your app is in the background you can still discover and connect to peripherals, and explore and interact with peripheral data. In addition, the system wakes up your app when any of the CBCentralManagerDelegate or CBPeripheralDelegate delegate methods are invoked, allowing your app to handle important central role events, such as when a connection is established or torn down, when a peripheral sends updated characteristic values, and when a central manager’s state changes.
Upon being woken up, an app has around 10 seconds to complete a task. Ideally, it should complete the task as fast as possible and allow itself to be suspended again. Apps that spend too much time executing in the background can be throttled back by the system or killed.
Adding Support for State Preservation and Restoration
Scan for Devices Only When You Need To
Unless you need to discover more devices, stop scanning for other devices after you have found one you want to connect to.
Explore a Peripheral’s Data Wisely
Therefore, you should look for and discover only the services and associated characteristics your app needs.
Subscribe to Characteristic Values That Change Often
It is best practice to subscribe to a characteristic’s value when possible, especially for characteristic values that change often.
Disconnect from a Device When You Have All the Data You Need
Reconnecting to Peripherals
Retrieving a List of Known Peripherals
Respect the Limits of Advertising Data
When your app is in the foreground, it can use up to 28 bytes of space in the initial advertisement data for any combination of the two supported advertising data keys.
Configure Your Characteristics to Support Notifications
bitcode_strip exited with 1
In additional to your answer, there is mush simpler method. As I see, XCode uses bitcode-strip only when enviroment variable STRIP_BITCODE_FROM_COPIED_FILES is set to YES. It seems that it’s set to default when enable_bitcode is switched on.
Add User-Defined Setting STRIP_BITCODE_FROM_COPIED_FILES=NO to your Target and it will compile fine, XCode will use standard strip.
2019.06.27
however, it’s generally preferable to deactivate your audio session before changing the category or other session properties. Making these changes while the session is deactivated prevents unnecessary reconfigurations of the audio system.
Ensure that the audio session for an app using a recording category is active only while recording. Before recording starts and when it stops, ensure that your session is inactive to allow other sounds, such as incoming message alerts, to play.
If an app supports background audio playback or recording, deactivate its audio session when entering the background if the app is not actively using audio (or preparing to use audio). Doing so allows the system to free up audio resources so that they may be used by other processes. It also prevents the app’s audio session from being deactivated when the app process is suspended by the operating system.
An audio interruption is the deactivation of your app’s audio session—which immediately stops your audio. Interruptions happen when a competing audio session from an app is activated and that session is not categorized by the system to mix with yours. After your session goes inactive, the system sends a “you were interrupted” message that you can respond to by saving state, updating the user interface, and so on.
storePassword=<password from previous step>
keyPassword=<password from previous step>
keyAlias=key
storeFile=<location of the key store file, e.g. /Users/<user name>/key.jks>