mirror of
https://github.com/samsonjs/samhuri.net-ios.git
synced 2026-04-27 15:07:44 +00:00
enable publishing to production from the share extension
This commit is contained in:
parent
171a262a6e
commit
4322e4b247
1 changed files with 2 additions and 2 deletions
|
|
@ -41,13 +41,13 @@
|
||||||
NSLog(@"title = %@", title);
|
NSLog(@"title = %@", title);
|
||||||
NSLog(@"body = %@", body);
|
NSLog(@"body = %@", body);
|
||||||
NSItemProvider *urlProvider = [self firstURLProvider];
|
NSItemProvider *urlProvider = [self firstURLProvider];
|
||||||
BOOL reallyPost = NO;
|
BOOL reallyPost = YES;
|
||||||
[urlProvider loadItemForTypeIdentifier:@"public.url" options:nil completionHandler:^(NSURL *url, NSError *error) {
|
[urlProvider loadItemForTypeIdentifier:@"public.url" options:nil completionHandler:^(NSURL *url, NSError *error) {
|
||||||
// TODO: image
|
// TODO: image
|
||||||
NSLog(@"url = %@", url);
|
NSLog(@"url = %@", url);
|
||||||
if (reallyPost) {
|
if (reallyPost) {
|
||||||
Post *post = [Post newDraftWithTitle:title body:body url:url];
|
Post *post = [Post newDraftWithTitle:title body:body url:url];
|
||||||
[blogController requestCreateDraft:post publishImmediatelyToEnvironment:@"staging" waitForCompilation:NO].catch(^(NSError *error) {
|
[blogController requestCreateDraft:post publishImmediatelyToEnvironment:@"production" waitForCompilation:NO].catch(^(NSError *error) {
|
||||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Error" message:error.localizedDescription preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Error" message:error.localizedDescription preferredStyle:UIAlertControllerStyleAlert];
|
||||||
[alert addAction:[UIAlertAction actionWithTitle:@"Dismiss" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
[alert addAction:[UIAlertAction actionWithTitle:@"Dismiss" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
|
||||||
[self dismissViewControllerAnimated:YES completion:nil];
|
[self dismissViewControllerAnimated:YES completion:nil];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue