[ios] fixed messaging getToken, listen/unlisten token refresh
This commit is contained in:
parent
6d52b6d4d3
commit
cd4664fb68
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue