Ad

Firebase Native Is Conflicting With Firebase JS In Ionic3 App ( Push Notifications Enabling Issue)

- 1 answer

I want to use firebase chatting with push notifications. I purchased a code sample for this and no plugin conflict is there in that piece of code. I am having a plugin conflict of Firebase native with a red line below. I am attaching a screenshot of the code

I tried removing the node_modules folder. Remove platform Android. Adding it again. running command npm I for installing node_modules folder again. The problem remains the same

Push notifications should work. Right now messaging is working perfect but when I try to enable push notifications the plugin conflict comes in

import { Firebase } from '@ionic-native/firebase';
import { AngularFirestore } from 'angularfire2/firestore';
import { UserProvider } from '../../providers/user/user';
import firebase from 'firebase';
import { config } from '../../app/app.angularfireconfig'
@Injectable()
export class FcmProvider {
userId;
fireuserStatus = firebase.database().ref('/userstatus');

constructor(
public userservice: UserProvider,
private http: Http,
public afs: AngularFirestore,
public firebaseNative: Firebase
) {
}
Ad

Answer

Finally I solved it myself. I am answering it lets hope it helps someone. Just downgrade the Firebase plugin to version 4.20.0. It won't ask you for adding /ngx at the end and you can use firebase by staying in ionic3

ionic cordova plugin add cordova-plugin-firebase npm install @ionic-native/[email protected]

Run these commands and your problem will be solved.

Ad
source: stackoverflow.com
Ad