iOS - Opening Search App programmatically - ios

I would like to know how it is possible to search something on iOS devices programmatically (Spotlight?) using Universal links or direct methods (native code) to open the search app like on Android.
In my Android app I have
String string = query;
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
intent.setPackage("com.google.android.googlequicksearchbox");
intent.setClassName("com.google.android.googlequicksearchbox", "com.google.android.googlequicksearchbox.SearchActivity");
intent.putExtra("query", string);
activity.startActivity(intent);
This code performs a search that sometimes allows assistant-like results with the possibility to open relevant apps or the web browser and so on.
I think also iOS have this feature. How to do that?

You can make your app searchable with Siri, but you cannot, in code, trigger a Siri search.

Related

How to choose and open available navigation app from Xamarin iOS?

I have the following code to open Navigation App from one of the button click in my content page.
var location = new Location(Convert.ToDouble(jobItem.Latitude), Convert.ToDouble(jobItem.Longitude));
var options = new MapLaunchOptions { NavigationMode = NavigationMode.Driving };
await Map.OpenAsync(location, options);
There are Google Maps and Waze in my android phone, so the code above did show the selection panel and let user to choose which app to use which is no issue. However, when this meet iOS, it straight away open Apple Maps without any selection even though there are 3 navigation apps in the iPhone. I have tried to research to deal with the default navigation app setting on iOS but unfortunately iOS didn't provide any single option to set the app as default unlike android. What else I can do?
You could use the Xamarin.Essentials: Launcher NuGet package.
You'd need to modify the code to look something like the below pseudocode
var supportsWaze = await Launcher.CanOpenAsync("whateverTheWazeUriSchemeIs://");
var supportsGoogleMaps = await Launcher.CanOpenAsync("whateverTheUriSchemeIs://");
You'd then need to give the user some sort of UI for them to select a mapping app based upon these boolean(s) being true. I'd use an ActionSheet
Then you can use the await Launcher.OpenAsync method to open the correct URI based on whatever choice the user made. You could offer them the option to remember this choice for later as well.
iOS wont allow you to override the OS default apps, but within your own app you can choose how other applications are launched. The Google applications are a good example of this.

Url scheme for making WhatsApp call programmatically from iOS app (voice call VOIP)?

I have referred How can I place a WhatsApp call from an iOS app? which states that this feature is currently not available in iOS and as per WhatsApp FAQ Share Extension (Custom URL Scheme) it has still not mentioned any schema for placing a call, document it has mentioned:
Placing a WhatsApp call(voice call VOIP)
To make a WhatsApp call, simply open the chat with the person you want to call and tap Call in the top right corner.
Whatsapp FAQ Here
But placing a WhatsApp call from android is possible, Which I could not find in iOS.But placing WhatsApp call feature is available from phone contacts.
So my doubt is whether it is currently available in iOS to place a WhatsApp (voip)voice call from my iOS app?
If possible can you please suggest me with url schema(if available) for this just like place a chat from my app like this #"whatsapp://send?text=Hello%2C%20World!" as I couldn't find this?
I have google it and searched a lot on stackoverflow and https://faq.whatsapp.com
Seems like currently, video call from contact book feature is limited to OS level only.
But you can open particular contact then user has to manually tap on video call button.
This is regardless of phone no is stored in contact book or not. ( You can directly open )
I have tried this in Swift 3 code.
if #available(iOS 10.0, *) {
UIApplication.shared.open(NSURL(string: "whatsapp://send?phone=+91phonenumber")! as URL)
} else {
UIApplication.shared.openURL(NSURL(string: "whatsapp://send?phone=+91phonenumber")! as URL)
}
https://faq.whatsapp.com/en/iphone/23559013
Hope this helps you to figure out further way

App with custom URL callback and custom search URL

