×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Regular Contributor
    Join Date
    Feb 2006
    Location
    Los Angeles
    Posts
    217

    Thumbs up How to link directly to a product on OVI (solution)

    See tested PHP solution in post #15
    Last edited by proberts; 2009-06-25 at 20:25. Reason: OVI Product ID numbers changed

  2. #2
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    103

    Re: How to link directly to a product on OVI (solution)

    That's nice, but there is still the problem of the default device of Ovi. If you want to refer someone to an application that isn't available on the Nokia 5800 XpressMusic, then the application will not be available as the default device for unsigned users is the 5800.

  3. #3
    Regular Contributor
    Join Date
    Feb 2006
    Location
    Los Angeles
    Posts
    217

    Should work for any app - not just 5800 apps

    Quote Originally Posted by dudi View Post
    That's nice, but there is still the problem of the default device of Ovi. If you want to refer someone to an application that isn't available on the Nokia 5800 XpressMusic, then the application will not be available as the default device for unsigned users is the 5800.
    Did it not work for you?

    At least for me on Firefox and IE, the above code will go to an app even if it's not available for the 5800.

    The app in the example code isn't available for the 5800. The hidden iframe goes to the homepage and sets the device to "Any Phone", then after the homepage is finished loading, the window is redirected to the app page.

    If it doesn't do this, could you let me know what platform and browser you use. I'll see if I can debug it.


    Thanks,
    Pat

  4. #4
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    103

    Re: How to link directly to a product on OVI (solution)

    Hey,
    Sorry, I didn't scroll right to see the src parameter.
    This definitely works. Great Job!

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    42

    Re: How to link directly to a product on OVI (solution)

    Nice trick, thanks for sharing!

    Doesn't work on Safari (4.0.1) and Opera (9.25) though:

    On Safari you get:

    "Unsafe JavaScript attempt to access frame with URL ... from frame with URL https://store.ovi.com/index?terminalId=any. Domains, protocols and ports must match."

    (the iframe src is from a different domain than the page's domain)

    Ori

  6. #6
    Regular Contributor
    Join Date
    Feb 2006
    Location
    Los Angeles
    Posts
    217

    Re: How to link directly to a product on OVI (solution)

    Quote Originally Posted by ori_regev View Post
    On Safari you get: [error]
    OK - I've got a friend's mac. How do I see error messages from Safari?

    Something interesting with Safari. If I hit the back button it reload correctly. Odd. (Safari 3.1.2.)


    Thanks,
    Pat

  7. #7
    Regular Contributor
    Join Date
    Feb 2006
    Location
    Los Angeles
    Posts
    217

    Re: How to link directly to a product on OVI (solution)

    NM - Found the error console "write defaults" thing.


    I think the cross-domain error is unrelated. Safari looks like it supports loading a cross-domain iframe but forbids cross domain communication through Javascript (like it should.)

    If anyone has any thoughts, please join in.
    Last edited by proberts; 2009-06-23 at 03:24.

  8. #8
    Registered User
    Join Date
    Sep 2004
    Posts
    42

    Re: How to link directly to a product on OVI (solution)

    Hi,

    please note that linking directly to a product on Ovi is unsafe because Ovi may change the product's URL without warning!

    As strange as this may sound, they did so today... I thought that our app disappeared from the store again, but it turns out that it didn't - Nokia simply changed the application's page URL for some reason (!)

    That's not all - when you search for our app, the search result point to the old app URL, so when the user clicks on the result he gets an "Item no longer available error".

    My conclusion is therefore that it is unsafe to link directly to a product page on Ovi - which is really really bad, because web linking can substantially boost Ovi's popularity among users and publishers (like it did for Apple's app store).

    Ori

  9. #9
    Regular Contributor
    Join Date
    Feb 2006
    Location
    Los Angeles
    Posts
    217

    Lightbulb Safari solution working - please test

    I have a php script I've tested in:

    Firefox 3 - OSX, XP, Vista, Linux
    IE7 - XP
    Safari 3 - OSX

    It seems to work fine on all these platforms. Could someone please try in Opera and Safari 4 and let me know if it works. I don't have Opera to test. Opera will use the same solution I used for Safari.

    http://www.lowermars.com/gotoovi.php

    This will bring up one of our products that doesn't have a 5800 build. You can go to a different product by adding "?cid=" and the OVI content ID number (check first - they've changed).

    Please try it and report which OS & Browsers pass and fail. NOTE: For Safari, I had to exit completely between tests as the first try would always fail but subsequent tries would all pass.

    If this solution works, I'll clean up the code and post the php script here.

    Thanks,
    Pat

  10. #10
    Registered User
    Join Date
    Sep 2004
    Posts
    42

    Re: How to link directly to a product on OVI (solution)

    very nice.

    Just tried your URL on a Mac with the following browsers: Safari 4, Opera 9, Google Chrome Beta, Firefox 3

    It works well on all of them.

    Ori

  11. #11
    Regular Contributor
    Join Date
    Feb 2006
    Location
    Los Angeles
    Posts
    217

    Re: How to link directly to a product on OVI (solution)

    Just checked IE8 under Vista and it works.

    Are there any other browsers that should be checked? Konqueror is the other other one that I can think of, which I can check tomorrow, though Safari says it's forked from Konqueror, and a fail on Konqueror wouldn't be a show stopper. :P

    -Pat

  12. #12
    Regular Contributor
    Join Date
    Feb 2006
    Location
    Los Angeles
    Posts
    217

    Re: How to link directly to a product on OVI (solution)

    Quote Originally Posted by ori_regev View Post
    Just tried your URL on a Mac with the following browsers: Safari 4, Opera 9, Google Chrome Beta, Firefox 3
    Ori
    Thanks (pad for "message too short")

  13. #13
    Registered User
    Join Date
    Sep 2004
    Posts
    42

    Re: How to link directly to a product on OVI (solution)

    It seems to work well on the following browsers too (tried via http://browsershots.org):

    opera-9.64-fedora
    seamonkey-1.1.9-fedora-7
    kazehakase-0.5.2-ubuntu-8.04-lts
    firefox-3.5-ubuntu-9.04
    opera-9.64-windows-xp
    opera-10.00-windows-xp
    seamonkey-1.1.16-windows-xp
    avant-11.7-windows-xp
    seamonkey-2.0-windows-xp
    k-meleon-1.5.0-windows-xp
    minefield-3.6-windows-xp
    navigator-9.0.0.6-windows-xp
    firefox-2.0.0.18-windows-xp
    seamonkey-2.0-debian
    firefox-3.1-windows-xp
    safari-3.2.3-mac-os-x-10.5

    when do you expect to share your script's code?

    Ori

  14. #14
    Regular Contributor
    Join Date
    Feb 2006
    Location
    Los Angeles
    Posts
    217

    Re: How to link directly to a product on OVI (solution)

    Quote Originally Posted by ori_regev View Post
    It seems to work well on the following browsers too (tried via http://browsershots.org):
    - Wow - cool site!

    when do you expect to share your script's code?
    I'll clean it up and post it tomorrow (6/24)

  15. #15
    Regular Contributor
    Join Date
    Feb 2006
    Location
    Los Angeles
    Posts
    217

    Direct linking PHP code

    Ok...here's the PHP. It looks like OVI changed content ID numbers again this morning and the reviews, related, and searching are back.

    Code:
    <?php
    
    	// Zlib/libpng license
    
    	/*
    	Copyright (c) 2009 Lower Mars, LLC
    
    	This software is provided 'as-is', without any express or implied
    	warranty. In no event will the authors be held liable for any damages
    	arising from the use of this software.
    
    	Permission is granted to anyone to use this software for any purpose,
    	including commercial applications, and to alter it and redistribute it
    	freely, subject to the following restrictions:
    
    		1. The origin of this software must not be misrepresented; you must not
    		claim that you wrote the original software. If you use this software
    		in a product, an acknowledgment in the product documentation would be
    		appreciated but is not required.
    
    		2. Altered source versions must be plainly marked as such, and must not be
    		misrepresented as being the original software.
    
    		3. This notice may not be removed or altered from any source
    		distribution.
    	*/
    
    	//
    	// Things to adjust
    	//
    	
    	//Page Title
    	$pageTitle="Get my App from OVI";
    
    	//Page background color
    	$bgColor="#FFFFFF";
    
    	//Extra  header HTML (meta tags)
    	$extraMeta="";
    
    	// Default OVI Product ID - override with GET var 'cid'
    	$CID="69C5EC57F8BAD9BEE040050A87325122";
    	
    	// HTML for your waiting message/image - can have <img>, etc.  
    	//Wrapped in <div align=center>
    	$waitML="Going to OVI store...please wait (animated.gif)<br/>\n";
    	
    	//
    	// Not necessary to mod below unless you want to.
    	//
    	
    	//Browser - seems IE7 sometimes fails without reload
    	$reloadBrowsers = array("opera", "safari", "msie"); 
    	$uaString = strtolower($_SERVER['HTTP_USER_AGENT']);
    	$reqReload=false;
    	foreach ($reloadBrowsers as $browser) {
    		if(stristr($uaString, $browser)!==false) {$reqReload=true;break;}
    	}
       
    	if(isset($_GET['cid'])) $CID=$_GET['cid'];
       
    	//Safari reload var
    	$safariCount=false;
    	if(isset($_GET['safari'])) $safariCount=true;
    
    	$onloadcmd="goToProductPage('".$CID."');";
    	$styleString="display: none;";
    	if( $reqReload===true ) {
    		$styleString="width: 1px;height: 1px;";
    		if( $safariCount===false) {
    			$onloadcmd="safariReload('http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?cid=".$CID."&safari=1');";
    		}
    	}
    	
    	echo("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">".
    		 "<html>\n<head>\n".$extraMeta.
    		 "<title>".$pageTitle."</title>\n".
    		 "<script type=\"text/javascript\">\n".
    		 "function goToProductPage(contentID) {\n".
    		 "window.location=\"http://store.ovi.com/content/\" + contentID ;\n".
    		 "}\n".
    		 "function safariReload(URL) {\n".
    		 "window.location=URL;\n".
    		 "}\n".
    		 "</script>\n".
    		 "</head>\n");
    		 
    	echo("<body bgcolor=\"".$bgColor."\">\n<div align=\"center\">\n");
    	
    	//Animated loading image
    	echo($waitML);
    
    	//Get on with loading OVI
    	echo("<iframe style=\"".$styleString."\" ");
    	
    	echo("onload=\"".$onloadcmd."\"");
    	echo("src=\"http://store.ovi.com/index?terminalId=any\"></iframe>\n");
    	echo("</div></body></html>");
    
    ?>
    Last edited by proberts; 2009-07-10 at 00:17. Reason: ending ?> not displaying in [CODE] block

Similar Threads

  1. How to disconnect Bluetooth link?
    By jhnlmn in forum Bluetooth Technology
    Replies: 8
    Last Post: 2010-04-13, 09:11
  2. armi urel in codewarrior
    By arthig in forum Symbian
    Replies: 0
    Last Post: 2005-04-06, 10:13
  3. Linking Errors: Pls Help....
    By amanjha14 in forum Symbian
    Replies: 2
    Last Post: 2004-12-03, 09:03
  4. Link error
    By SimoneF85 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2004-11-09, 18:07
  5. Need help for testing nokia solution
    By exosystem in forum General Development Questions
    Replies: 0
    Last Post: 2003-08-21, 17:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •