Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 54    Views: 184

SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
01/24/13 04:27 PM (9 years ago)

loadScreenObject Obstacles...

My concept should be simple. My explanation however... I have a main menu with several categories. A user selects one. As an example: "Restaurants". A sub menu appears, with cuisine choices... "American, Asian, Indian, Mexican, etcetera...". A selection is made, and another submenu appears, with a list of establishments that meet the criteria (all mexican restaurants, perhaps). A selection is made from there, and a detail page appears, with information about the location, and a map showing the location. I can see this in my head as clear as day. All of this information is being pulled from a MySQL database (for now). At this moment, although I have other scripts prepared, I'm only working on the cascading of the first two menus. *Main* > *Sub* > ...and later 'SubSub' if needed > Detail When I run this on iOS, my first menu comes up fine. My subcategory page which is created by 'loadScreenObject' appears (blank) for a half-second and then my app crashes. When I run this on Android, my first menu comes up fine. My subcategory pages appears fine. But I can never get a different category. If I don't force a refresh, my 'first choice' seems to cache, and will be the only data displayed. Because of the difference in behavior, I'm a little confused on where to look for issues. My JSON data is 'well behaved' or whatever... My Test App is fairly sparse; Right now only a menuscreen that loads the first PHP file for it's dataURL. Everything else 'should' be created dynamically via loadScreenObject. I have created a zip file with pertinent documents that include: 1) My PHP Scripts 2) SQL files with sample DB information 3) iPad Crash Log 4) iOS crash screen shot 5) Got nothing on Android. Sorry. If I've forgotten something pertinent, let me know! Total file size about 700k https://dl.dropbox.com/u/115208762/loadScreenObject.zip I must be missing something elementary, but as I get different reactions on different platforms, and my lack of skills in those platforms, I'm not sure which direction to take my troubleshooting process. Any ideas or guidance would be appreciated. Cheers! -- Smug
 
