Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 11    Views: 103

awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
02/18/13 02:28 AM (12 years ago)

Custom plugin that will point to a buzztouch plugin

hey guys. how can i create a custom plugin that has a BUTTON that will lead to a buzztouch plugin? I know how to create a custom plugin, create a button, and link it to a method. However I don't know how to create a method that will point the button into a buzztouch Menu or any other buzztouch plugin.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/18/13 02:32 AM (12 years ago)
I'm not by a mac, have you bought any of my plugins, on the off chance. The countdown and the voucher plugin have the code in for a simple one button move to next screen method. Just copy and paste it. Then change the screenNickname string to whatever screen you want or change the json value for your control panel.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/18/13 03:39 AM (12 years ago)
I cheated with mine; I just use the right nav bar button to go to the next screen. Cheers! -- Smug
 
Suvinay pawa
buzztouch Evangelist
Profile
Posts: 599
Reg: Aug 01, 2012
location unknow...
9,890
like
02/18/13 04:04 AM (12 years ago)
Was anybody successful in adding a search option in android
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/18/13 04:16 AM (12 years ago)
@smug that's how I beta test when I'm drafting the custom plugin. But it's bad design practice, if you're going to build a plugin your best learning the code, especially the great stuff given to us by buzztouch. When I get to my mac I will post the code. @SuVinay Pawa What has this got to do with this question? Your best posting that as your own post, good chance the people designing such plugin won't see this as it will be bumped quickly down the list.
 
Suvinay pawa
buzztouch Evangelist
Profile
Posts: 599
Reg: Aug 01, 2012
location unknow...
9,890
like
02/18/13 04:19 AM (12 years ago)
Nothing..everybody talking plugins around here so I thought..might be any of you did it..
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
02/18/13 05:07 AM (12 years ago)
is this it? //load the next screen [BT_viewControllerManager handleTapToLoadScreen:[self screenData]:tmpMenuItem:screenObjectToLoad]; [tmpMenuItem release];
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/18/13 05:11 AM (12 years ago)
Modify this, all the json stuff is what is controlled by the control panel. You can replace this with a string or your own json values -(void)startButton{ [BT_debugger showIt:self:@"buttonPressed"]; //appDelegate yourApp_appDelegate *appDelegate = (yourApp_appDelegate *)[[UIApplication sharedApplication] delegate]; NSString *hiddenButtonID = [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"secretButtonScreenItemId":@""]; //load new screen BT_item *mynextScreen = [appDelegate.rootApp getScreenDataByItemId:hiddenButtonID]; //check for loadScreenWithItemId THEN loadScreenWithNickname THEN loadScreenObject BT_item *screenObjectToLoad = nil; if([hiddenButtonID length] > 1){ screenObjectToLoad = [appDelegate.rootApp getScreenDataByItemId:hiddenButtonID]; } //load next screen if it's not nil if(screenObjectToLoad != nil){ BT_item *tmpMenuItem = [[BT_item alloc] init]; //build an NSDictionary of values for the jsonVars property NSDictionary *tmpDictionary = [NSDictionary dictionaryWithObjectsAndKeys: @"unused", @"itemId", [screenData.jsonVars objectForKey:@"secretButtonTransitionType"], @"transitionType", nil]; [tmpMenuItem setJsonVars:tmpDictionary]; [tmpMenuItem setItemId:@"0"]; ////leave alone [BT_viewControllerManager handleTapToLoadScreen:[self screenData]:tmpMenuItem:mynextScreen]; [tmpMenuItem release]; } }
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
02/18/13 06:38 AM (12 years ago)
Thanks Kittsy! I'll try this out and let you guys know. I'll look into your plugins too. I have been looking for app features that are very similar to your plugins! Like for example, I am looking for a local notification feature for my apps where I can set it to send push notif locally. However, I want to set it in xcode and not in the app itself. so basically when the user installs, after one day it will send a push notif just to remind the user to use the app again. Something like that? I think it's possible using your countdown plugin? anyway, thanks again for the help kittsy. I'll try this out tonight :)
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/18/13 08:42 AM (12 years ago)
You can also simplify the code quite a bit. Really you only need the following: BT_item *mynextScreen = [appDelegate.rootApp getScreenDataByItemId:@"someID"]; [BT_viewControllerManager handleTapToLoadScreen:[self screenData]:mynextScreen:mynextScreen];
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/18/13 09:45 AM (12 years ago)
I'm guessing this guy would like to use his code for more than one screen, and have the ability to change the transition instead of the default swipe from the left/right. And see how he could connect it to the control panel using the json. Adding that basic code would also still cause errors I think due to the appDelegate not being defined.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
02/18/13 09:48 AM (12 years ago)
Perhaps - and if so, your code snippet will do the job perfectly. I was just trying to boil it down to the minimum necessary components to make it work.
 

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.