I have a anchor tag with the url "itms://itunes.apple.com/us/app/movietickets-com-showtimes/id402114309?mt=8".If the client system doen't have the Itune software, then the browser is not opening the page.
Is there any way to know the whether the user installed Itune software or not.
Thanks in advance.
Note:
If you go to
https://itunes.apple.com/us/app/movietickets-com-showtimes/id402114309?mt=8
Here you can find or inspect "view in itune" button.There you can see
some javascript to detect that.But i dont know what there are doing!
Apple already has code to detect if iTunes is installed, you can find their code here: http://ax.itunes.apple.com/detection/itmsCheck.js
Finally i got a solution,
From the following site https://itunes.apple.com/us/app/movietickets.com-showtimes/id402114309?mt=8
You need to take two js files. (It contains some extra javascript and jquery - you can remove those if you know that it is no longer needed)
https://itunes.apple.com/htmlResources/99EF/web-storefront-base.js
https://itunes.apple.com/htmlResources/99EF/web-storefront-preview.js
And you need to add the below code to your page html,
""
Finally, Whenever you want to check the plugin, just call
if (its.detect.itunesDetected())
{
//Your code if plugin installed
}
else
{
//Your code if plugin not installed
}
Related
I am very new to Plugin development. I have an existing NPAPI plugin that works fine on Firefox. I want to reuse it and load it in Safari as well. To get started I downloaded the sample plugin from http://mxr.mozilla.org/mozilla2.0/source/modules/plugin/sdk/samples/basic/mac/. Built it in XCode and added the plugin under /Library/Internet Plugins/. I see that browser notifies asking for permission to access the plugin but I don't see it actually getting loaded. I am doing the following.
var npPlugin = document.createElement("embed");
(npPlugin).type = "application/x-myPlugin";
(npPlugin).data = "data:application/x-myPlugin,";
npPlugin.setAttribute("style", "width:0;height:0");
window.document.body.appendChild(npPlugin);
Couldn't find a good way to debug it, so tried the raw way of creating a file and writing logs to it. I added this to both NP_GetEntryPoints & NP_Initialize with a hope that one of these functions will be invoked at the time of loading and will log for me. I didn't see any signs of my plugin getting loaded. Any ideas on how to make it to load or how to actually debug it?
I commented out any code that was other than the NPAPI required methods. It helped me get around this problem.
I am importing the Wizcorp phonegap-facebook-plugin using the intelxdk.config.additions.xml file with this code:
<intelxdk:plugin intelxdk:name="com.phonegap.plugins.facebookconnect" intelxdk:value="https://github.com/Wizcorp/phonegap-facebook-plugin/">
<intelxdk:param intelxdk:name="APP_ID" intelxdk:value="MyActualAppID" />
<intelxdk:param intelxdk:name="APP_NAME" intelxdk:value="fizz points" />
</intelxdk:plugin>
I've read and understand that I will not be able to test this 3rd party plugin in the emulator, or via the test or debug tabs, so I've created a test build for Android.
Based on the documentation, I believe I am supposed to reference this API via calls to the facebookConnectPlugin, such as:
facebookConnectPlugin.login(["publish_stream", "publish_actions", "offline_access"],
fbLoginSuccess,
function (error) { alert("There was an error: " + error) });
However, I know that in the built app, as in the emulator, the facebookConnectPlugin is not defined, because I get an alert based on the following block:
if (typeof facebookConnectPlugin != 'undefined'){
// do stuff
} else {
alert("FacebookConnectPlugin Not Defined");
}
I assume this is because I need to include the 3rd party library in my code in addition to including it in my project where suggested by the helpful comments, something like:
<!-- Most third-party libraries should go here. References (below) are just examples to give you the general idea... -->
<!-- <script src="lib/mc/hammer.js"></script> -->
Initially, I didn't know the path where the 3rd party library is ultimately located in the package after the build tool retrieves it. But I was told that I could change the .apk extension to .zip extract and explore the contents.
I did this, and found that the library was stored in:
www/plugins/com.phonegap.plugins.facebookconnect/www/phonegap/plugin/facebookConnectPlugin/facebookConnectPlugin.js
So I added the following to my index.html file:
<script src="plugins/com.phonegap.plugins.facebookconnect/www/phonegap/plugin/facebookConnectPlugin/facebookConnectPlugin.js"></script>
However, when built, my test to see if the FacebookConnectPlugin is defined still fails.
Thanks!
Noah
[I've essentially asked the same question on the Intel forums here: https://software.intel.com/en-us/forums/topic/536743 . No solution yet, but if I get one I will post it here.]
You need to build your app and install it on your device to test the WizCorp Facebook plugin. Please make sure you follow the instructions for configuring your app on Facebook.
note the Emulator (simulator) does not support third party plugins as you have noted. Same for using App Preview to test. You must build your app in the cloud.
thanks,
Ian
Are you accessing the facebookConnectPlugin object from inside device ready event?
document.addEventListener("intel.xdk.device.ready",function() {
// try in here
}, false);
It could be undefined if you are accessing it from outside as the plugin is not ready to be used yet.
I'm new at using Selenium and I'm surprised this question hasn't been asked before but, does anymore know how I can check all the links on a page to make sure none of them are broken?
If you want to check all the links on a page using selenium if so the first you need to click and you need to record first. And you can check with assertLocation. It was broken or not.But I want to give you some advice if you have many tests if so please use webdriver. Because IDE have many limitation.
You can check this article for webdriver Finding the broken links in a webpage using Selenium
First you need to fetch all the links.
public static void allLinks(WebDriver driver)
{
List<WebElement> links =driver.findElements(By.tagName("a"));
for(int i =0;i<links.size();i++)
{
System.out.println(links.get(i).getText());
}
}
Here I am just printing all the hyper links by using tag name as all hyperlinks have this anchor tag <a>.
Hope this helps.
very new at this. Could someone tell me what is the best method of submitting a form when using phonegap and JMQ? What I want to be able to do is passing the form data to a php file and then having the results passed back into app so that the user isnt directly accessing the php file at any point.
I found the following page link which basically does what I want but I keep getting "Origin null is not allowed by Access-Control-Allow-Origin" when testing out the code. So I'm guessing this will only work if the app is located on a server also?
Any happy would be great. thank <3
To test your solution on the computer you need to launch chrome from the terminal with the argument --disable-web-security. See this answer: Disable same origin policy in Chrome
In your Phonegap application you add a line of code to your config.xml in the www-folder: <access origin="*.yourdomain.com" />. Build, and you are now allowed to request all domains and subdomains from yourdomain.com. For more details on whitelisting see http://docs.phonegap.com/en/3.0.0/guide_appdev_whitelist_index.md.html#Domain%20Whitelist%20Guide
You are not able to make post through the local files, so Yes, you need to have it running in a Web Server.
But if you deploy your application, it should work either in a emulator or in your device.
I have installed dokuwiki to my server.
It shows in mobile mode when I access to it with Android or iPhone.
But I want to show it as PC mode.
How can I?
Which template are you using?
If it's the default "dokuwiki" template, simply remove the line with css/mobile.css from the style.ini file in ./lib/tpl/dokuwiki/.
Dokuwiki's API let determine if the client is mobile. Then it's up to the template to use this information or not.
You could try grep -rn ismobile . on your template code to see how it is used.
Ideally I would have added a comment to ask which template you use, but I'm afraid I don't have enough reputation to leave comments yet.