An iOS framework to interface with Synology DiskStations
To use a Synology DiskStation NAS as a private cloud in an iOS application. This framework allows reading and writing to the DiskStation using the FileStation API.
Link to the DMDiskStation framework in your application
#import <DMDiskStation/DMDiskStation.h>
First an authenticated session must be established with the DiskStation. A Login view controller can be presented to allow the user to enter their credentials. No passwords are stored on the device, and the session token is stored securely using the keychain.
self.session = [[DMDiskStationSession alloc] initWithDelegate:self];
if (_session.isSessionActive == NO) {
[_session showLoginFromViewController:self.navigationController];
}
Upon a successful authentication, the FileStation API can be used.
- (void)session:(DMDiskStationSession *)session didLogin:(BOOL)success {
if (success) {
self.api = [[DMFileStationAPI alloc] initWithSession:_session];
[self.api fileListForPath:nil callback:^(NSError *error, NSArray *files) {
NSLog(@"%@", files);
}];
}
}
Are welcome, please submit issues and PRs!