【发布时间】:2019-04-25 15:33:06
【问题描述】:
我使用 cordova-plugin-fcm-with-dependency-update 更新了 FCM 插件,但在 getToken() 上出现错误
Uncaught (in promise): TypeError: Object(...) is not a function TypeError: Object(...) 不是函数
【问题讨论】:
我使用 cordova-plugin-fcm-with-dependency-update 更新了 FCM 插件,但在 getToken() 上出现错误
Uncaught (in promise): TypeError: Object(...) is not a function TypeError: Object(...) 不是函数
【问题讨论】:
在 ionic.config.json 文件中检查您的项目类型。
如果类型是“ionic-angular”,则安装4.x.x版本。
npm i -s @ionic-native/firebase@4.20.0
如果类型是“angular”,则安装5.x.x-beta版
npm i -s @ionic-native/firebase@5.0.0-beta.24
注意:
仅当您使用 Angular 6
时,才在导入结束时添加 ngximport { Firebase } from '@ionic-native/firebase/ngx';
如果不从 app.module.ts 和 app.component.ts 中的导入中删除 ngx
import { Firebase } from '@ionic-native/firebase';
在此之后,您遇到了问题,请随时在这里写。
【讨论】: