Website Logo.

Bensge's Blog

Programming, iOS, Jailbreaking, the Web.

Auki APIs

Basic API

Auki has had a very basic API for 3rd party developers since 1.0. +[KJUARR doUrThing:<BBBulletin *>] can be used to activate auki with a BBBulletin (the message notification), or nil to present auki in compose mode. After serval developers requested additional, more extensive APIs, I decided to add a few useful APIs in version 1.3 which was released just this week on Cydia. The old API still works like it did in earlier versions, if you only need the basic API it’s totally fine to keep using it.

New APIs

Now to the actual new APIs:

1
+[KJUARR doUrThing:<BBBulletin *> withImages:<NSArray *>]

takes an array of UIImage objects which will get added to auki’s text input immediately.

1
+[KJUARR doUrThing:<BBBulletin *> withImages:<NSArray *> recipients:<NSArray *>]

also takes an array of images, but supports an additional array of recipient address strings (NSSString objects). These addresses can be phone numbers or emails, specifically. It is safe to pass nil or empty arrays as parameters for both arguments. Keep in mind that recipients are only supported in compose mode, hence the first argument, the BBBulletin notification must be nil.

Header file

For the ease of use, below is a header ready to be imported in your projects:

1
2
3
4
5
6
@interface KJUARR : NSObject
+(BOOL)doUrThing:(BBBulletin *)bulletin;
+(BOOL)doUrThing:(BBBulletin *)bulletin withImages:(NSArray *)images;
+(BOOL)doUrThing:(BBBulletin *)bulletin withRecipients:(NSArray *)recipients;
+(BOOL)doUrThing:(BBBulletin *)bulletin withImages:(NSArray *)images recipients:(NSArray *)recipients;
@end

Usage Examples

If your tweak allows the user to share a photo, why not allow sharing via auki? You can even append multiple images if you want.

1
2
UIImage *image = //Get your image
[objc_getClass("KJUARR") doUrThing:nil withImages:@[image]];

If your are developing some sort of a contact chooser UI, presenting auki ready to send that contact (or a group) a message is really easy as well.

1
2
3
NSString *firstContactEmail = @"[email protected]";
NSString *secondContactNumber = @"0123456789";
[objc_getClass("KJUARR") doUrThing:nil withImages:nil recipients:@[firstContactEmail,secondContactNumber]];

Conclusion

I hope everybody is happy with the new APIs and some developers can take advantage of them. If there is demand for additional APIs or bug reports, be sure to hit me up on Twitter or per email. Cya!