Niraj Shah
buzztouch Evangelist
Profile
Posts: 2942
Reg: Jul 11, 2012
Cerritos
37,920
Fourm StarFourm Star
like
01/24/13 10:53 PM (9 years ago)
Gosh, I must not be paying attention! Where is loadScreenObject available? In the PHP, Control Panel or in the iOS code?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
Fourm StarFourm StarFourm Star
like
01/25/13 12:32 AM (9 years ago)
@Smug: "I can see this in my head as clear as day" Love this...make it much easier when you know what you're trying to do! I've downloaded your files and will try to get a look at this in the next day or two. Not sure when this is and hope you make some progress before then? @Niraj: Firstly, we should have taken you up on your generous offer last evening to create the iOS Push pdf. The one we put together is ugly and does not include any images like we'de planned. Wanna spice it up? LOL. Regarding the loadScreenObject, Smug's using this exactly as intended (assuming here, didn't see his files yet) and it's a very very flexible way to load screen dynamically without first setting them up in the config.txt file. Think of it this way...a button tap, or row tap, or shake, or whatever causes a screen to load. The screen that loads is oftentimes determined by way of "loadScreenWithItemId" or "loadScreenWithNickname" - from the config.txt file. Easy enough to understand..."hey app, go find the JSON data for the screen with this id then load it's view controller" But, there are cases when you know in advance which screen to create so you config.txt data does not contain it. THis means you can't use loadScreenWithItemId because the screen doesn't exist yet. In come loadScreenObject to the rescue. You can provide this object directly in the JSON itself, or create it dynamically then ask the app to load it. Example...if this is a screen object: {"itemId":"123", "itemType":"yourCoolPlugin", "itemNickname":"my screen" "navBarTitleText":"My screen"} A button may load it with: loadScreenItemId, loadScreenWithNickname OR loadScreenObject...like... {"itemId":"231", "itemType":"BT_button", "itemNickname":"mybutton" "loadScreenItemId":"123"} OR {"itemId":"231", "itemType":"BT_button", "itemNickname":"mybutton" "loadScreenWithNickname":"my screen"} OR {"itemId":"231", "itemType":"BT_button", "itemNickname":"mybutton" "loadScreenObject":{"itemId":"123", "itemType":"yourCoolPlugin", "itemNickname":"my screen" "navBarTitleText":"My screen"}} See how the JSON for the button include the next screen to load? It does not need to exist in the config.txt file. This is especially useful if you're creating the list of button or menu items on a backend by a script. Feed the "list" of buttons to a screen and they can load other screens. Imagine now filtering / creating your lists that load different screens for different users, device, locations, whatever. Hope this helps.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
Fourm StarFourm StarFourm Star
like
01/25/13 12:39 AM (9 years ago)
@Smug: Had :5 minutes :-) I didn't test anything but did see the image of the Output Console showing the crash. The cras is caused by "stringByReplacingOccurancesOfString" method where it's running into a nil value. Not sure why this is or when this happens but it sounded like it happened when you tapped a menu row. Have a look at your menu0 and menu01 php files. It's outputting itemID in the JSON. this is wrong. It should be outputting itemId (see the lower case D). Not sure if that will change anything but it's worth fixing either way. Heck, it could be the entire problem.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
01/25/13 01:15 AM (9 years ago)
David: Thank you so much for looking into this; I really don't like wasting your time; you're the hub from which the spokes extend... However, since you did... ;) Thank you for that correction; it didn't fix the issue, but bad syntax is bad... period. I should mention that I discovered that it doesn't crash when I remove the 'loadScreenObject' line, so I'm hunting on this particular line (and just in case, the lines above it) to ensure proper formatting, regardless of what Jsonlint says... Niraj: loadScreenObject is the bomb (well, if I can get it to work, lol!) Rather than load a million screens by hand, you can either script your PHP/MySql to create your JSON for you, or (by hand or with Stobes tools) you can create huge json text files to include in your project for totally offline use. I have an upcoming project with around 30+ categories, each with 2-8 subcategories, and eventually around 3000 detail pages. This project was made for loadScreenObject. Or loadScreenObject was made for projects like this, depending on your point of view. :) Looking at my files would be a good start seeing it in action, but I wouldn't look 'that' closely until I get this issue resolved, lol! But if nothing else the sample database and scripts are a good snooping point for possibilities. I'll replace the existing files with good samples once I'm done with this. David: Thank you again for your assistance, and this fine product! Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
01/25/13 01:40 AM (9 years ago)
Fixed it! Yep, as suspected, it was me, lol! Without getting into a lot of troubleshooting methodology (meaning, why explain what didn't work)... The short answer is despite how 'pretty' your PHP can look, ensure it's functionality. :) Whereas my php (for my loadScreenObject line) looked like this: $myArray = array( 'itemId' => $recnum, 'itemType' => "WB_screen_menuImage", 'itemNickname' => $name, 'navBarTitleText' => $name, 'includeAds' => '0', 'backgroundColor' => '#EDC9AF', 'imageFileName' => 'http://mydomain.com/rotate.php', 'dataURL' => 'http://mydomain.com/menu01.php?lat=[deviceLatitude]&lng=[deviceLongitude]&parent=' . $name ); It 'MUST' be like this: $myArray = array('itemId' => $recnum,'itemType' => "WB_screen_menuImage",'itemNickname' => $name,'navBarTitleText' => $name,'includeAds' => '0','backgroundColor' => '#EDC9AF','imageFileName' => 'http://mydomain.com/rotate.php','dataURL' => 'http://mydomain.com/menu01.php?lat=[deviceLatitude]&lng=[deviceLongitude]&parent=' . $name); Basically, NO spaces, zilch, nada, between your values. 'Despite the fact that format checkers such as Jsonlint will format it looking the same way... it MATTERS'. Don't be fooled. I was. I wasted days on this. That said, thank you David for giving me a bit more direction; that was the kick I needed! Niraj: give me a few hours to clean up my code and I'll repackage a new zip file with all the pertinent tools to setup a nice little test environment to work with. Cheers! -- Smug
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
01/25/13 02:49 AM (9 years ago)
I need to learn php and mysql that is all lol
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
01/25/13 03:14 AM (9 years ago)
Well, I've pretty much finished cleaning those scripts. I also added a 'baseURL' type variable so all you have to do is put your domain up top, and let the script do it's thing. Of course, after testing when you make it your own, you'll need to edit a few things throughout. Can't say I'm an expert by any stretch; however, if there is something you think I can help with, feel free to ask. If nothing else, I can tell you what NOT to do ;) With few alterations, it's a ready to go 'kit' for testing php/mysql/buzztouch. Same URL as up top; https://dl.dropbox.com/u/115208762/loadScreenObject.zip It includes 2 SQL Tables with ample sample data (categories, points of interest) 2 PHP Scripts (main/secondary menus) and shows how to provide for using 'loadScreenObject' to dynamically create menus and screens on the fly, without having to manually create screens/links and things.... I do hope it helps someone. Cheers! -- Smug
 
