react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
734 stars 282 forks source link

No sound or vibration onto new notifications in Iphone XS #296

Open Bad-Listener opened 3 years ago

Bad-Listener commented 3 years ago

Hello all!

I have setup the package, following all instructions. I am coming here from react-native-push-notifcation (everything was working perfectly but had to update and use this package for iOS), and just started using this module for iOS notifications

I can receive notifications in every app state (foreground, background, app closed) and act on them perfectly.

The only thing that does not happen is vibration or sound when the notification comes in device...

I double checked that I followed every instruction. I am referring to remote notifications from Firebase.

Please help!

AsABarranco commented 2 years ago

+1

Critically commented 2 years ago

+1 iPhone 5S

showtan001 commented 1 year ago

Set 'sound' when sending a message

Arkan4ik commented 1 year ago

@showtan001 where need to add this 'sound'? could you explain please?

SumDanil commented 6 months ago

I am using firebase_admin in python3. Here is an example of how to send an ios notification with a sound

from firebase_admin import credentials, messaging

firebase_admin.initialize_app(credential=cred, name=app) message = messaging.Message( notification=messaging.Notification( title=title, body=message, ), android=messaging.AndroidConfig( notification=messaging.AndroidNotification( channel_id=CHANEL_ID.get(service) ) ), apns=messaging.APNSConfig( payload=messaging.APNSPayload( aps=messaging.Aps( sound=messaging.CriticalSound( name='default' ) ) ) ), data=data, token=token, ) firebase_response = messaging.send(message, app=firebase_admin.get_app(app))