I want to play some other sound like an alert one on receiving a notification.Is it possible yet as it is the most basic functionality?Below is my code:
const receipts = expo.sendPushNotificationsAsync([ { to: userObj.pushToken,
sound: 'default', body: notification, data: { withSome: notification }, priority: 'high' } ]);
Expo push server does not support custom sounds. It will swallow whatever you place in the sound field and replace it with default. Attempting to work around their module using the expo service from curl will give you an actual error.
However, custom sounds are possible in expo clients when using your own APNS module server side if the sound is bundled within the .ipa upon delivery to App Store.
Related
I’m trying to get Facebook Login working using the expo-facebook package (I'm using the Managed Workflow)
I created my application in the Facebook Developer Console and copied the “App ID”.
This is the code I'm using inside my React Native Expo app:
async facebookLogin() {
await Facebook.initializeAsync('26327628297297')
const response = await Facebook.logInWithReadPermissionsAsync({ permissions: ['public_profile']})
console.log(response)
}
My understanding is that while using the Expo Client App there is no need to do any extra configuration because it will be using Expo’s Facebook App ID for all API calls.
The problem is that after logging in I get this error message:
Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App’s settings. To use this URL you must add a valid native platform in your App’s settings.
I also tried added “facebookScheme” to my app.json but that didnt seem to help:
"facebookScheme": "fb26327628297297",
Thanks for your time!
Actually you just have to add platform in your app settings
So here are the steps
Open https://developers.facebook.com and select your app
Settings > Basic > Add Platform
use host.expo.Exponent as bundle id
3.Now select iOS from the window and add your Bundle ID and rest of the information and click on Save changes
and that's it.
Hope it helps you .. All the best
I am using EXPO on a react native project and want to ask the user for push notification permission.
When I use the const {status} = await Permissions.askAsync(Permissions.NOTIFICATIONS); the message that appears is
"Expo" would like to send you notifications. Notifications may include sounds, badges, alerts and icon badges. These can be configured in settings.
My end user doesn't know what "Expo" is, they just know the app name. Is there a way for me to customize the "Expo" part to the app name?
How have people handled this when their app is ejected and push to the app store?
You can find the answer in here: https://docs.expo.io/distribution/app-stores/?redirected
Which says:
System permissions dialogs on iOS
If your app asks for system permissions from the user, e.g. to use the device's camera, or access photos, Apple requires an explanation for how your app makes use of that data. Expo will automatically provide a boilerplate reason for you, such as "Allow cool-app to access the camera", however these must be customized and tailored to your specific use case in order for your app to be accepted by the App Store. To do this, override these values using the ios.infoPlist key in app.json, for example:
"infoPlist": {
"NSCameraUsageDescription": "This app uses the camera to scan barcodes on event tickets."
},
The full list of keys Expo provides by default can be seen here. Unlike with Android, on iOS it is not possible to filter the list of permissions an app may request at a native level. This means that by default, your app will ship with all of these default boilerplate strings embedded in the binary. You can provide any overrides you want in the infoPlist configuration. Because these strings are configured at the native level, they will only be published when you build a new binary with expo build.
You probably use Expo Go to develop your app , when you create standalone app (when you deploy the apk) it will show the app name that you specified in app.json.
I'm trying to using push notifications using ConnectyCube on React Native. Main problem is that if I send a notification from the admin panel of ConnectyCube (or from source code), the admin panel says that the notification has been successfully delivered, but nothing happens on the android emulator. Maybe someone can think that there are some bugs client-side in the implementation of my onMessageListener:
notificationListener = firebase.notifications().onNotification((notification) => {
console.log("Hi!")
});
Anyway, if I try to send a notification through the Firebase console, all works and I receive the notification. Can you help me?
It seems that you are using a wrong method: https://rnfirebase.io/docs/v5.x.x/notifications/introduction
The React Native Firebase Notifications Module deals with notification-only and notification + data FCM remote messages.
For data-only FCM messages please see the Messaging module.
ConnectyCube sends a data push messages.
Therefore, please try using Messaging module according to this guide:
https://rnfirebase.io/docs/v5.x.x/messaging/receiving-messages
Using the cordova-plugin-firebase plugin, I can only get device notifications via the Google Firebase console, and not through the server http API.
APP: cordova (6.4.0) default app, not changed, with plugin cordova-plugin-firebase (0.1.21) added.
Steps to reproduce
Download APP to device (android phone)
Start APP (seems like this is required to register this app with the phone)
Close APP
Send message from server through FCM http API
{ notification:
{ title: 'Notification Test',
body: 'Notification Test Body Text' },
to: '/topics/all',
priority: 'high' }
Device does not receive/show a notification was received.
Is there a bug in the server script?
No. If I replace cordova-plugin-firebase with cordova-plugin-fcm, then the device (and APP) receive notifications through the API just fine.
Why not just use cordova-plugin-fcm then?
cordova-plugin-fcm is not well maintained, and I would like to use the Analytics in cordova-plugin-firebase
I am using GCM to deliver notifications to Android and iOS devices.
What I am looking for is to send in the same downstream message a silent push for both platforms.
I have tried with this message
"content_available":true,
"data":
{
//My data here
},
As you can see, no notification key is sended, iOS works fine and we are receiving push in the background but Android shows my app icon at the top bar and it is not calling the GCM receiver.
If I set content_available to false, Android works fine but not in iOS (either background or foreground).
What I supposed to do? Send to my server the OS of each device and send a different message for each system?
I have also tried to set aps dictionary in data payload, but still the same.
Thanks in advance.