Niraj Shah
buzztouch Evangelist
Profile
Posts: 2942
Reg: Jul 11, 2012
Cerritos
37,920
Fourm StarFourm Star
like
01/25/13 03:36 AM (9 years ago)
Sweet -- now I will adapt this to WordPress, for that is my Catalog tool of the decade. Thanks, Smug! @David -- I will create the Push Notifications documentation on Friday! -- Niraj
 
Niraj Shah
buzztouch Evangelist
Profile
Posts: 2942
Reg: Jul 11, 2012
Cerritos
37,920
Fourm StarFourm Star
like
02/27/13 10:38 PM (9 years ago)
@David and @Smug This is the cat's meow, thanks to you both on making us aware of how to load screens via a database. We should talk about loadScreenObject on a future Webinar! -- Niraj
 
Niraj Shah
buzztouch Evangelist
Profile
Posts: 2942
Reg: Jul 11, 2012
Cerritos
37,920
Fourm StarFourm Star
like
05/08/13 11:29 PM (9 years ago)
For those interested in using WordPress as a Catalog In combination with BuzzTouch, it's essential to converse with JSON. This video tutorial by Nick Ray is a thorough tutorial on how to make the Custom Post Types of WordPress output the content in JSON format (instead of HTML format). https://vimeo.com/48773789 -- Niraj
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/06/14 11:17 AM (8 years ago)
Trying to get this to workI am missing something anyone help please ? Want the screen to load when this is called -(void)customFeatureClicked:(NSNotification *)aNotification { NSLog(@"User selected my custom command. Command id is =%@", [aNotification userInfo]); // My or your code NSString *loadScreenItemId = nil; loadScreenItemId = @"142D414BC4D4EBE84013AF1"; } Would this call the screen or am I missing something
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
02/06/14 01:40 PM (8 years ago)
You're missing something ;) Calling the screen requires a few more bits of information than you're providing to it. The code that you'll want to look at and try to understand would be in almost any menu plugin; check out the method called 'didSelectRowAtIndexPath'. This is the handler for when the user taps on a menu selection, and outlines how the plugin takes you to the next screen. Hope this helps! Cheers! -- Smug
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/06/14 02:01 PM (8 years ago)
struggling at the moment lol
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
Fourm StarFourm StarFourm Star
like
02/06/14 03:06 PM (8 years ago)
I'm not sure what you want to do, or how you want to do it, other than calling the screen. This post may provide some insight: https://www.buzztouch.com/forum/thread.php?tid=64A97C87E9AD0EABAAE26EA&fid=BC70C36A743CD4FAD95D17F&sortColumn=FT.id&sortUpDown=&currentPage=66 Cheers! -- Smug
 
LA
Aspiring developer
Profile
Posts: 3271
Reg: Aug 16, 2012
Jerseyville, IL
42,810
Fourm StarFourm StarFourm Star
like
02/06/14 05:51 PM (8 years ago)
Lost!! LA
 
Niraj Shah
buzztouch Evangelist
Profile
Posts: 2942
Reg: Jul 11, 2012
Cerritos
37,920
Fourm StarFourm Star
like
02/06/14 07:41 PM (8 years ago)
Take a look at handleTapToLoadScreen in any plugin. Notice it wants two things: - the current screen info - the next screen info In your customFeatureClicked method, you will want to get those two sets of information and then send it to the handleTapToLoadScreen method. Study some of the plugins on how they do it. For example, study the Menu Buttons plugin. Also, watch the videos from Sept or Oct of 2012 on making a custom plugin. That is how I learned to put up a button and make it take us to another screen. Magic was explained. Have the patience to watch several videos from that timeframe. It takes time and experiments to fully understand and to be comfortable. Don't be afraid to do experiments. Fail often and fail early, for it will lead to success. :-) -- Niraj
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/07/14 10:21 AM (8 years ago)
Niraj Thanks for that. these custom calls are new to me and trying to get to grips with it. I am using scringo custom button which sends signal to APP when clicked. Checked Debug and call coming in and picked up by Notification In the app delegate.m file I have included this [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(customFeatureClicked:) name:kScringoCustomButtonClicked object:nil]; and also this further down -(void)customFeatureClicked:(NSNotification *)aNotification { NSLog(@"User selected my custom command. Command id is =%@", [aNotification userInfo]); // My or your code NSString *loadScreenItemId = nil; loadScreenItemId = @"142D414BC4D4EBE84013AF1"; } I can confirm debit recognises the call and shows the right name for call also, but a bit stuck as to what to do after this. I know that is the screen id I want to open, but looked at loads of places and as much as I try different combinations after this still no luck. Am I going round it in the right way mate ? thanks Alan
 
LA
Aspiring developer
Profile
Posts: 3271
Reg: Aug 16, 2012
Jerseyville, IL
42,810
Fourm StarFourm StarFourm Star
like
02/07/14 11:09 AM (8 years ago)
Thank you for the advice @Niraj Shah! LA
 
Niraj Shah
buzztouch Evangelist
Profile
Posts: 2942
Reg: Jul 11, 2012
Cerritos
37,920
Fourm StarFourm Star
like
02/07/14 07:56 PM (8 years ago)
Take a look at this code, I have verified that a click on the Button will make it load the desired next screen that has a Nickname of "Cool Screen". The corresponding JSON will have several important items: 1. the screen ID of the next screen to display 2. the nickname of the next screen to display 3. the label for the Button to be displayed ---------- THE CODE -------------- //viewDidLoad -(void)viewDidLoad{ [BT_debugger showIt:self theMessage:@"viewDidLoad"]; [super viewDidLoad]; //put code here that adds UI controls to the screen. // Get the button text from the JSON file by specifying three parameters: // 1. This screenData's JSON dataset // 2. The property name to be retrieved from the JSON dataset // 3. The default value to show if the buttonText property was not found in the JSON dataset NSString *myButtonText = [BT_strings getJsonPropertyValue: self.screenData.jsonVars nameOfProperty: @"buttonText" defaultValue: @"Default Label"]; // Show the value of the buttonText property in the console log window [BT_debugger showIt:self theMessage:myButtonText]; // Set the text of the Button [myButton setTitle:myButtonText forState:UIControlStateNormal]; } //view will appear -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [BT_debugger showIt:self theMessage:@"viewWillAppear"]; //flag this as the current screen superbowl_appDelegate *appDelegate = (superbowl_appDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.rootApp.currentScreenData = self.screenData; } // When the Button is tapped, this method gets called -(IBAction)clickMe:(id)sender{ [BT_debugger showIt:self theMessage:@"clickMe - button was tapped"]; // Get the value for the next screen's nickname from the JSON dataset NSString *loadScreenNickname = [BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"loadScreenWithItemNickname" defaultValue:@""]; // Check to see if we got a value for the enxt screen's nickname (it was not empty / nil) if ([loadScreenNickname length] > 0) { [BT_debugger showIt:self theMessage:@"clickMe - Have a next screen to load"]; [BT_debugger showIt:self theMessage:loadScreenNickname]; //Make this screen be the current screen superbowl_appDelegate *appDelegate = (superbowl_appDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.rootApp.currentScreenData = self.screenData; // Create a BT_item to represent the next screen to load BT_item *myNextScreen = [appDelegate.rootApp getScreenDataByNickname:loadScreenNickname]; // Use built-in BT Method to load the screen by calling handleTapToLoadScreen method // - theScreenData = Reference to the next Screen // - theMenuItemData = Not relevant, such as a menu row that is clicked // This method takes two objects. // 1) The BT_item data object holding the info about screen we are going to load / launch. // 2) The BT_item data object for the menu/button that was tapped [self handleTapToLoadScreen:myNextScreen theMenuItemData:nil]; } } -------------- THE JSON DATA ------------------ You will need this JSON to be in the BT_config.txt and pay attention to the comma after the last } character. { "itemId": "ButtonDemo", "itemType": "myCoolPlugin", "itemNickname": "Button Demo", "loadScreenWithItemId": "CoolScreen", "loadScreenWithItemNickname": "Cool Screen", "buttonText": "Go to Cool Screen" }, In the JSON, notice that the "itemType" is the name of the custom screen that is displayed by my XIB file. That means a Custom Plugin is used to process the tap for the Button. In that Custom Plugin, I have put that code. The Custom Plugin consists of: 1. Group folder named NS_myCoolPlugin 2. myCoolPlugin.h 3. myCoolPlugin.m 4. myCoolPlugin.xib 5. myCoolPlugin~iPad.xib -------------------------------- Study this for a bit, try it for a bit, puzzle it over, come back to it and voila! You've got it understood! :-) -- Niraj
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 05:09 AM (8 years ago)
The new core is ever so simple for this method the screen you want opening here is the code This is in for in a plugin if you want a button in a like nirajs long winded efforts above [self loadScreenWithItemId:@"142D414BC4D4EBE84013AF1"]; you want it in the app delegate because its receiving a notification from scringo [[self getViewController] loadScreenWithItemId:@"142D414BC4D4EBE84013AF1"]; so you were ever so close to solving your problem -(void)customFeatureClicked:(NSNotification *)aNotification { NSLog(@"User selected my custom command. Command id is =%@", [aNotification userInfo]); // My or your code [[self getViewController] loadScreenWithItemId:@"142D414BC4D4EBE84013AF1"]; } I was subscribed to this from over a year ago and only come across it when filtering through my 1 billion emails. In future I would post a new topic as you will probably get the correct answer faster. Kittsy
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 06:28 AM (8 years ago)
Kittsy many thanks for that will give it a try at home this evening. I did open a new topic but was getting nowhere there really so tried this forum after I saw it. So I was nearly there.....hmmm really exciting if I can get it to work lol. Will post here any updates. Once again thanks mate Alan
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 09:25 AM (8 years ago)
Kittsy I am happy to say it works, how do I get focus on the screen that just opened. As I am calling it from Sxcringo side bar, now need to make sure scringo closes and focus goes to screen. Any ideas mate ?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 09:26 AM (8 years ago)
mmm is the scringo side bar remaining open and not just popping the new view
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 09:27 AM (8 years ago)
it's been a while since i did the scringo bar but as i remember when an activity is launched from scringo it should automatically dismiss the side bar
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 09:28 AM (8 years ago)
i thought so too, but the code is opening screen I can see this in the side, but side bar remains open....hmmm
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 09:35 AM (8 years ago)
there must be an easier way but try this under this [[self getViewController] loadScreenWithItemId:@"142D414BC4D4EBE84013AF1"]; put this [ScringoAgent closeSidebar]; it's been a while just checked scringos api. this should force the side bar to close good luck
 
Niraj Shah
buzztouch Evangelist
Profile
Posts: 2942
Reg: Jul 11, 2012
Cerritos
37,920
Fourm StarFourm Star
like
02/08/14 09:35 AM (8 years ago)
Tell Scringo to shut that darn door! :-) Something learned, getViewController is the new hotness! Another way to skin that cat When does one use getViewController versus handleTapToLoadScreen ? Most times, hard-coding the ItemId into the code should be avoided. Use the JSON data to specify that information. In particular, use the ScreenNickname.
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 09:41 AM (8 years ago)
Thanks for the advise guys, especially Kittsy The correct code for closing scringo is [Scringo closeSidebar]; Woohoo got the darn thing working as it should. Once again many thanks Alan
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 09:43 AM (8 years ago)
when ever you want it was designed by david to remove the lines and lines of code that you provide before. With the new core if the id don't exist it send it to this plugin isn't found. There is no right or wrong way hard coding an item id isn't a problem if you know that screen will always get used. Due to this using scringos notification system it is slightly more confusing to pass JSON data but this isn't json this is a string. If this is an added button then the id identified in scringos bar would be better passed for the notification to launch the screen. If it as action buttons uch as yippee I've scored five in a quiz then the notification could be oused for others to go back to this quiz
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 09:44 AM (8 years ago)
There we go sorted good luck with the rest of your app
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 10:05 AM (8 years ago)
Thanks guys This is the section in full -(void)customFeatureClicked:(NSNotification *)aNotification { NSLog(@"User selected my custom command. Command id is =%@Radio123", [aNotification userInfo]); [[self getViewController] loadScreenWithItemId:@"352E33F70F42147E5A55669"]; [Scringo closeSidebar]; }
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 10:08 AM (8 years ago)
if you want to make this dynamic so you could have multiple new scringo buttons leading to screens change the id in scringo control panel to screen id i.e. 352E33F70F42147E5A55669 then use this instead [[self getViewController] loadScreenWithItemId:[aNotification userInfo]]; that way you can make as many new screens as you want and control them from scringo
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 10:17 AM (8 years ago)
Says incompatible pointer type sending 'NSDictionary' to parameter of type 'NSString *' would be superb if that worked though
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 10:24 AM (8 years ago)
mmm this will work i'm using you what does this print out in the console NSLog(@"User selected my custom command. Command id is =%@Radio123", [aNotification userInfo]); when it is launched
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 10:24 AM (8 years ago)
copy and paste just that log
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 10:25 AM (8 years ago)
and make sure your id in control panel is the item id
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 10:53 AM (8 years ago)
Scringo is very iffy about the id being coded on the site it has to start with a letter which is not always the case with BT screens. Could I use an if and depending the Command id is =% then calls different screen ? Need to think how to do this lol
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 10:56 AM (8 years ago)
oh yeah i remember that, use itemNickname instead [[self getViewController] loadScreenWithNickname:@"yourScreenNickname"]; it's like a little adventure lol
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 11:16 AM (8 years ago)
Thats good but how does @"yourScreenNickname" get found ?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 11:16 AM (8 years ago)
the screen nickname you create in the buzz touch control panel
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 11:16 AM (8 years ago)
there is one on every screen
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 11:18 AM (8 years ago)
Yes I can identify the nickname in every screen and put that in the ID on scringo control panel, but how does it get reference and interpreted here ? Sorry for being such a dork with this one lol
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 11:22 AM (8 years ago)
well to test it you would use [[self getViewController] loadScreenWithNickname:@"yourScreenNickname"]; with the screen nickname replacing yourScreenNickname as I said before we need to see what is held by this NSLog(@"User selected my custom command. Command id is =%@Radio123", [aNotification userInfo]); it will show in your log as something like User selected my custom command. Command id is =(text = 12344, scringo id =8378364) Radio123 once we know what user info returns we will know the object ket to pass to the method. its alright its all part of the adventure. whilst testing this our a valid nickname in the get view controller line
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 11:30 AM (8 years ago)
Kittsy this is the debug log once I run in Xcode and click button - created a new blank menu with image - no options called atest and put code in Xcode as well as id in scringo portal 2014-02-08 19:26:03.220 key2gib2[710:60b] Scringo - customFeatureClicked (atest) ... 2014-02-08 19:26:03.221 key2gib2[710:60b] User selected my custom command. Command id is ={ customButtonId = atest; } 2014-02-08 19:26:03.222 key2gib2[710:60b] WB_screen_menuImage: loadScreenWithNickname (super) Nickname:atest 2014-02-08 19:26:03.223 key2gib2[710:60b] BT_application: getScreenDataByNickname atest 2014-02-08 19:26:03.224 key2gib2[710:60b] BT_application: screenType is WB_screen_menuImage for screen with nickname: atest 2014-02-08 19:26:03.225 key2gib2[710:60b] WB_screen_menuImage: handleTapToLoadScreen (super) loading nickname: "atest" itemId: 1B237113531CD997FEE0D78 itemType: WB_screen_menuImage 2014-02-08 19:26:03.226 key2gib2[710:60b] BT_application: getViewControllerForScreen nickname: "atest" itemId: 1B237113531CD997FEE0D78 type: WB_screen_menuImage 2014-02-08 19:26:03.227 key2gib2[710:60b] WB_screen_menuImage: INIT 2014-02-08 19:26:03.228 key2gib2[710:60b] BT_navController: pushViewController 2014-02-08 19:26:03.231 key2gib2[710:60b] WB_screen_menuImage: viewDidLoad 2014-02-08 19:26:03.232 key2gib2[710:60b] WB_screen_menuImage: viewDidLoad (super) 2014-02-08 19:26:03.233 key2gib2[710:60b] BT_viewUtilities: getTableViewForScreen with nickname: "atest" and itemId: 1B237113531CD997FEE0D78 and type: WB_screen_menuImage 2014-02-08 19:26:03.236 key2gib2[710:60b] BT_fileManager: File does exist in Xcode bundle: "wb_abstractblue.png" 2014-02-08 19:26:03.246 key2gib2[710:60b] WB_screen_menuImage: viewWillAppear (super) 2014-02-08 19:26:03.247 key2gib2[710:60b] WB_screen_menuImage: configureNavBar (super) for screen with itemId: 1B237113531CD997FEE0D78 2014-02-08 19:26:03.248 key2gib2[710:60b] BT_viewUtilities: getNavBarBackgroundColorForScreen: Screen "atest" does not use a navBarBackgroundColor 2014-02-08 19:26:03.249 key2gib2[710:60b] WB_screen_menuImage: configureBackground (super) for screen with itemId 1B237113531CD997FEE0D78: 2014-02-08 19:26:03.250 key2gib2[710:60b] BT_background_view: updateProperties (color and image) for screen with itemId: 1B237113531CD997FEE0D78: 2014-02-08 19:26:03.251 key2gib2[710:60b] BT_fileManager: File does exist in Xcode bundle: "newwhitebackground.jpg" 2014-02-08 19:26:03.252 key2gib2[710:60b] BT_background_view: "newwhitebackground.jpg" exists in Xcode bundle - not downloading. 2014-02-08 19:26:03.252 key2gib2[710:60b] BT_background_view: setImage 2014-02-08 19:26:03.253 key2gib2[710:60b] WB_screen_menuImage: viewWillAppear 2014-02-08 19:26:03.359 key2gib2[710:60b] WB_screen_menuImage: loadData 2014-02-08 19:26:03.360 key2gib2[710:60b] WB_screen_menuImage: using menu items from the screens configuration data. 2014-02-08 19:26:03.360 key2gib2[710:60b] WB_screen_menuImage: layoutScreen 2014-02-08 19:26:03.361 key2gib2[710:60b] WB_screen_menuImage: This menu has no list items? 2014-02-08 19:26:46.121 key2gib2[710:60b] BT_locationManager: didUpdateToLocation
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 11:34 AM (8 years ago)
there it is 2014-02-08 19:26:03.221 key2gib2[710:60b] User selected my custom command. Command id is ={ customButtonId = atest; } so for it to be dynamic we are doing this [[self getViewController] loadScreenWithItemId:[[aNotification userInfo]objectForKey:@"customButtonId"]]; hopefully this will work
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 11:35 AM (8 years ago)
and along as the scringo id matches a buzz touch screen id it will load
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 12:00 PM (8 years ago)
Not working getting this 2014-02-08 19:56:55.231 key2gib2[749:60b] Scringo - customFeatureClicked (atest) ... 2014-02-08 19:56:55.233 key2gib2[749:60b] User selected my custom command. Command id is ={ customButtonId = atest; } 2014-02-08 19:56:55.234 key2gib2[749:60b] WB_screen_menuImage: loadScreenWithItemId (super) itemId:atest 2014-02-08 19:56:55.235 key2gib2[749:60b] BT_application: getScreenDataByItemId atest 2014-02-08 19:56:55.238 key2gib2[749:60b] BT_application: could not find screen with itemId: atest 2014-02-08 19:56:55.239 key2gib2[749:60b] WB_screen_menuImage: handleTapToLoadScreen (super) loading nickname: "" itemId: error view controller has no itemId itemType: BT_screen_menuList 2014-02-08 19:56:55.240 key2gib2[749:60b] BT_application: getViewControllerForScreen nickname: "no nickname?" itemId: error view controller has no itemId type: BT_screen_menuList 2014-02-08 19:56:55.242 key2gib2[749:60b] BT_application: getViewControllerForScreen: ERROR, could not initialize view controller for screen with itemId: error view controller has no itemId 2014-02-08 19:56:55.243 key2gib2[749:60b] BT_plugin_missing: INIT 2014-02-08 19:56:55.244 key2gib2[749:60b] BT_navController: pushViewController 2014-02-08 19:56:55.259 key2gib2[749:60b] BT_plugin_missing: viewDidLoad (super) 2014-02-08 19:56:55.260 key2gib2[749:60b] BT_plugin_missing: viewDidLoad 2014-02-08 19:56:55.261 key2gib2[749:60b] BT_plugin_missing: viewWillAppear (super) 2014-02-08 19:56:55.262 key2gib2[749:60b] BT_plugin_missing: configureNavBar (super) for screen with itemId: error view controller has no itemId 2014-02-08 19:56:55.263 key2gib2[749:60b] BT_viewUtilities: getNavBarBackgroundColorForScreen: Screen "(null)" does not use a navBarBackgroundColor 2014-02-08 19:56:55.264 key2gib2[749:60b] BT_plugin_missing: configureBackground (super) for screen with itemId error view controller has no itemId: 2014-02-08 19:56:55.264 key2gib2[749:60b] BT_background_view: updateProperties (color and image) for screen with itemId: error view controller has no itemId: 2014-02-08 19:56:55.266 key2gib2[749:60b] BT_fileManager: File does exist in Xcode bundle: "newwhitebackground.jpg" 2014-02-08 19:56:55.266 key2gib2[749:60b] BT_background_view: "newwhitebackground.jpg" exists in Xcode bundle - not downloading. 2014-02-08 19:56:55.267 key2gib2[749:60b] BT_background_view: setImage 2014-02-08 19:56:56.493 key2gib2[749:60b] BT_locationManager: didUpdateToLocation
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 12:00 PM (8 years ago)
On device getting Plugin not found lol
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 12:03 PM (8 years ago)
sorry my fault it's hard coding without Xcode in front of you [[self getViewController] loadScreenWithNickname:[[aNotification userInfo]objectForKey:@"customButtonId"]]; I copied and pasted the item id one
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 12:05 PM (8 years ago)
he he he You are a star sorry didn't pick that one up myself should have lol. It works superbly mate. Thanks for all your help. Learned a lot today thanks to you. If you come near Gibraltar anytime soon can take you out for few beers. lol
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
Fourm StarFourm StarFourm Star
like
02/08/14 12:07 PM (8 years ago)
I seem to help a lot of you gibraltar heads well you are British for now anyway. At least you now have a fully dynamic scringo add button. Helped me procrastinate a little for the day
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 12:09 PM (8 years ago)
Thanks mate lol. Gibraltar has been British since 1704 and will remain British for a further 300 years at least he he he. Once again many thanks kind Regards Alan
 
Niraj Shah
buzztouch Evangelist
Profile
Posts: 2942
Reg: Jul 11, 2012
Cerritos
37,920
Fourm StarFourm Star
like
02/08/14 12:29 PM (8 years ago)
@Alan -- please make a new post that has the solution in it. Describe your problem in the initial post. Then reply to yourself with the answer. I've found that folks will view posts if there is at least one reply to it. An appropriate title would be: "Fixed - Scringo button loads any screen" That way a future user does not have to sort through all this racket to find the jewels that Kittsy dispersed. Thanks for letting me be pedantic, these social things are quite nuanced! -- Niraj
 
thegibcoyote
Apple Fan
Profile
Posts: 139
Reg: Feb 01, 2011
Gibraltar
1,390
like
02/08/14 12:45 PM (8 years ago)
Niraj - agree have just created a new item and posted two entries which hopefully people will find useful. I have of course accredited Mr Kittsy that has been Paramount to the resolution of this issue. The description for entry is Fixed - Scringo button loads any screen thanks all
 

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.