[问题] 推播没设定音效问题

楼主: yatin1116 (充实过每一天)   2024-10-05 10:42:44
因为FCM改版,改版推播有设定音效,但上架google play下载的APP安装部分手机还是没依据我设定
我设的音乐档,但没音乐的程式compiler到手机 测试是有音乐的耶!
我抓不到问题有android13、14手机不行,但也有android14可以
Root rootObj = new Root();
rootObj.message = new Message();
rootObj.message.token = "xxxx"; // FCM Token id
// Data payload
rootObj.message.data = new Data();
rootObj.message.data.title = "test";
rootObj.message.data.body = "test me";
rootObj.message.data.key_1 = "Sample Key";
rootObj.message.data.key_2 = "Sample Key2";
// Android-specific notification payload
rootObj.message.android = new Android();
rootObj.message.android.priority = "high"; // 设定优先级为 high
rootObj.message.android.notification = new AndroidNotification();
rootObj.message.android.notification.title = "test";
rootObj.message.android.notification.body = "send data20241004";
rootObj.message.android.notification.sound = "pushmusic2"; //
Sound file in Android app's raw folder
rootObj.message.android.notification.channel_id = "xxx"; //
Notification channel I

Links booklink

Contact Us: admin [ a t ] ucptt.com