小编P. *_*era的帖子

unity firebase 通知自定义图片

我决定在我的统一项目中实施 Firebase 通知。问题是对于通知,我想使用自定义图像,但该图像也用作应用程序图像 (app_icon)。我试图修改我放入 MessagingUnityPlayerActivity 活动自定义通知图像(notificon)以显示通知图标的清单。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="${applicationId}"
          android:versionCode="1"
          android:versionName="1.0">
  <application android:label="@string/app_name"
               android:icon="@drawable/app_icon">
    <!-- The MessagingUnityPlayerActivity is a class that extends
         UnityPlayerActivity to work around a known issue when receiving
         notification data payloads in the background. -->
    <activity android:name="com.google.firebase.MessagingUnityPlayerActivity"
              android:label="@string/app_name"
              android:icon="@drawable/notificon"
              android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
    <service android:name="com.google.firebase.messaging.MessageForwardingService"
             android:exported="false"/>
  </application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

我试图修改它并删除一些标签,但随后构建无法编译。我还应该提到我的项目中有多个清单,并尝试将它们合并在一起但没有成功。但这不应该是问题,因为这是 android:icon 属性的唯一清单。

谢谢

icons unity-game-engine firebase firebase-cloud-messaging

5
推荐指数
2
解决办法
3401
查看次数