cymera

Developer

cymera API

Use our API whenever you need to use Cymera to take and edit photos fast and easy Now you can connect and use Cymera's features from external apps on each OS.

For iOS (Ver. 1.4.0 or higher), use the Custom URL Scheme on Cymera to call out and use Cymera's Editing functions.
We are expecting to add the Custom URL Scheme soon.

Passing an image to Cymera

<URL>

cymera://edit

cymera://edit?return=0

* Select 1 from above

<PasteBoard Name>

com.cyworld.cymera

<PasteBoard Type>

com.cyworld.cymera.photo

<Sample Code>

Sample Code
Passing the image to Cymera
UIImage *copyImage = YOUR_IMAGE;
NSData *imageData = UIImageJPEGRepresentation(copyImage, 1.0f);
        
UIPasteboard *cymeraPasteBoard;
cymeraPasteBoard = [UIPasteboard pasteboardWithName:@"com.cyworld.cymera"
                                                    create:YES];
[cymeraPasteBoard setPersistent:YES];
[cymeraPasteBoard setData:imageData
        forPasteboardType:@"com.cyworld.cymera.photo"];
        
NSURL *cymeraURL = [NSURL URLWithString:@"cymera://edit?return=0"];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
    [[UIApplication sharedApplication] openURL:url];
}

If you want to get the edited photo back after delivering and editing it on Cymera, follow this:

<URL>

cymera://edit?return=1&scheme=RETURN_URL_SCHEME

<PasteBoard Name>

com.cyworld.cymera

<PasteBoard Type>

com.cyworld.cymera.photo

<Sample Code>

Sample Code
(1) Passing an image to Cymera
UIImage *copyImage = YOUR_IMAGE;
NSData *imageData = UIImageJPEGRepresentation(copyImage, 1.0f);
        
UIPasteboard *cymeraPasteBoard;
cymeraPasteBoard = [UIPasteboard pasteboardWithName:@"com.cyworld.cymera"
                                             create:YES];
[cymeraPasteBoard setPersistent:YES];
[cymeraPasteBoard setData:imageData
        forPasteboardType:@"com.cyworld.cymera.photo"];
        
NSURL *cymeraURL = [NSURL URLWithString:@"cymera://edit?return=1&scheme=cymeraapp://"];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
    [[UIApplication sharedApplication] openURL:url];
}

(2) Getting the result image
 -(BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation
{
    if ([[url scheme] isEqualToString:@"cymeraapp"]) {
        UIPasteboard *cymeraPasteBoard;
        cymeraPasteBoard = [UIPasteboard pasteboardWithName:@"com.cyworld.cymera"
                           create:YES];
        NSData *imageData;
        imageData = [cymeraPasteBoard dataForPasteboardType:@"com.cyworld.cymera.photo"];
        if (nil != imageData) {
            UIImage *image = [UIImage imageWithData:imageData];
            
            // Sending output image to requested location
            
            return YES;
        }
    }
    
    return NO;
}

Questions about the API? : help@cymera.com