[ios] fixed messaging getToken, listen/unlisten token refresh

This commit is contained in:
Salakar 2017-03-15 13:05:56 +00:00
parent 6d52b6d4d3
commit cd4664fb68
2 changed files with 6 additions and 6 deletions

View File

@ -41,9 +41,9 @@ static NSString *const STORAGE_DOWNLOAD_FAILURE = @"download_failure";
// Messaging
static NSString *const MESSAGING_SUBSYSTEM_EVENT = @"messaging_event";
static NSString *const MESSAGING_SUBSYSTEM_ERROR = @"messaging_error";
static NSString *const MESSAGING_TOKEN_REFRESH = @"messaging_token_refresh";
static NSString *const MESSAGING_TOKEN_REFRESH = @"RNFirebaseRefreshToken";
static NSString *const MESSAGING_MESSAGE_RECEIVED_REMOTE = @"messaging_remote_event_received";
static NSString *const MESSAGING_MESSAGE_RECEIVED_LOCAL = @"messaging_local_event_received";
static NSString *const MESSAGING_MESSAGE_RECEIVED_REMOTE = @"RNFirebaseReceiveNotification";
static NSString *const MESSAGING_MESSAGE_RECEIVED_LOCAL = @"RNFirebaseReceiveNotification";
#endif

View File

@ -29,7 +29,7 @@ export default class Messaging extends Base {
// TODO move to new event emitter logic
onMessage(callback) {
this.log.info('Setting up onMessage callback');
const sub = this._on('FirebaseReceiveNotification', callback, FirebaseMessagingEvt);
const sub = this._on('RNFirebaseReceiveNotification', callback, FirebaseMessagingEvt);
return promisify(() => sub, FirebaseMessaging)(sub);
}
@ -55,13 +55,13 @@ export default class Messaging extends Base {
//
listenForTokenRefresh(callback) {
this.log.info('Setting up listenForTokenRefresh callback');
const sub = this._on('FirebaseRefreshToken', callback, FirebaseMessagingEvt);
const sub = this._on('RNFirebaseRefreshToken', callback, FirebaseMessagingEvt);
return promisify(() => sub, FirebaseMessaging)(sub);
}
unlistenForTokenRefresh() {
this.log.info('Unlistening for TokenRefresh');
this._off('FirebaseRefreshToken');
this._off('RNFirebaseRefreshToken');
}
subscribeToTopic(topic) {