Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New FBConnect Enabled ShareKit #238

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Classes/Example/ShareKitAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import "ShareKitAppDelegate.h"
#import "RootViewController.h"

#import "SHKFacebook.h"
#import "SHKReadItLater.h"
#import "SHKFacebook.h"

Expand Down Expand Up @@ -45,6 +46,35 @@ - (void)applicationWillTerminate:(UIApplication *)application
// Save data if appropriate
}

- (BOOL)handleOpenURL:(NSURL*)url
{
NSDictionary *info = [[NSBundle mainBundle] infoDictionary];
NSNumber *index = [info objectForKey:@"FacebookURLTypeIndex"];
if (! index) return YES;

NSArray *urlTypes = [info objectForKey:@"CFBundleURLTypes"];
if ((! urlTypes) || ([urlTypes count] <= [index integerValue])) return YES;

NSDictionary *facebookURL = [urlTypes objectAtIndex:[index integerValue]];
NSString *scheme = [[facebookURL objectForKey:@"CFBundleURLSchemes"] lastObject];
if ([[url scheme] isEqualToString:scheme])
return [SHKFacebook handleOpenURL:url];
return YES;
}

- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation
{
return [self handleOpenURL:url];
}

- (BOOL)application:(UIApplication *)application
handleOpenURL:(NSURL *)url
{
return [self handleOpenURL:url];
}

#pragma mark -
#pragma mark Memory management
Expand Down
10 changes: 10 additions & 0 deletions Classes/ShareKit/Core/SHKItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ + (SHKItem *)itemFromDictionary:(NSDictionary *)dictionary
item.text = [dictionary objectForKey:@"text"];
item.tags = [dictionary objectForKey:@"tags"];

NSData *imageData = [dictionary objectForKey:@"image"];
if (imageData) {
item.image = [UIImage imageWithData:imageData];
}

if ([dictionary objectForKey:@"custom"] != nil)
item.custom = [[[dictionary objectForKey:@"custom"] mutableCopy] autorelease];

Expand Down Expand Up @@ -177,6 +182,11 @@ - (NSDictionary *)dictionaryRepresentation
if (tags != nil)
[dictionary setObject:tags forKey:@"tags"];

if (image != nil)
{
NSData *imageData = UIImagePNGRepresentation(image);
[dictionary setObject:imageData forKey:@"image"];
}
// If you add anymore, make sure to add a method for retrieving them to the itemWithDictionary function too

return dictionary;
Expand Down
21 changes: 17 additions & 4 deletions Classes/ShareKit/SHKConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@
#define SHKDeliciousSecretKey @""

// Facebook - http://www.facebook.com/developers
// If SHKFacebookUseSessionProxy is enabled then SHKFacebookSecret is ignored and should be left blank

// SHKFacebookAppID is the Application ID provided by Facebook
// SHKFacebookLocalAppID is used if you need to differentiate between several iOS apps running against a single Facebook app. Leave it blank unless you are sure of what you are doing.
// The CFBundleURLSchemes in your App-Info.plist should be "fb" + the concatenation of these two IDs.
// Example:
// SHKFacebookAppID = 555
// SHKFacebookLocalAppID = funk
//
// Your CFBundleURLSchemes entry: fb555funk
#define SHKFacebookUseSessionProxy NO
#define SHKFacebookKey @""
#define SHKFacebookSecret @""
#define SHKFacebookAppID @""
//#define SHKFacebookLocalAppID @""
#define SHKFacebookSessionProxyURL @""

// Read It Later - http://readitlaterlist.com/api/?shk
Expand Down Expand Up @@ -79,6 +85,13 @@
#define SHKBitLyLogin @""
#define SHKBitLyKey @""


// Evernote
#define SHKEvernoteUserStoreURL @""
#define SHKEvernoteConsumerKey @""
#define SHKEvernoteSecretKey @""
#define SHKEvernoteNetStoreURLBase @""

// ShareMenu Ordering
#define SHKShareMenuAlphabeticalOrder 1 // Setting this to 1 will show list in Alphabetical Order, setting to 0 will follow the order in SHKShares.plist

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 9 additions & 9 deletions Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/*
* Copyright 2009 Facebook
* Copyright 2010 Facebook
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0

* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
*/


#import "FBSession.h"
#import "FBRequest.h"
#import "FBLoginButton.h"
#import "FBLoginDialog.h"
#import "FBPermissionDialog.h"
#import "FBStreamDialog.h"
#include "Facebook.h"
#include "FBDialog.h"
#include "FBLoginDialog.h"
#include "FBRequest.h"
#include "SBJSON.h"
218 changes: 0 additions & 218 deletions Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnectGlobal.h

This file was deleted.

Loading