You push code (or compiled code) to Objective-Cloud. This can be done by using git (for example via GitHub) or by uploading it manually to our servers. We then make your app logic available via RESTful web services which you can access via HTTP. You can also define blocks of code that are not exposed to the public but which are triggered automatically. Once code is pushed to Objective-Cloud, we scale it automatically according to your needs. We do provide an SDK which includes an Xcode template that you can use to get started; however, you don't have to use the SDK at all. Of course you can test your app locally before pushing it to Objective-Cloud.
Apple's frameworks are very powerful. With Objective-Cloud you can use these frameworks (for example Core Image, Core Location, Core Audio, Core Video, Core Data, AV Foundation and PDK Kit) to develop useful webservices in the blink of an eye. Here are some ideas:
// The response dictionary will be used to generate the HTTP response. // This method downloads the PDF document and performs a text search // by using the search token. The response dictionary contains the numbers of // the pages that contain the search token. Each value in the dictionary // is the corresponding result count. + (NSDictionary *)searchResultOfPDFDocumentAtURL:(NSString *)documentURLStringValue searchToken:(NSString *)searchToken { NSURL *documentURL = [NSURL URLWithString:documentURLStringValue]; PDFDocument *document = [[PDFDocument alloc] initWithURL:documentURL]; NSArray *selections = [document findString:searchToken withOptions:NSCaseInsensitiveSearch]; NSMutableDictionary *response = [NSMutableDictionary dictionary]; for(PDFSelection *selection in selections) { PDFPage *page = selection.pages[0]; // get the first Page NSNumber *matchCount = response[page.label]; if(matchCount == nil) { matchCount = @(1); } else { matchCount = @(matchCount.unsignedIntegerValue + 1); } response[page.label] = matchCount; } return response; }
// The response dictionary will be used to generate the HTTP response. + (NSDictionary *)facesInImageAtURL:(NSString *)imageURLStringValue { NSURL *imageURL = [NSURL URLWithString:imageURLStringValue]; CIImage *image = [CIImage imageWithContentsOfURL:imageURL]; NSDictionary *options = @{ CIDetectorAccuracy : CIDetectorAccuracyLow }; CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:options]; NSArray *faceFeatures = [detector featuresInImage:image options:nil]; NSMutableArray *detectedFaces = [NSMutableArray array]; for(CIFeature *faceFeature in faceFeatures) { [detectedFaces addObject:[faceFeature dictionaryRepresentation_obc]]; } NSMutableDictionary *response = [NSMutableDictionary dictionary]; response[@"detectedFaces"] = detectedFaces; return response; }
// The returned string will be used to generate the HTTP response. + (NSString *)nameOfLocationAtLatitude:(NSNumber *)latitude longitude:(NSNumber *)longitude { CLLocationDegrees latitudeValue = [latitude doubleValue]; CLLocationDegrees longitudeValue = [longitude doubleValue]; CLLocation *location = [[CLLocation alloc] initWithLatitude:latitudeValue longitude:longitudeValue]; CLGeocoder *reverseGeocoder = [[CLGeocoder alloc] init]; __block NSString *nameOfLocation = nil; dispatch_semaphore_t holdOn = dispatch_semaphore_create(0); [reverseGeocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) { CLPlacemark *placemark = [placemarks lastObject]; if(placemark) { nameOfLocation = placemark.name; } dispatch_semaphore_signal(holdOn); }]; dispatch_semaphore_wait(holdOn, DISPATCH_TIME_FOREVER); return nameOfLocation; }