Skip to content

AquaSupport/AQSPocketActivity

Repository files navigation

AQSPocketActivity

[iOS] UIActivity class for Pocket

Build Status

Usage

UIActivity *pocketActivity = [[AQSPocketActivity alloc] init];

UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:pocketActivity];

[self presentViewController:activityViewController animated:YES completion:NULL];

Accepted activityItems Types

  • NSURL (Accepts multiple)

Can perform activity when

  • When Pocket iOS App is installed.
  • At least one NSURL is provided.

Setup

AQSPocketActivity requires 3-min setup.

  1. Regist Pocket App http://getpocket.com/api/signup with "Add" capability and obtain a consumer key. (consumerKey)
  2. Setup URL Scheme for receiving callback from Pocket iOS App.
  3. Setup URL Scheme like pocketapp42 where 42 is your consumerKey's first part. (For consumer key 12345-abcdefghijklmn, the number is 12345)
  4. Set the URL Identifier for the URL Scheme com.getpocket.sdk.
  5. On your - application:didFinishLaunchingWithOptions:, call [AQSPocketActivity setupPocketWithConsumerKey:consumerKey]
  6. On your - application:handleOpenURL:, call [AQSPocketActivity handleOpenURL:url]

Combining them, AppDelegate will be like as follow.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [AQSPocketActivity setupPocketWithConsumerKey:@"12345-abcdefghijklmn"];
    
    return YES;
}

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    if ([AQSPocketActivity handleOpenURL:url] == YES) {
        return YES;
    }
    
    // Put your code for handling passed URL.
    return NO;
}

Installation

pod "AQSPocketActivity"

Link to Documents

https://dl.dropboxusercontent.com/u/7817937/___doc___AQSPocketActivity/html/index.html

Related Projects

References