Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push notifcation custom sound stopped working

I have live app in app store which uses firebase fcm to send push notification using firebase cloud function. On arrival of push notification app plays custom sound provided in main bundle of xcode. But since last 24 hours app not playing custom sound for push notification on ios devices but its playing default iphone notfcation sound. On android devices its playing custom sound.i did not change sound file nor i update any code. The app is live in app store since months and suddenly stopped playing custom sound. Velow is the code of my payload. Waiting for your help.

const payload = {

      notification: {

          title: 'New Orderد',
          body: 'New Order in '+storename,
          badge: '1',
          sound: 'mergedrequest.mp3',
          android_channel_id: 'driverrequestsoundchannelid'

      }
like image 681
Request Logistic Avatar asked Aug 12 '20 19:08

Request Logistic


People also ask

Why is my custom notification sound not working?

Try these steps: Go to Settings > Sound & Notification > App Notifications. Select the app, and make sure that Notifications are turned on and set to Normal. Make sure that Do Not Disturb is turned off.

Why has my iPhone stopped making notification Sounds?

If you haven't set any alert tone for a specific app, the notification sounds not working on iPhone error is bound to occur. Follow the steps below to learn how to check the alerts: Open the iPhone Settings and tap on Sounds & Haptics. There, tap on Text Tone and check if the Alert Type is set to None.

How do I change the sound of the push notifications?

Modify the PushNotification call in handleAppStateChange (appState) function as follows: Where rush is the custom sound name. soundName – Value of 'default' plays the default sound.

How do I enable push notifications in React Native?

Add the following to your Project: node_modules/react-native/Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj Add the following to Link Binary With Libraries: libRCTPushNotification.a Finally, to enable support for notification and register events you need to augment your AppDelegate. At the top of your AppDelegate.m:

What is the field name for push notifications in FCM?

So for FCM, the field name is “android_channel_id”, but once the push is delivered to the Android device this field comes in as “channel_id”. FCM translates the field name correctly for us once its delivered. Hit the send button on Postman, you should receive the push with custom sound.

How do I test FCM push notifications on Firebase?

Before you can test it you will need to fish out Firebase’s FCM token from your app. This token is used by FCM to route the push notification to the correct device. Firebase lets you retreive the FCM token using the messaging ().getToken () function.


2 Answers

Answer from Firebase customer support:

Just to set expectations, this issue was just recently identified as a bug with our Legacy API that’s not properly handling the custom sound for iOS. Our engineering team has identified the fix for this issue, and we couldn’t provide a definite timeline at the moment for the release in our production. For now, you might consider using our HTTP v1 API to send your messages.

like image 80
Certitude Avatar answered Oct 07 '22 02:10

Certitude


I had the same issue and migrating to HTTP v1 API worked for me

https://firebase.google.com/docs/cloud-messaging/migrate-v1

like image 42
SKim Avatar answered Oct 07 '22 01:10

SKim