To run the example project, clone the repo, and run pod install
from the Example directory first.
Basic ViewController usage Example:
// ViewController.m
#import "ViewController.h"
@interface ViewController ()
@end
CocoaDialClient *dialClient;
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
dialClient = [[CocoaDialClient alloc] initWithDelegate:self];
[dialClient findServers];
}
- (void)dialServerListUpdated:(NSArray *)servers
{
NSLog(@"dialServerListUpdated");
CocoaDialServerObject* last = nil;
for (CocoaDialServerObject* result in servers){
NSLog(@"%@ %@ %@ %@",result.location, result.hostAddress, result.usn, result.uuid);
last = result;
}
if (last != nil) {
[dialClient launchApplication:@"Netflix" atServer:last withParameters:@"cmd=launchLive&acc=7831770&channel=LCH345"];
[dialClient getApplicationData:@"Netflix" atServer:last completionHandler:^(NSDictionary * _Nullable data, NSError * _Nullable connectionError) {
NSLog(@"Netflix data received:\n%@", data);
}];
}
}
@end
// ViewController.h
#import <UIKit/UIKit.h>
#import <CocoaDialClient.h>
@interface ViewController : UIViewController<CocoaDialClientDelegate>
- (void)dialServerListUpdated:(NSArray *)servers;
@end
CocoaDialClient is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'CocoaDialClient'
Lucas Caldoncelli Rodrigues, [email protected]
CocoaDialClient is available under the MIT license. See the LICENSE file for more info.