Skip to content
This repository has been archived by the owner on Aug 12, 2018. It is now read-only.
/ DMDiskStation Public archive

An iOS framework to interface with Synology DiskStations

License

Notifications You must be signed in to change notification settings

davidmuzi/DMDiskStation

Repository files navigation

DMDiskStation

An iOS framework to interface with Synology DiskStations

Purpose

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.

Installation

Link to the DMDiskStation framework in your application

#import <DMDiskStation/DMDiskStation.h>

Usage

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);
	        
	    }];

    }
}

Contributions

Are welcome, please submit issues and PRs!

About

An iOS framework to interface with Synology DiskStations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published