I'm looking for recommendations for an iOS barcode scanner app. Specifically for iPad which will support a custom URL callback to enable the app to be launched from a web browser.
Additionally, it needs to support and a custom search URL which will send the user back to the website once the barcode has been decoded into a URN (SKU).
I have discovered ZBar which is an excellent app, unfortunately it doesn't support custom URL callback and it's designed for the iPhone.
Another app pic2shop PRO seems to tick these boxes, but it's relatively expensive at £10.49 and the setup will require somewhere in the region of 200 installs.
I did a similar project using the free version of pic2shop . The thing is that the free version can read only these types of barcodes : UPC-A, UPC-E, EAN-13, EAN-8 , according to the documentation of the app.
Pic2shop is a free barcode scanner app available for iOS® and Android®. It reads UPC-A, UPC-E, EAN-13, EAN-8 and QR codes. The app also display comparison shopping results for UPC and EAN.
From my personal experience, I can say that it scans and decodes the barcode very fast and very accurate.
In my project the app is launched from a webpage, it works for both android and ios. In order to get it working you have to invoke the pic2shop app from a url and then set your callback address. You will find the decoded barcode data as a value to a parameter in the callback url. To help you more, you can get those values using this javascript function found here.
For example:
<input type=button OnClick="scan();" value="Scan Barcode">
<script>
function scan(){
window.location="pic2shop://scan?callback=http://yourwebsiteurl.com/index.html?barcode=ean"
}
</script>
As soon as the item is successfully scanned it will redirect you to the callback url with the actual barcode number as a value to a parameter. For example http://yourwebsiteurl.com/index.html?barcode=5123548745123. I already told you how to get the value of a url parameter with javascript.
PDF417.mobi Pro barcode scanner app supports that use case.
Note: I'm a developer on that project.
Basically, the app can be launched from any other app, including a web application, when url in the form: pdf417://scan?type=PDF417,UPCA&callback=myscheme://myaction is launched.
The app then scans the barcode, in multiple formats, (PDF417 and UPCA in this example), until the result is obtained.
Then, the app opens the URL myscheme://myaction. In your case, this can be your web service, http://www.somemyscanner.com/service.
Specifically, it will open the URL using format: http://www.somemyscanner.com/service?data=[data]&type=[type].
You can then use those parameters to implement your desired functionalities.
I tried the PDF417 app and it is EXTREMELY expensive (for an app - $28) and does not work. I bought it anyway because I am trying to solve the same issue and I can tell you it is not the solution for general barcode scanning.
It might work with pdf417 barcodes, but those are few and far between and I haven't been able to get it to work. I definately does not support any standard barcode formats. It also has no settings panel (in settings) and the tap target in the app that should be settings just take you to the company web site.
I am still testing other apps but haven't found any app that does what you ask, Red Laser used to but it no longer has that functionality.

Web service for deep linking

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://..."

iOS: Adding a Facebook Like button to a native iPhone app

I would like to know whether it is possible to add a Facebook Like button to a native iPhone app. In the app, the user browses a business directory or deals. When they tap on an item to view the details, it would be nice to have a Facebook Like button that can be used to post the item to the user's Facebook page.
Facebook writes: "Currently, the Like button is only available in mobile web apps".
My app is a native app and not a web app, so therefore I assume it's not possible. However, I do assume that it is possible to mix native UI components on a screen along with web components and therefore it might be possible to implement the Like button, although I am not sure how you pass data from the native portion to the web portion.
If the only solution is a hack, then I won't implement it because at some point the hack will fail when Facebook alters their API.
read around SO a little, you get many leads. Here's one:
Like button in iOS application
And a comment points to github.com/brow/FacebookLikeView
It has same caveats, but it seems there aren't any magic solutions.
There are these blogposts as well:
http://angelolloqui.blogspot.com/2010/11/facebook-like-button-on-ios.html
http://petersteinberger.com/2010/06/add-facebook-like-button-with-facebook-connect-iphone-sdk/
But not sure you get a native UIButton. Maybe you can open a webview in the background and emulate a click on it...
GL, update if you have some findings,
Oded.
Now you can use the FBlike button using the following code but it need to download latest sdk and it is the beta version :(
Here is the code:
[FBSettings enableBetaFeature:FBBetaFeaturesLikeButton];
[FBSettings enablePlatformCompatibility:NO];
FBLikeControl *like = [[FBLikeControl alloc] init];
like.objectID = #"http://shareitexampleapp.parseapp.com/photo1/";
like.likeControlHorizontalAlignment=FBLikeControlHorizontalAlignmentRight;
like.likeControlStyle=FBLikeControlStyleBoxCount;
[self.view addSubview like];
It looks like Facebook finally decided to allow this, more directly, via the Open Graph API.
See documentation here
Check this out, FB just made it possible through their SDK. Only for testing and ios for now
https://developers.facebook.com/docs/ios/like-button/

Resources