-
-
Notifications
You must be signed in to change notification settings - Fork 469
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
(iOS) SyntaxError in plugin JS console messages #401
Comments
I can repro this issue: For example, an expected log message would be: console.log("FirebasePlugin[native]: didReceiveRemoteNotification: {\
aps = {\
\"content-available\" = 1;\
};\
\"gcm.message_id\" = 1589924900140911;\
\"key_1\" = \"Data for key one\";\
messageType = data;\
\"notification_body\" = \"Data message body\";\
\"notification_foreground\" = true;\
\"notification_ios_badge\" = 1;\
\"notification_ios_sound\" = \"blackberry.caf\";\
\"notification_title\" = \"Data message title\";\
}") but the actual string being generated is: console.log("FirebasePlugin[native]: didReceiveRemoteNotification: {
aps = {
\"content-available\" = 1;
};
\"gcm.message_id\" = 1589924900140911;
\"key_1\" = \"Data for key one\";
messageType = data;
\"notification_body\" = \"Data message body\";
\"notification_foreground\" = true;
\"notification_ios_badge\" = 1;
\"notification_ios_sound\" = \"blackberry.caf\";
\"notification_title\" = \"Data message title\";
}") i.e. no escaping backslashses at the end of lines, resulting in the console error |
…sent from native iOS implementation to JS console. Resolves dpa99c#401.
@dpa99c I tried your fix but it doesn't seem to work fully I get: |
…sent from native iOS implementation to JS console. Resolves #401.
@dpa99c the fix doesn't work I am getting: |
I will look at it again when I have some time |
@EchoNox It looks like your keys are wrapped in single quotes:
which is invalid JSON. Hence the Firebase Admin SDK will not allow a message to be sent containing single-quoted keys so I'm unable to reproduce your issue. Can you confirm whether your keys are double-quoted or single-quoted? |
I believe this is resolved by #430 |
My configuration:
Model: iPhone X
Version: iOS 13.4.1
Model: MacBook Pro 13
Version: 10.15.4
Cordova 9.0.0 (cordova-lib@9.0.1)
cordova-custom-config 5.1.0 "cordova-custom-config"
cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
cordova-plugin-androidx-adapter 1.1.1 "cordova-plugin-androidx-adapter"
cordova-plugin-customfcmreceiver 1.0.0 "Custom FCM Receiver"
cordova-plugin-dialogs 1.3.2-dev "Notification"
cordova-plugin-enable-multidex 0.2.0 "Enable Multidex"
cordova-plugin-firebasex 9.1.1 "Google Firebase Plugin"
cordova-plugin-whitelist 1.3.4 "Whitelist"
Xcode Version 11.4.1
Problem:
After receiving message i get error on console: SyntaxError: Unexpected EOF. I am sending message using:
npm run-script send -- --message=ios_data_notification.json --token="..."
I was trying also versions 8.0.1, 9.1.1-cli, compiling from xcode and xcodebuild, still the same error.
The text was updated successfully, but these errors were encountered: