Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 52

LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
12/03/14 05:41 PM (9 years ago)

Add to Favorites

Hey there (mostly Kittsy ;-)), I am using Smugs Offline MapKit together with Susans WB-Addons , creating Custom URL Screens on the fly after pressing the location icon on the map. I thought I would like to have the ability to add these Custom URL Screens to the favorite menu using Kittsy's plugin. After editing the code like in the readme, it seems to work until I get to the Favorites menu where I can see the following problem in my logcat: "could not find screen with itemId: ..." So somehow the plugin can't find the Custom URL screen that was created on the fly from the database. Can this be solved or does it have to be a screen that is physically in the plugin? Help would be appreciated. Regards Leon
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/03/14 07:51 PM (9 years ago)
Without looking, this is my best guess ... loadScreenObject is your friend. It handles JSON that is created on the fly. The plugin must be coded to handle loadScreenObject. -- Niraj
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/04/14 01:27 AM (9 years ago)
You might have to ask Kittsy that one... I'm not entirely sure. That's an interesting problem, the more I think about it... you're going to need to find a way to 'save' not the screen, but the screen 'type', and the data the screen is populated with... probably using some piece of unique data; either a record number, or preferably, a name string that will go in NSUserDefaults, and some kind of way to retrieve the entire record contents, and re-populate a plugin screen. Does the error give you a 'valid' itemId? Even if it's one of the dynamically generated ones? Cheers! -- Smug
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
12/04/14 04:13 AM (9 years ago)
It is interesting ;-) I do get an itemId yes. for example one of the pages has the itemId 613-BB001GB675HZ613 The URL for it is: http://appserver.appkingz.net/wb_addons/maps/map_details.php?appGuid=EAF7B673BD1E4746945EEC690&mapGuid=BB001GB675HZ613 So it does kinda create an itemId as you can see here in my logcat: 2014-12-04 12:04:52.347 birdiebook[2499:1014000] SW_offlineMapKit: handleTapToLoadScreen (super) loading nickname: "na" itemId: 613-BB001GB675HZ613 itemType: BT_screen_customURL Any thoughts?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/04/14 04:33 AM (9 years ago)
I think Drone Videos are cool! Let me know when you get those going! :) Honestly, I don't own the plugin, so you'll need to consult with Kittsy on how that's going to turn out. He usually stops in once or twice a day; he'll be around to comment shortly. Cheers! -- Smug
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
12/09/14 03:35 PM (9 years ago)
Kitty somehow disappeared and I can't go on with my app without the favorites plugin. Smug maybe you could have a look? Willing to pay for it generously as well! For a code example, the itemId from Smugs Location Menu is: BB001GB675HZ618 that ItemiD is the guid in my WB-Addons Database as well so all good. As soon as I press add to favorites it seems the plugin creates a new itemId called: 617-BB001GB675HZ618 the first number 617 is the "id" in my database so somehow the new itemId is "id-ItemiD"... If the add to favorites would only search the itemId BB001GB675HZ618 would it not find it? Tried some things in the code but not getting there. Here the actual code part I talked about: 2014-12-09 23:19:07.869 birdiebook[1199:500403] SW_locationmenu: didSelectRowAtIndexPath: Selected Row: 2 2014-12-09 23:19:07.870 birdiebook[1199:500403] SW_locationmenu: json: { descriptionText = "Meessen 38"; distance = "6.3"; itemId = BB001GB675HZ618; itemNickname = "GolfRange Hamburg-Oststeinbek"; itemType = "SW_loc_detail"; latitude = "53.550288"; loadScreenObject = { backgroundColor = stripes; dataDetectorType = 0; dataURL = "http://appserver.appkingz.net/wb_addons/maps/map_details.php?appGuid=EAF7B673BD1E4746945EEC690&mapGuid=BB001GB675HZ618"; itemId = "617-BB001GB675HZ618"; itemNickname = na; itemType = "BT_screen_customURL"; navBarTitleText = "GolfRange Hamburg-Oststeinbek"; showBrowserBarBack = 0; showBrowserBarEmailDocument = 0; showBrowserBarLaunchInNativeApp = 0; showBrowserBarRefresh = 0; }; longitude = "10.166543"; titleText = "GolfRange Hamburg-Oststeinbek"; } 2014-12-09 23:19:07.872 birdiebook[1199:500403] SW_locationmenu: handleTapToLoadScreen (super) loading nickname: "na" itemId: 617-BB001GB675HZ618 itemType: BT_screen_customURL 2014-12-09 23:19:07.873 birdiebook[1199:500403] BT_application: getViewControllerForScreen nickname: "na" itemId: 617-BB001GB675HZ618 type: BT_screen_customURL 2014-12-09 23:19:07.874 birdiebook[1199:500403] BT_screen_customURL: INIT 2014-12-09 23:19:07.874 birdiebook[1199:500403] BT_navController: pushViewController 2014-12-09 23:19:07.878 birdiebook[1199:500403] BT_screen_customURL: viewDidLoad 2014-12-09 23:19:07.878 birdiebook[1199:500403] BT_screen_customURL: viewDidLoad (super) 2014-12-09 23:19:07.880 birdiebook[1199:500403] BT_viewUtilities: getWebNavBarForScreen with nickname: "na" and itemId: 617-BB001GB675HZ618 and type: BT_screen_customURL 2014-12-09 23:19:07.970 birdiebook[1199:500403] SW_locationmenu: viewWillDisappear (super) 2014-12-09 23:19:07.971 birdiebook[1199:500403] SW_locationmenu: fadeOutOnExit (super): 2014-12-09 23:19:07.971 birdiebook[1199:500403] BT_screen_customURL: viewWillAppear (super) 2014-12-09 23:19:07.971 birdiebook[1199:500403] BT_screen_customURL: configureNavBar (super) for screen with itemId: 617-BB001GB675HZ618
 

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.