Closed malhajj closed 6 years ago
Interesting behavior. I just pushed a 1.0.1 prelrelease that could fix this issue, please try it out here.
Hi @hansemannn ,
We've checked version 1.0.1 and seems it stills not working or we are implementing it in a wrong way unless we followed these steps: 1- install both firebase-core and cloud-messaging developed by you. 2- from firebase console, create project, and enable notification and add the needed development certificate for APNS. 3- implement the below code for testing:
var firebase = require('firebase.cloudmessaging');
require('firebase.core').configure({
googleAppID: "*:**********:ios:************",
GCMSenderID: "*************" //Sender ID
});
console.log('deviceId ' + firebase.fcmToken);
firebase.addEventListener('didReceiveMessage', function (e) {
console.log('didReceiveMessage');
});
The result after pushing notification from FCM notification php script:
Thanks,
Hi @malhajj , @hansemannn
Same problem here.
Argh, same thing happening for me too. I've tried 1.0.1 and it's not working @hansemannn any ideas?
Sorry, no time for OSS support right now.
I just checked this again and compared it with the native implementation and docs. appDidReceiveMessage
is a method and should only be called manually, if Firebase method swizzling (enabled by default) is disable. If called, it should be done on the application: didReceiveRemoteNotification:
delegate.
The didReceiveMessage:
delegate is only called if enabled via the FIRMessaging
delegate, which is currently not done. Also note that you need to set setShouldEstablishDirectChannel
on the module to true
in order to receive direct messages. Also note that the event is iOS 10+ only and push notifications are still received via application:didReceiveRemoteNotification:
event which is handled via the usual notification events in Titanium.
I've updated the docs to reflect this native behavior.
We are willing to use this module, we make it work and start receiving notifications, but the issue was that both event listeners are not working or we are using them in a wrong manner due to lack of description
for example, we used the handler like that:
firebaseCloudMessaging.addEventListener("didReceiveMessage", function(e) {console.log(e);});
This handler was never triggered at all, the notification was received but with no handler.
Thanks for this great module, and your help on that is much appreciated