Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 13    Views: 258

ridgerock
Veteran developer
Profile
Posts: 183
Reg: May 19, 2011
Louisville
1,830
04/12/12 06:36 PM (13 years ago)

Trying to link to Buzztouch screens from Html 5?? It has to be possible??

Ok, So I am building an html 5 Home page that I will use a custom url link for. My question is can put a button on the HTML 5 screen that will link me into another buzz touch screen. For example I way to be able to link to the Location Map. I can see the url in the config data but when I plug all the info in it doesn't work. Any suggestions, Thoughts? Surely, this can be done right?
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/12/12 07:11 PM (13 years ago)
I think the answer involves the appdelegate file. There's several threads asking the same question. Fred
 
ridgerock
Veteran developer
Profile
Posts: 183
Reg: May 19, 2011
Louisville
1,830
like
04/12/12 07:17 PM (13 years ago)
Yeah I see all the threads now. I should have searched better before posting. I am determined to figure this out though.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/12/12 08:14 PM (13 years ago)
Several of us working on this. I believe the method involves calling and object via the appdelegate file. Found some interesting articles discussing this. Will post tomorrow. Fred
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
04/13/12 12:02 PM (13 years ago)
Hi All, I'm talking iOS. I managed to connect an html-link to a screen (plugin). Below some code. Hope you can read by the lines how this was done and helps you getting started. I used a link in the html to link to the facebook plugin. This is the html: <div style="margin: 0px 0px 0px 75px;"><a style="text-decoration:none;color:#ff9900;font-weight:bold;" href="facebookshare://facebookclass.com">Facebook share.</a></div> <!--End The right Column --> </div> This the Xcode: -(BOOL)webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType{ if (navigationType == UIWebViewNavigationTypeLinkClicked) { NSURL *facebookurl = [request URL]; if ([[facebookurl scheme] isEqualToString:@"facebookshare"]) { NSString* desc2 = [screenData.jsonVars objectForKey:@"descriptionTXT"]; BT_item *tmpMenuItem = [[BT_item alloc] init]; [tmpMenuItem setItemId:@"Contact Us"]; BT_item *itemNickname = [[BT_item alloc] init]; [itemNickname setItemId:@"Contact Us"]; BT_item *screenObjectToLoad = [[BT_item alloc] init]; [screenObjectToLoad setItemId:@"71648251F9A736205A9C8C8"]; screenObjectToLoad = [[BT_item alloc] init]; [screenObjectToLoad setItemId:@"71648251F9A736205A9C8C8"]; [screenObjectToLoad setItemNickname:@"Contact Us"]; [screenObjectToLoad setItemType:@"BT_screen_shareFacebook2"]; NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: //templateNameSmallDevice, @"tmpl", desc2, @"descriptionTXT", //these are the optional properties the BT_screen_webView will look for [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemNavBarBackgroundColor":@""], @"navBarBackgroundColor", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemNavBarStyle":@""], @"navBarStyle", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemToolBarStyle":@""], @"toolBarStyle", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemBackButtonText":@""], @"navBarBackButtonText", @"#FFFFFF", @"backgroundColor", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemShowBrowserBarBack":@"0"], @"showBrowserBarBack", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemShowBrowserRefresh":@"0"], @"showBrowserBarRefresh", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemShowBrowserBarLaunchInNativeApp":@"0"], @"showBrowserBarLaunchInNativeApp", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemNavBarRightButtonType":@""], @"navBarRightButtonType", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemNavBarRightButtonTapLoadScreenItemId":@""], @"navBarRightButtonTapLoadScreenItemId", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemRightButtonTapTransitionType":@""], @"navBarRightButtonTapTransitionType", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemHideBottomTabBarWhenScreenLoads":@""], @"hideBottomTabBarWhenScreenLoads", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemAudioFileName":@""], @"audioFileName", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemAudioFileURL":@""], @"audioFileURL", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemAudioStopsOnScreenExit":@"0"], @"audioStopsOnScreenExit", [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"rssItemAudioNumberOfLoops":@"0"], @"audioNumberOfLoops", nil]; [screenObjectToLoad setJsonVars:dict]; [BT_viewControllerManager handleTapToLoadScreen:[self screenData]:tmpMenuItem:screenObjectToLoad]; //NSLog(@ScreenObjectToLoad is: %@, screenObjectToLoad); //NSLog(@tmpMenuItem is: %@, tmpMenuItem); return NO; // Stops the link being executed by UIWebView } else return YES; } Best Regards, Danny
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/13/12 12:39 PM (13 years ago)
Well done, Where did you put the xcode? Fred
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
04/13/12 12:47 PM (13 years ago)
Hi Fred, The code was in a webview. Ofcourse it depends on where you want to use it. You could use this in custom html for example and you need at least tell the code what link has to go to what screen (plugin): NSURL *facebookurl = [request URL]; if ([[facebookurl scheme] isEqualToString:@"facebookshare"]) It looks if there is a link (isEqualToString) called facebookshare (href="facebookshare://) If it is it needs: screenObjectToLoad = [[BT_item alloc] init]; [screenObjectToLoad setItemId:@"71648251F9A736205A9C8C8"]; [screenObjectToLoad setItemType:@"BT_screen_shareFacebook2"]; BT_screen_shareFacebook2 is the plugin I'm calling to open when such link is clicked. Hope this clarifies a bit. Best Regards, Danny
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
04/22/12 01:13 AM (13 years ago)
I have been doing something similar for Android in webview..."Javascript Interface" is very interesting stuff...allowed me to have an html page that opened A/V player for my local media files...very hacked together and not pretty but works...still doing more research to slim down the coding...I'm no David!
 
OrchardApps
Code is Art
Profile
Posts: 115
Reg: Jan 11, 2012
Brisbane austra...
5,850
like
08/27/12 03:32 AM (13 years ago)
Hi guys, This is the closest I have found to what I need, but it's a bit over my head. I need to be able to go back to the previous screen when they click on a section of my html document. I'm totally lost. Using the standard back button just doesn't fit in with the app design. It would have been great if I could have had a header image, but it's not allowed for html doc types. Thanks for any help.
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
08/27/12 03:45 AM (13 years ago)
Hi Wrigglepot, Don't know if I understand correctly but if you want to go back to a webview you can use some javascript within a button. Let's say you went to google and hit a link after that. Now you want to go back to go back to google again. Is this the story? If so....(it only works on your own html pages): include a button on every (html)page. Something like this: <button><a href="#" onclick="history.go(-1)">Previous</a></button> You can style the button with css. Hope this helps. Best Regards, Danny
 
OrchardApps
Code is Art
Profile
Posts: 115
Reg: Jan 11, 2012
Brisbane austra...
5,850
like
08/27/12 03:52 AM (13 years ago)
Hi PSMDanny, Thanks for getting back to me so quickly. Sorry I didn't explain myself properly. I have the home screen = Menu - List (1) First entry in Menu 1 = Menu - List (2) First entry in Menu 2 = HTML Doc When they are in the HTML Doc I want them to be able to go back to the Menu List 2 rather than go to the home screen and then click through again to get to the Menu2 second entry/topic. I don't want to use the native back button as it really doesn't suite the design at all, but that is what I want to replicate using html. I hope that helps. Cheers Christine
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
08/27/12 04:02 AM (13 years ago)
Hi Christine, Sorry I misunderstood... I guess that this would involve some extra coding in the menu you are using. Sorry to say I don't have an answer to that. Would have to digg deep in the code to get the solution but I'm too busy right now working on the final steps of my blog plugin. Got to finish this first before my vacation so it get in the plugin market. Sorry...... Best Regards, Danny
 
OrchardApps
Code is Art
Profile
Posts: 115
Reg: Jan 11, 2012
Brisbane austra...
5,850
like
08/27/12 04:32 AM (13 years ago)
Hi Danny, No problem at all. Have a great holiday. Christine
 
pistone10
Aspiring developer
Profile
Posts: 6
Reg: Jul 23, 2012
Las Vegas
1,810
like
11/04/12 10:47 PM (13 years ago)
I know this is an old post but I was wondering if PSMDanny's code would work to link from an html doc to a screen in the app and if so where exactly to I put the code. Thanks
 

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.