Skip to content

Commit 5698b7c

Browse files
committed
EventCacheControllerについてのNilアクセスが生じないように修正。
これにより、EventManagerがデフォルトではオンメモリのキャッシュにイベント情報を保持するようになる。
1 parent cbac300 commit 5698b7c

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

dConnectSDK/dConnectSDKForIOS/DConnectSDK/Classes/DConnectDevicePlugin.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,15 @@ - (id) initWithObject: (id) object {
5050
self.pluginVersionName = @"1.0.0";
5151
self.pluginId = [md5Proc generateSignature: self.pluginName];
5252

53+
// DeviceConnectサービス管理クラスの初期化
5354
DConnectServiceManager *serviceManager = [DConnectServiceManager sharedForClass: [object class]];
5455
[serviceManager setPlugin: self];
5556
[self setServiceProvider: serviceManager];
5657

58+
// イベント管理クラスの初期化
59+
id<DConnectEventCacheController> ctrl = [self eventCacheController];
60+
[[DConnectEventManager sharedManagerForClass:[self class]] setController:ctrl];
61+
5762
// プロファイル追加
5863
[self addProfile:[[DConnectAuthorizationProfile alloc] initWithObject:self]];
5964
[self addProfile:[[DConnectServiceDiscoveryProfile alloc] initWithServiceProvider: self.serviceProvider]];
@@ -228,6 +233,11 @@ - (NSArray *) serviceProfilesWithServiceId: (NSString *) serviceId {
228233
return nil;
229234
}
230235

236+
- (id<DConnectEventCacheController>) eventCacheController
237+
{
238+
return [[DConnectMemoryCacheController alloc] init];
239+
}
240+
231241

232242
- (NSString*)iconFilePath:(BOOL)isOnline
233243
{

dConnectSDK/dConnectSDKForIOS/DConnectSDK/DConnectSDK/DConnectDevicePlugin.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#import <DConnectSDK/DConnectRequestMessage.h>
1717
#import <DConnectSDK/DConnectResponseMessage.h>
1818
#import <DConnectSDK/DConnectServiceProvider.h>
19+
#import <DConnectSDK/DConnectEventCacheController.h>
1920

2021

2122
/*!
@@ -115,6 +116,8 @@
115116
*/
116117
- (void)applicationWillEnterForeground;
117118

119+
- (id<DConnectEventCacheController>) eventCacheController;
120+
118121
- (NSArray *) serviceProfilesWithServiceId: (NSString *) serviceId;
119122

120123
- (NSString*)iconFilePath:(BOOL)isOnline;

0 commit comments

Comments
 (0)