Skip to content

Instantly share code, notes, and snippets.

View imosquera's full-sized avatar

Isaac Mosquera imosquera

View GitHub Profile
@imosquera
imosquera / CommentUI.m
Created September 15, 2011 04:08 — forked from FawadHa1der/CommentUI.m
SocializeSDK iOS Code Snippets part 2
//create a URL for your entity. This must be a unique URL but can return a 404
NSString *entityUrlString = @"http://www.example.com/object/1234";
// Allocate memory for the instance
SocializeCommentsTableViewController* commentsController = [[[SocializeCommentsTableViewController alloc] initWithNibName:@"SocializeCommentsTableViewController" bundle:nil entryUrlString:entityUrlString] autorelease];
[self.navigationController pushViewController:commentsController animated:YES];
@imosquera
imosquera / Authentication.m
Created October 6, 2011 00:09 — forked from SPopenko/Authentication.m
SocializeSDK iOS Code Snippets
// invoke the call
[socialize authenticateWithApiKey:@"YourApiKey" apiSecret:@"YourApiSecret"];
#pragma mark SocializeServiceDelegate implementation
// implement the delegate
-(void)didAuthenticate:(id<SocializeUser>)user {
NSLog(@"Authenticated");
}
// if the authentication fails the following method is called
@imosquera
imosquera / CommentUI.m
Created October 6, 2011 00:35 — forked from SPopenko/CommentUI.m
SocializeSDK iOS Code Snippets part 2
- (IBAction)commentsButtonPressed {
NSString *entityUrlString = @"http://www.example.com/object/1234";
SocializeCommentsTableViewController* commentsController =
[[[SocializeCommentsTableViewController alloc] initWithNibName:@"SocializeCommentsTableViewController"
bundle:nil
entryUrlString:entityUrlString] autorelease];
[self.navigationController pushViewController:commentsController animated:YES];
}
@imosquera
imosquera / GetEntity.m
Created October 6, 2011 00:55 — forked from SPopenko/CommentUI.m
SocializeSDK iOS Code Snippets part 2
[socialize getEntityByKey:@"www.techcrunch.com"];
#pragma mark SocializeServiceDelegate
//if the entity does not exist
-(void)service:(SocializeService*)service didFail:(NSError*)error{
}
@imosquera
imosquera / appDelegate.m
Created October 9, 2011 20:50
ios socialize sample snippets
//import the socialize header
#import <Socialize/Socialize.h>
#pragma mark
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// set the socialize api key and secret, register your app here: http://www.getsocialize.com/apps/
[Socialize storeSocializeApiKey:@"SOCIALIZE CONSUMER KEY"
andSecret:@"SOCIALIZE CONSUMER SECRET"];
//your application specific code
}
//import the socialize header
#import <Socialize/Socialize.h>
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *entityUrl = @"http://www.example.com/object/1234"
SocializeActionBar *bar = [[SocializeActionBar createWithParentController:self andUrl:self.entityUrl]];
[self.view addSubview:bar.view];
}
#import <Socialize-iOS/Socialize.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//set the FB App Id, you can find your FB app Id here: https://developers.facebook.com/apps
[Socialize storeFacebookAppId:@"YOUR FB APP ID"];
//your extra code goes here
}
@imosquera
imosquera / gist:1375443
Created November 18, 2011 02:57 — forked from nwg/gist:1294278
#import <Socialize/Socialize.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//set the FB App Id, you can find your FB app Id here: https://developers.facebook.com/apps
[Socialize storeFacebookAppId:@"YOUR FB APP ID"];
//set your app url. You can find your app id from the appstore. Socialize uses this app url to advertise
//your app when sharing to social networks like facebook and twitter
[Socialize storeApplicationLink:@"http://itunes.apple.com/us/app/yourappname/id012345689"];
#import <Socialize/Socialize.h>
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
return [Socialize handleOpenURL:url];
}
@imosquera
imosquera / MyAppDelegate.m
Created January 5, 2012 19:10
smart notifications
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
if ([Socialize handleNotification:userInfo]) {
return;
}
// Nonsocialize notification handling goes here
}