ZutraLife
Code is Art
Profile
Posts: 21
Reg: May 03, 2012
LA
2,910
04/08/13 11:49 AM (12 years ago)

Scringo Custom Commands

iOS, Xcode 4.6 I have successfully integrated Scringo(easy thanks to BT folks!), now trying to "Add and position a custom command in Scringo's sidebar" per Scringo's documentation: Scringo notifies your app when a user selects a custom command, by posting an NSNotification. To receive this notification do as follow: First of all make sure to import Scringo: #import <Scringo/ScringoAgent.h> Ask to be notified by adding this line somewhere in your code: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myCommandClicked:) name:kScringoCustomButtonClicked object:nil]; Now add the following method which will be called when someone selects your custom command : -(void)myCommandClicked:(NSNotification *)aNotification { NSLog(@"User selected my custom command. Command id is =%@", [aNotification userInfo]); // The rest of your code } I would like to know, 1.where do I insert my "ID" for the scringo button so the action links to correct button? 2.what code to load a specific BT screen?...use BT item ID or url schemes? Thanks!
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
04/08/13 11:54 AM (12 years ago)
I have successfully done it. check this post it might help. http://www.buzztouch.com/forum/thread.php?tid=18D19B7E0FC7F5E7EB50AA1
 
ZutraLife
Code is Art
Profile
Posts: 21
Reg: May 03, 2012
LA
2,910
like
04/08/13 01:24 PM (12 years ago)
ok, headed in right direction, after //My or your code, what syntax to IF on the value of the [aNotification userInfo] and do the appropriate action, which is to load a screen via itemID. I want to have multiple buttons on my scringo menu go to different BT screens, so I believe where I differentiate them is in the latter half of below code: -(void)myCommandClicked:(NSNotification *)aNotification { NSLog(@"User selected my custom command. Command id is =%@", [aNotification userInfo]); // Here you can IF on the value of the [aNotification userInfo] and do the appropriate action. }
 
ZutraLife
Code is Art
Profile
Posts: 21
Reg: May 03, 2012
LA
2,910
like
04/09/13 04:39 PM (12 years ago)
any ideas here?? say my unique id is "instagram", i use: if ([[[aNotification userInfo] objectForKey:@"customButtonId"] isEqualToString:@"instagram"]) { then what would I insert in order to load another BT screen, or maybe a url??
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.