Android assistant - MediaBrowserService - Voice command - “Play x on appName”

…衆ロ難τιáo~ 提交于 2020-07-30 01:53:08

问题


The voice commande Play [song] on [my appName] command not working, the "appName" is not being recognised by google assistante.

I followed the instruction form https://developer.android.com/guide/topics/media-apps/interacting-with-assistant and the demo app form https://github.com/android/uamp

My AndroidManifest:

    <application
android:name=".XApplication"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" // app_name = appX 101.1
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="false"
android:theme="@style/AppTheme">

     <activity
        android:name=".ui.splash.SplashActivity"
        android:exported="true"
        android:launchMode="singleTop"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme.AppFullScreenTheme"
        android:windowSoftInputMode="adjustPan|stateHidden">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
...
...
    <service
        android:name="com.music.android.xx.media.MusicService"
        android:enabled="true"
        android:exported="true"
        tools:ignore="ExportedService">
        <intent-filter>
            <action android:name="android.media.browse.MediaBrowserService" />
        </intent-filter>
    </service>
<service
    android:name=".service.LocationUpdatesService"
    android:foregroundServiceType="location" />

<receiver android:name=".service.StopServiceReceiver" />
<receiver android:name=".service.PlayRadioReceiver" />

<service
    android:name=".service.MyFirebaseService"
    android:exported="false">
    <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT" />
    </intent-filter>
</service>

I have a problem figuring out what I did wrong or what I missed . Any help will be greatly appreciated..

PS: My app had been in the store for 4days and my App Name have numbers in it like "appX 101.1" (i'm worried that this may be an issue)

来源:https://stackoverflow.com/questions/62771616/android-assistant-mediabrowserservice-voice-command-play-x-on-appname

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!