Files
Sparkle/TestAppHelper/TestAppHelperProtocol.h
T
Zorg d12121a265 Add SUUpdaterSettings class, allowing to read default settings.
This is convenient if the updater and app live in separate processes.
No need to use XPC to find out what certain settings are, and it may take too long to find out that way.
2016-03-27 18:44:36 -04:00

50 lines
1.8 KiB
Objective-C

//
// TestAppHelperProtocol.h
// TestAppHelper
//
// Created by Mayur Pawashe on 3/2/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
// The protocol that this service will vend as its API. This header file will also need to be visible to the process hosting the service.
@protocol TestAppHelperProtocol
- (void)codeSignApplicationAtPath:(NSString *)applicationPath reply:(void (^)(BOOL))reply;
// Start up Sparkle
- (void)startSparkle;
// Check for updates when the user wants to check for them explicitly
- (void)initiateUserCheckForUpdates;
// Check for updates, only bringing a prompt when an update is available and not skipped
- (void)checkForUpdates;
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecksForUpdates;
- (void)setAutomaticallyDownloadsUpdates:(BOOL)automaticallyDownloadsUpdates;
- (void)setSendsSystemProfile:(BOOL)sendsSystemProfile;
- (void)setUpdateCheckInterval:(NSTimeInterval)updateCheckInterval;
@end
/*
To use the service from an application or other process, use NSXPCConnection to establish a connection to the service by doing something like this:
_connectionToService = [[NSXPCConnection alloc] initWithServiceName:@"org.sparkle-project.TestAppHelper"];
_connectionToService.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(StringModifing)];
[_connectionToService resume];
Once you have a connection to the service, you can use it like this:
[[_connectionToService remoteObjectProxy] upperCaseString:@"hello" withReply:^(NSString *aString) {
// We have received a response. Update our text field, but do it on the main thread.
NSLog(@"Result string was: %@", aString);
}];
And, when you are finished with the service, clean up the connection like this:
[_connectionToService invalidate];
*/