简体   繁体   中英

is it possible to Use App actions with Cordova

Is it possible for App actions and intents to be used through Cordova? I have a Cordova app and would like to utilize the App actions for android devices as conversational actions is being depreciated. would it be possible to make a Cordova plugin to do this, or is there a more simple approach?

thanks.

This should be possible, after all, all you need to do is declare the app actions in shortcut.xml resource file of your Android app.

<shortcuts>
    <capability android:name="actions.intent.ORDER_MENU_ITEM">
        <intent
            android:action="android.intent.action.VIEW"
            android:targetPackage="com.example.app"
            android:targetClass="com.example.app.browse">
            <parameter
                android:name="menuItem.name"
                android:key="query">
            </parameter>
        </intent>
    </capability>

Now you probably need to craft a small plugin so that the values here

 android:action="android.intent.action.VIEW"
 android:targetPackage="com.example.app"
 android:targetClass="com.example.app.browse"

Are overwritten by Cordova and point to the proper package and class, and also be able to callback some JS so your app can go to the proper "page". But no, there is nothing available yet.

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