简体   繁体   中英

iOS - Opening Search App programmatically

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM