This file contains hidden or 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
| // invoke the call | |
| [socialize authenticateWithApiKey:@"YourApiKey" apiSecret:@"YourApiSecret"]; | |
| #pragma mark SocializeServiceDelegate implementation | |
| // implement the delegate | |
| -(void)didAuthenticate{ | |
| NSLog(@"Authenticated"); | |
| } | |
| // if the authentication fails the following method is called |
This file contains hidden or 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
| //import the socialize header | |
| #import <Socialize/Socialize.h> | |
| @interface Controller : UIViewController | |
| @property (nonatomic, retain) SocializeActionBar *actionBar; | |
| @end |
This file contains hidden or 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
| - (void)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| self.actionBar = [SocializeActionBar actionBarWithKey:@"http://www.example.com/object/1234" presentModalInController:self]; | |
| self.actionBar.noAutoLayout = YES; | |
| self.actionBar.view.frame = CGRectMake(0, 400, 320, SOCIALIZE_ACTION_PANE_HEIGHT) | |
| [self.view addSubview:self.actionBar.view]; | |
| } |
This file contains hidden or 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
| //import the socialize header | |
| #import <Socialize/Socialize.h> | |
| @interface Controller : UIViewController <SocializeActionBarDelegate> | |
| @property (nonatomic, retain) SocializeActionBar *actionBar; | |
| @end |
This file contains hidden or 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
| #import <Socialize/Socialize.h> | |
| - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { | |
| return [Socialize handleOpenURL:url]; | |
| } |
This file contains hidden or 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
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| // ... | |
| [Socialize setCanLoadEntityBlock:^BOOL(id<SocializeEntity> entity) { | |
| return ![entity.name isEqualToString:@"DeletedEntity"]; | |
| }]; | |
| } |
This file contains hidden or 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
| - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { | |
| // Don't handle notifications when in the foreground | |
| if (application.applicationState != UIApplicationStateActive) { | |
| return; | |
| } | |
| // Give Socialize a chance to handle this notification if it needs to | |
| if ([Socialize handleNotification:userInfo]) { | |
| return; |
This file contains hidden or 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
| //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 storeConsumerKey:@"SOCIALIZE_CONSUMER_KEY"]; | |
| [Socialize storeConsumerSecret:@"SOCIALIZE_CONSUMER_SECRET"]; | |
| //your application specific code |
This file contains hidden or 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
| SocializeEntity *entity = [[[SocializeEntity alloc] init] autorelease]; | |
| entity.key = @"myKey"; | |
| entity.name = @"My Name"; | |
| entity.meta = @"some meta data about this entity"; | |
| [socialize createEntity:entity]; | |
| -(void)service:(SocializeService*)service didFail:(NSError*)error{ | |
| NSLog(@"%@", error); | |
| } |
This file contains hidden or 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
| #if !DEBUG && !TARGET_IPHONE_SIMULATOR | |
| [Socialize registerDeviceToken:deviceToken]; | |
| #endif |