This might be a easy question but i couldn't find solution. I want to open AppWorld by clicking a button in my BB application. For example when user clicks this button Appworld will show "Facebook Application" page. Can i do this?
In Android platform this line launches GooglePlay for Facebook App. Does BlackBerry supports this kind of method?
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.facebook.katana")));
Here is a simple way to do this:
Browser.getDefaultSession().displayPage("http://appworld.blackberry.com/webstore/content/2360/?lang=en");
Above code will invoke the browser in the application and open the BlackBerry App World, I tested it in device and it's perfectly working. For now I put a Whats App messenger link, but you can customize the link according to your requirement.
You can open App World from your BB application directly using the following code. This code avoids opening the browser first.
Registry registry = Registry.getRegistry(this.getClass().getName());
Invocation invocation = new Invocation(null, null,
"net.rim.bb.appworld.Content",
false, ContentHandler.ACTION_OPEN);
invocation.setArgs(new String[] { /* app id in appworld */ });
registry.invoke(invocation);
Related
Hi I have a requirement in my app. From my ios Application(myapp),i share a link to facebook. Then I opened up my facebook account in browser or Facebook application and clicked the link, link should open in myapp if myapp is installed in the device otherwise link should open in browser. How can I achieve this ? Please suggest me step by step. Thanks in advance for your consideration and help.
I am not sure if this is possible. I have looked at various questions including
Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?
as I am sure you might have already done but these questions target their own app, mainly web app, but you want that behavior to occur from an app that is not yours like twitter or facebook. But what you can do is show them two links on facebook/twitter, if they have installed press link 1 and if they want to install, press link 2 and you can pass parameters in link 1 as you might already know.
I will also keep checking answer of this question if some one comes and gives a better solution.
There is an option called custom URL scheme in iOS. It will help you to create a URL scheme which identifies your application. You can post link with this URL scheme and when you tap on this link on your iOS device it will open up your mobile app. Please see the link below to know how to setup this.
Custom URL Scheme in iOS
This is called 'deep URL linking'. Facebook have built a service called 'App Links', which seems pretty cool.
https://developers.facebook.com/docs/ios/app-links
I am making a personal website with a link to a Facebook profile. If you go to the website from iOS device, I would like the link to open in application, not safari, because a lot of people are not logged-in in safari.
Now this can be done by using "fb://profile/" instead of the link facebook.com/. And I have used following simple code to switch the links:
$(function(){
var iOS = ( navigator.userAgent.match(/(iPhone)/g) ? true : false );
if (iOS){
var href= $(".fb-link").attr("href");
var res = href.split("/");
var username = res[res.length - 1];
$(".fb-link").attr("href", "fb://profile/" + username);
}
});
The only problem is when user does not have the app, then it not only won't open in an app but will fail to open completely.
Is there a way to test if the app is installed? I know when I am programming in the iOS native app I can test if fb:// responds and then I can use the link, but the safari is way more limited. I know it probably won't be possible, just trying if anybody has some experience with this.
Also - is there something similar for android? I don't have much experience with that.
Thanks
There's no way in Safari (from a webpage) to determine whether an app is installed or not. The only thing you can try to do is do the fb://profile redirect in javascript, and then set a timeout on your page to see if the redirect succeeded or not. But this is not optimal as there can be error dialogs that pop up.
For Android, you should just go to the www url, and let the Android app handle it via its own intent filter.
This is my first time create an ios application that required deep linking. I need to create a web service for my custom url scheme for ios in order to publish it online. Please give some pointer on regarding which web service i should use or is there an alternative way to create a deep linking for custom url scheme for iOS. Thanks.
You can do it yourself with any server platform - Rails, PHP, Dot.Net, etc.
Here is a very simple PHP snippet. Replace "myappname" with your app's URL scheme. The param/value query is optional - you can use any other text and parse it in your App Delegate's openUrl method.
if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone OS') !== FALSE) {
// redirect
header("location: myappname://?key=value");
exit();
}
Client use-cases:
iOS Safari, your app installed - will open your app.
iOS Safari, your app not installed - Safari will complain that it cannot open the link.
Another iOS app, your app installed - will switch to your app.
Another iOS app, your app not installed - same as Safari. However, if the other app is implementing UIApplication's canOpenURL: - it may gracefully take the user to the App Store, but it's up to the other app developer.
Any other device or browser - will continue to render the page, where you can add your html including AppStore links.
If you don't want to create the server code, you can use a tool I created for this purpose. You have it here:
http://www.uppurl.com/
It's mainly a short link tool that checks for user device and give him the right url based on his devices. With this tool you don't need to write any server code and it also takes care of different devices, operating systems and browsers.
Take care of Tal answer as latest versions of Chrome has changed the way to open app and now you need to provide a link in different format, they use something like "intent://..."
I've got an issue with an app builded on phonegap build (build.phonegap.com) on iOS with Phonegap 2.3.
I'm trying to open the native map application with this link :
<a id="gmap_image" href="">
</a>
The js code that sets the href attribute :
$("#gmap_image").href('http://maps.apple.com/?q='+$xml.find( "adresse" ).text());
I've seen that for opening native maps application with a link, i have to give an url based on maps.apple.com domain (Apple Map Links).
But when I click on the link, all that happens is that the page refreshes (and I don't know why it refreshes too because no code asks to do it).
Has someone an idea ?
Regards,
maybe it's too late, but i had the same issue.
Try this way:
$("#gmap_image").href('maps:q='+$xml.find( "adresse" ).text());
just change http://maps.apple.com/?q= into maps:q=
that works for me
You can launch the google Maps app on an iOS device using this header in the URL Scheme. comgooglemaps:// This is according to the developer documentation found here. https://developers.google.com/maps/documentation/ios/urlscheme
for example a web link to open the Google Maps app in iOS6 and get directions from New York to Washington DC would look like this.
Directions from New York, NY to Washington DC
Try this one
$('#map').bind('tap', function(){
var url = 'http://maps.google.com/maps?';
url += 'q=[place_name]'; //add ur querystrings
// open the native maps app by calling window location
window.location = url;
});
Unfortunately, this is a no-go on iOS 6, since Google maps is no longer "natively" part of the OS.
Though you can still launch Apple Maps, since this is supported natively.
If you are using one of the latest PhoneGap/Cordova versions, it seems that it's not longer possible to open safari or maps from standard "a href=xxx" tags.
In order to open maps, you will need to attach a click event and open the link using:
window.open('http://maps.apple.com/?q=whavever', '_system');
within Phonegap, window.open() will open a link with a new in app browser, but, if you specify '_system' as the second param, it will send the URL to the OS (thus, opening the maps app in this situation).
I am working on an app for blackberry(jre 6.o & os 7.x) using browse field and app is working fine. One thing I want that, when click on a link in app and link url(domain) is different from the url which is invoked in app using browse field, open link in native blackberry browser. Please help me how to do this. Thanks.
You can extend ProtocolController class and override its handleNavigationRequest() method to do a custom implementation.
usage-
oBrowserField.getConfig().setProperty(BrowserFieldConfig.CONTROLLER,
new CustomProtocolController(oBrowserField));
Where oBrowserField is BrowserField instance
And CustomProtocolController is custom class extending ProtocolController