I currently try to get the aviary sdk to run in combination with a cordova app under iOS.
After installing cordova (3.6.3-0.2.13) and the latest Aviary SDK (4.3.0) and the aviary plugin from https://github.com/m1is/AviaryCordovaPlugin I managed to get a simple example app to work with android.
When I try to build the exact same app for iOS with xcode(6.0.1) and i try to call the cordova.plugins.Aviary.show
method, I get the following error in the xcode console:
WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: You must provide your Aviary API key before creating an instance of the AFPhotoEditorController. Please see the Aviary SDK documentation for details.
I understand from reading the SDK documentation for iOS that aviary changed the apikey/secret setup to require it to put it in the code:
The API key and secret must be provided before instantiating an instance of AFPhotoEditorController.
and here my problem arises: I do not have any idea on how to submit the apikey/secret to the SDK, all tries changing or adding stuff to the Aviary.m
file were unsuccessful (probably since I have no knowledge of ObjectiveC.
So I wonder if anybody had the same problem and is able to point me to the right direction on how to setup the apikey and secret so my cordova app would run under iOS.
It looks like the plugin maintainer was focused on android and the iOS version is unfortunately not on the same standard. If you still have this issue you can solve it by manually editing the plugin's iOS code. Just locate the line self.aviary = [[AFPhotoEditorController alloc] initWithImage:image];
in Aviary.m and add the following few lines above it:
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[AFPhotoEditorController setAPIKey:@"YourAviaryAPIKey" secret:@"YourAviarySecret"];
});