-
Notifications
You must be signed in to change notification settings - Fork 989
New issue
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
cordova-plugin-fcm Error: Invalid data, chunk must be a string or buffer, not object #501
Comments
plz remove the platform and add the platform , if it is not working kindly add the below code in your plugins\cordova-plugin-fcm\scripts\fcm_config_files_process.js var fs = require('fs'); fs.ensureDirSync = function (dir) { var config = fs.readFileSync('config.xml').toString(); var IOS_DIR = 'platforms/ios'; var PLATFORM = { // Copy key files to their platform specific folders function updateStringsXml(contents) {
} function copyKey(platform, callback) {
} function getValue(config, name) { function fileExists(path) { function directoryExists(path) { |
@ragulra pasting the code it works! All the pathnames were wrong! |
I also have this problem. cordova-plugin-fcm/scripts/fcm_config_files_process.js:80:24 |
Very helpful, it made it work, finally after spending few hours - thanks a lot! |
Not working for me still. |
By the way i suggest to use this plugin https://ionicframework.com/docs/native/firebase/. I've switched to firebase plugin instead of fcm and it works better! |
I am going to give it a try right now. |
I have solved this issue by changing the code in line 80 of fcm_config_files_process.js |
Thank you so much! |
thanks @robyroad your solution my help to find a solution to a similar error |
Yes, It is absolutely working fine. But, when we are getting registered token using cordova-plugin-fcm then it fails. I am unable to get registered token for sending push notification. Any idea about this? |
For me it was an empty platform\ios folder that caused this error. cordova build browser --verbose to get a more detailed error message. |
Thank you so much |
Yeah, that code pasted in seems to fix this issue. Quite odd error message that you would not think would be fixed by changing the target paths. I have forked and updated this file. Feel free to use this one:
|
Thanks regula, but I do not understand what I have to past. The are formated code and code as text. Or should I clear the content of fcm_config_files_process.js and copy your code from
to
Why the plugin is not updated? |
the cordova-plugin-fcm look to be very annoying. I added the plugin and I modfied the line
As @alijaved59 wrote. However, now when I run android to my devise
I have go so many errors:
and
and
Note:
If I remove cordova-plugin-fcm, I can run the command
What hapen with gradle? |
when i add this plugin cordova-plugin-fcm then arise this error in cordova
cordova plugin add cordova-plugin-fcm
Installing "cordova-plugin-fcm" for android
Android Studio project detected
Subproject Path: CordovaLib
Subproject Path: app
Adding cordova-plugin-fcm to package.json
Saved plugin info for "cordova-plugin-fcm" to config.xml
Error: Invalid data, chunk must be a string or buffer, not object
plz help
The text was updated successfully, but these errors were encountered: