Merged PR 12725: Fix iOS Samples for new event model

Fix iOS Samples for new event model
This commit is contained in:
Brian Bowman 2018-11-09 19:04:03 +00:00
Родитель 6d7e6b823e
Коммит 1089b25694
6 изменённых файлов: 7 добавлений и 49 удалений

Просмотреть файл

@ -1,42 +0,0 @@
{
"project_info": {
"project_number": "782586391244",
"firebase_url": "https://graphnotifications-a61a7.firebaseio.com",
"project_id": "graphnotifications-a61a7",
"storage_bucket": "graphnotifications-a61a7.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:782586391244:android:7bd1ae34fbb0ccaa",
"android_client_info": {
"package_name": "com.microsoft.connecteddevices.graphnotifications"
}
},
"oauth_client": [
{
"client_id": "782586391244-93dahs8garncusah95oene5gk1sj88uh.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCsYVrZK8DVYTTIP_YdT-5NCuRY5sIkmqM"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}

Просмотреть файл

@ -46,7 +46,7 @@ static NotificationsManager* s_manager;
self.reader = [self.channel createReader];
__weak typeof(self) weakSelf;
_readerRegistrationToken = [self.reader addDataChangedListener:^(__unused MCDUserNotificationReader* source, __unused MCDUserNotificationReaderDataChangedEventArgs* args) {
_readerRegistrationToken = [self.reader.dataChanged subscribe:^(__unused MCDUserNotificationReader* source, __unused MCDUserNotificationReaderDataChangedEventArgs* args) {
[weakSelf forceRead];
}];
}

Просмотреть файл

@ -32,7 +32,7 @@
[_delegate appServiceProvider:self didOpenConnection:connection];
id<AppServiceProviderDelegate> __weak weakDelegate = _delegate;
[connection addRequestReceivedListener:^(MCDAppServiceConnection* connection, MCDAppServiceRequestReceivedEventArgs* args) {
[connection.requestReceived subscribe:^(MCDAppServiceConnection* connection, MCDAppServiceRequestReceivedEventArgs* args) {
[weakDelegate appServiceConnection:connection didReceiveRequest:args];
}];
}

Просмотреть файл

@ -85,7 +85,7 @@
{
connection = _appServiceConnection = [MCDAppServiceConnection new];
connection.appServiceInfo = [MCDAppServiceInfo infoWithName:APP_SERVICE_NAME packageId:PACKAGE_ID];
_serviceClosedRegistration = [connection addServiceClosedListener:^(__unused MCDAppServiceConnection* connection,
_serviceClosedRegistration = [connection.serviceClosed subscribe:^(__unused MCDAppServiceConnection* connection,
MCDAppServiceClosedEventArgs* args) { [self appServiceConnection:connection closedWithStatus:args.status]; }];
}
}

Просмотреть файл

@ -107,13 +107,13 @@
(remoteSystemFilter.count > 0) ? [[MCDRemoteSystemWatcher alloc] initWithFilters:remoteSystemFilter] : [MCDRemoteSystemWatcher new];
RemoteSystemViewController* __weak weakSelf = self;
[_watcher addRemoteSystemAddedListener:^(
[_watcher.remoteSystemAdded subscribe:^(
__unused MCDRemoteSystemWatcher* watcher, MCDRemoteSystemAddedEventArgs* args) { [weakSelf _onRemoteSystemAdded:args.remoteSystem]; }];
[_watcher addRemoteSystemUpdatedListener:^(
[_watcher.remoteSystemUpdated subscribe:^(
__unused MCDRemoteSystemWatcher* watcher, MCDRemoteSystemUpdatedEventArgs* args) { [weakSelf _onRemoteSystemUpdated:args.remoteSystem]; }];
[_watcher addRemoteSystemRemovedListener:^(
[_watcher.remoteSystemRemoved subscribe:^(
__unused MCDRemoteSystemWatcher* watcher, MCDRemoteSystemRemovedEventArgs* args) { [weakSelf _onRemoteSystemRemoved:args.remoteSystem]; }];
[_watcher start];
}

Просмотреть файл

@ -53,7 +53,7 @@
[registration addAppServiceProvider:[[AppServiceProvider alloc] initWithDelegate:[AppDataSource sharedInstance].inboundRequestLogger]];
[registration addAttribute:@"ExampleAttribute" forName:@"ExampleName"];
[registration addStatusChangedListener:^(__unused MCDRemoteSystemAppHostingRegistration* reg, MCDRemoteSystemAppRegistrationStatusChangedEventArgs* args) {
[registration.statusChanged subscribe:^(__unused MCDRemoteSystemAppHostingRegistration* reg, MCDRemoteSystemAppRegistrationStatusChangedEventArgs* args) {
NSLog(@"Registration Status Changed listener");
switch (args.status) {
case MCDRemoteSystemAppRegistrationStatusFailed: