This repository has been archived by the owner on Jun 5, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b319881
Showing
35 changed files
with
2,155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.idea | ||
build | ||
include | ||
*.a | ||
simple-share.xcodeproj/project.xcworkspace | ||
simple-share.xcodeproj/xcuserdata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[submodule "submodules/JSONKit"] | ||
path = submodules/JSONKit | ||
url = https://github.com/johnezang/JSONKit.git | ||
[submodule "submodules/facebook-ios-sdk"] | ||
path = submodules/facebook-ios-sdk | ||
url = https://github.com/facebook/facebook-ios-sdk.git | ||
[submodule "submodules/SVProgressHUD"] | ||
path = submodules/SVProgressHUD | ||
url = https://github.com/samvermette/SVProgressHUD.git | ||
[submodule "submodules/sskeychain"] | ||
path = submodules/sskeychain | ||
url = https://github.com/samsoffes/sskeychain.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
# Automatic build script for simple-share | ||
# for iOS and iOSSimulator | ||
# | ||
# Created by Felix Schulze on 01.06.12. | ||
# Copyright 2012 Felix Schulze. All rights reserved. | ||
########################################################################### | ||
# | ||
SDKVERSION="5.1" | ||
# | ||
########################################################################### | ||
# | ||
# Don't change anything here | ||
DEVICESDK="iphoneos${SDKVERSION}" | ||
SIMSDK="iphonesimulator${SDKVERSION}" | ||
|
||
echo "Building simple-share for iPhoneSimulator and iPhoneOS ${SDKVERSION}" | ||
# Clean the targets | ||
if ! xcodebuild -project "simple-share.xcodeproj" -target simple-share -configuration "Release" -sdk "$DEVICESDK" clean ; then | ||
exit 1 | ||
fi | ||
if ! xcodebuild -project "simple-share.xcodeproj" -target simple-share -configuration "Release" -sdk "$SIMSDK" clean ; then | ||
exit 1 | ||
fi | ||
|
||
# Build the targets | ||
if ! xcodebuild -project "simple-share.xcodeproj" -target simple-share -configuration "Release" -sdk "$DEVICESDK" -arch "armv6 armv7" build ; then | ||
exit 1 | ||
fi | ||
if ! xcodebuild -project "simple-share.xcodeproj" -target simple-share -configuration "Release" -sdk "$SIMSDK" build ; then | ||
exit 1 | ||
fi | ||
|
||
echo "Build library..." | ||
lipo "build/Release-iphoneos/libsimple-share.a" "build/Release-iphonesimulator/libsimple-share.a" -create -output "libsimple-share.a" | ||
cp -R build/Release-iphoneos/include . | ||
echo "Building done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// AppDelegate.h | ||
// simple-share-demo | ||
// | ||
// Created by on 30.05.12. | ||
// Copyright 2012 Felix Schulze. All rights reserved. | ||
// | ||
// 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 <UIKit/UIKit.h> | ||
|
||
@class ViewController; | ||
@class SimpleFacebookShare; | ||
|
||
@interface AppDelegate : UIResponder <UIApplicationDelegate> | ||
|
||
@property (strong, nonatomic) UIWindow *window; | ||
|
||
@property (strong, nonatomic) ViewController *viewController; | ||
@property (nonatomic, strong) SimpleFacebookShare *simpleFacebookShare; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// | ||
// AppDelegate.m | ||
// simple-share-demo | ||
// | ||
// Created by on 30.05.12. | ||
// Copyright 2012 Felix Schulze. All rights reserved. | ||
// | ||
// 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 "AppDelegate.h" | ||
|
||
#import "ViewController.h" | ||
#import "SimpleFacebookShare.h" | ||
#import "SimpleFacebookConfiguration.h" | ||
|
||
@implementation AppDelegate | ||
|
||
@synthesize window = _window; | ||
@synthesize viewController = _viewController; | ||
@synthesize simpleFacebookShare; | ||
|
||
|
||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | ||
{ | ||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | ||
|
||
SimpleFacebookConfiguration *facebookConfiguration = [[SimpleFacebookConfiguration alloc] init]; | ||
facebookConfiguration.appId = @"theAppId"; | ||
facebookConfiguration.appName = @"theAppName"; | ||
facebookConfiguration.appUrl = @"theAppUrl"; | ||
|
||
self.simpleFacebookShare = [[SimpleFacebookShare alloc] initWithSimpleFacebookConfiguration:facebookConfiguration]; | ||
|
||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { | ||
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil simpleFacebookShare:simpleFacebookShare]; | ||
} else { | ||
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil simpleFacebookShare:simpleFacebookShare]; | ||
} | ||
self.window.rootViewController = self.viewController; | ||
[self.window makeKeyAndVisible]; | ||
|
||
|
||
return YES; | ||
} | ||
|
||
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { | ||
return [simpleFacebookShare handleOpenURL:url]; | ||
} | ||
|
||
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { | ||
return [simpleFacebookShare handleOpenURL:url]; | ||
} | ||
|
||
- (void)applicationWillResignActive:(UIApplication *)application | ||
{ | ||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. | ||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. | ||
} | ||
|
||
- (void)applicationDidEnterBackground:(UIApplication *)application | ||
{ | ||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. | ||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. | ||
} | ||
|
||
- (void)applicationWillEnterForeground:(UIApplication *)application | ||
{ | ||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. | ||
} | ||
|
||
- (void)applicationDidBecomeActive:(UIApplication *)application | ||
{ | ||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. | ||
} | ||
|
||
- (void)applicationWillTerminate:(UIApplication *)application | ||
{ | ||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// ViewController.h | ||
// simple-share-demo | ||
// | ||
// Created by on 30.05.12. | ||
// Copyright 2012 Felix Schulze. All rights reserved. | ||
// | ||
// 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 <UIKit/UIKit.h> | ||
|
||
@class SimpleFacebookShare; | ||
|
||
@interface ViewController : UIViewController | ||
|
||
- (id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil simpleFacebookShare:(SimpleFacebookShare *)theSimpleFacebookShare; | ||
|
||
- (IBAction)postButtonPressed:(id)sender; | ||
- (IBAction)twitterButtonPressed:(id)sender; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// | ||
// ViewController.m | ||
// simple-share-demo | ||
// | ||
// Created by on 30.05.12. | ||
// Copyright 2012 Felix Schulze. All rights reserved. | ||
// | ||
// 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 "ViewController.h" | ||
#import "SimpleFacebookShare.h" | ||
#import "SimpleTwitterShare.h" | ||
|
||
@interface ViewController () | ||
|
||
@end | ||
|
||
@implementation ViewController { | ||
SimpleFacebookShare *facebookShare; | ||
} | ||
|
||
- (id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil simpleFacebookShare:(SimpleFacebookShare *)theSimpleFacebookShare { | ||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; | ||
if (self) { | ||
facebookShare = theSimpleFacebookShare; | ||
} | ||
return self; | ||
} | ||
|
||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation | ||
{ | ||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { | ||
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); | ||
} else { | ||
return YES; | ||
} | ||
} | ||
|
||
- (IBAction)postButtonPressed:(id)sender { | ||
[facebookShare shareUrl:[NSURL URLWithString:@"http://www.felixschulze.de"]]; | ||
} | ||
|
||
- (IBAction)twitterButtonPressed:(id)sender { | ||
SimpleTwitterShare *simpleTwitterShare = [[SimpleTwitterShare alloc] init]; | ||
if ([simpleTwitterShare canSendTweet]) { | ||
[simpleTwitterShare shareText:@"Some text to share"]; | ||
} | ||
else { | ||
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Not supported" message:@"Twitter is not supported" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; | ||
[alertView show]; | ||
} | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/* Localized versions of Info.plist keys */ | ||
|
Oops, something went wrong.