Please provide the following:
- SDK Version: 42
- Platforms(Android/iOS/web/all): Android
Summary
Hey guys i’m trying to integrate expo notifications in my managed app.
I created a custom client since we are using libraries with native code.
I installed expo notifications.
followed the instructions in the link bellow for android
I am able to get a push token but i’m getting the following response
“data”: Object {
“details”: Object {
“error”: “InvalidCredentials”,
“fault”: “developer”,
“fcm”: Object {
“httpStatus”: 401,
“response”: "
INVALID_KEY_TYPE
Error 401
", }, }, "id": "35b0c8a9-c62a-40f4-a4d8-b5872b121c65", "message": "Failed to authenticate with the FCM server. Ensure the FCM server key you uploaded is correct.", "status": "error", }, }“Unless you’re still running your project in the Expo Go app, Firebase Cloud Messaging is required for all managed and bare workflow Android apps made with Expo.”
app.json
{
“expo”: {
“name”: “EventShare”,
“slug”: “EventShare”,
“version”: “0.1.0”,
“orientation”: “portrait”,
“icon”: “./assets/1024.png”,
“splash”: {
“image”: “./assets/splash.png”,
“resizeMode”: “contain”,
“backgroundColor”: “#ffffff”
},
“androidStatusBar”: {
“backgroundColor”: “#ffffff”,
“translucent”: true
},
“updates”: {
“fallbackToCacheTimeout”: 0
},
“assetBundlePatterns”: [“**/*”],
“ios”: {
“supportsTablet”: true,
“userInterfaceStyle”: “dark”,
“infoPlist”: {
“NSCameraUsageDescription”: “This app uses the camera to take pictures, videos and scan barcodes on from other users.”
},
“bundleIdentifier”: “com.simplyrem.GalleryShare”,
“buildNumber”: “1.0.8”,
“icon”: “./assets/1024.png”
},
“android”: {
“jsEngine”: “hermes”,
“googleServicesFile”: “./google-services.json”,
“adaptiveIcon”: {
“foregroundImage”: “./assets/adaptive-icon.png”,
“backgroundColor”: “#FFFFFF”
},
"userInterfaceStyle": "dark",
"package": "com.simplyrem.GalleryShare"
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
managed
What platform(s) does this occur on?
Android, iOS
SDK Version (managed workflow only)
42
Environment
Expo CLI 4.7.3 environment info:
System:
OS: macOS 10.15.7
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.15.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.8.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6858069
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
npmPackages:
expo: ^42.0.0 => 42.0.0
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz => 0.63.2
react-native-web: ~0.13.12 => 0.13.18
npmGlobalPackages:
expo-cli: 4.7.3
Expo Workflow: managed
Reproducible demo or steps to reproduce from a blank project
- create a custom client
- install expo-notifications
- create Firebase Cloud Messaging file
- drop it in your projects root directory
- add “android”: {
“googleServicesFile”: “./google-services.json”,
…
} - rebuild custom client using eas build --profile development --platform android
- Run code to get expo notification token.