We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android
My index.js file:
import { AppRegistry } from 'react-native'; import Switch from './src/Switch'; import bgMessaging from './src/bgMessaging'; AppRegistry.registerComponent('******', () => Switch); AppRegistry.registerHeadlessTask('RNFirebaseBackgroundMessage', () => bgMessaging);
My bgMessaging file:
import firebase from './firebase'; import { RemoteMessage } from 'react-native-firebase'; export default bgMessaging = async(message) => { firebase.messaging().onMessage((message) => { firebase.firestore().doc(`Messages/${message.data.Doc_Id}`).get(); }); return Promise.resolve(); }
My AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.movny.movny" android:versionCode="1" android:versionName="1.0"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <application android:name=".MainApplication" android:allowBackup="true" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:theme="@style/AppTheme"> <service android:name="io.invertase.firebase.messaging.RNFirebaseBackgroundMessagingService" /> <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:windowSoftInputMode="adjustResize"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /> <service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> <service android:name="io.invertase.firebase.messaging.RNFirebaseInstanceIdService"> <intent-filter> <action android:name="com.google.firebase.INSTANCE_ID_EVENT" /> </intent-filter> </service> </application> </manifest>
My Build.gradle version :
compileSdkVersion 27 defaultConfig { minSdkVersion 18 targetSdkVersion 27 versionCode 1 versionName "1.0" }
Can anyone help me How to achieve this thing?
The text was updated successfully, but these errors were encountered:
I got the Solution,
import firebase from 'react-native-firebase'; import type {RemoteMessage} from 'react-native-firebase'; export default async (message: RemoteMessage) => { const GetData=firebase.firestore().collection(`Messages`).doc(`${message.data.Doc_Id}`).get({source:'server'}) return Promise.resolve(GetData); }
Sorry, something went wrong.
can you provide full code of that example.... coz I didn't got any solution
No branches or pull requests
Issue
Environment
Android
My index.js file:
My bgMessaging file:
My AndroidManifest.xml file:
My Build.gradle version :
Can anyone help me How to achieve this thing?
The text was updated successfully, but these errors were encountered: