Reputation: 13
I don't want to open the browser but the actual store in my Windows 8 phone.
I am developing an app using PhoneGap and so I want to do this with Javascript.
I haven't submitted my app so I don't yet have a package name. How do I test this without an actual package name?
Also, I can't seem to be able to use:
Windows.System.Launcher.LaunchUriAsync(new Uri(appStoreURL));
I get:
Error:["'Windows' is undefined file:x-wmapp0:www\/js\/......
Any ideas?
SOLUTION:
Using Benoit's answer and some other stuff I found I managed to link straight to the review section by adding the following Plugin to my cordovalib:
LaunchReview.cs
using WPCordovaClassLib.Cordova.Commands;
using Microsoft.Phone.Tasks;
namespace Cordova.Extension.Commands
{
public class LaunchReview : BaseCommand
{
public void launchReview(string options)
{
// Use the Marketplace review task to launch the Store or Marketplace and then display the review page for the current app.
MarketplaceReviewTask marketplaceReviewTask = new MarketplaceReviewTask();
marketplaceReviewTask.Show();
}
}
}
Upvotes: 1
Views: 598
Reputation: 21
I used InAppBrowser cordova plugin.
cordova plugin add org.apache.cordova.inappbrowser
To open wp8 store i call from javascript:
window.open(UrlToMyApp, '_blank', 'location=yes');
Upvotes: 0
Reputation: 3345
Note sure what value you are using for appurl but here is something which should work:
Windows.System.Launcher.LaunchUriAsync(new Uri("zune:reviewapp"));
or you can use:
MarketplaceReviewTask marketplaceReviewTask = new MarketplaceReviewTask();
marketplaceReviewTask.Show();
To call it from javascript just create a plugin:
namespace Cordova.Extension.Commands
{
public class LaunchReview: BaseCommand
{
public void launchReview(string options)
{
// all JS callable plugin methods MUST have this signature!
// public, returning void, 1 argument that is a string
MarketplaceReviewTask marketplaceReviewTask = new MarketplaceReviewTask();
marketplaceReviewTask.Show();
}
}
}
that you can use it like this from javascript:
cordova.exec(win, fail, "LaunchReview", "launchReview", [""]);
Here is the link to the plugin dev guide for windows phone
If you want to use window.open then you will need to modify the PhoneGap source code to use LAunchUri because currently it's just using WebBrowserTask instead of LaunchUri. The function to modify is Plugin/InAppBrowser.cs>ShowSystemBrowser
Upvotes: 2