diff --git a/ios/RNFirebase/RNFirebaseMessaging.m b/ios/RNFirebase/RNFirebaseMessaging.m index 852273c8..c86855ee 100644 --- a/ios/RNFirebase/RNFirebaseMessaging.m +++ b/ios/RNFirebase/RNFirebaseMessaging.m @@ -410,9 +410,9 @@ RCT_EXPORT_METHOD(getBadgeNumber: (RCTPromiseResolveBlock)resolve rejecter:(RCTP RCT_EXPORT_METHOD(send:(NSDictionary *)remoteMessage) { int64_t ttl = @([[remoteMessage valueForKey:@"ttl"] intValue]).doubleValue; - NSString * mId = [[remoteMessage valueForKey:@"id"] stringValue]; - NSString * receiver = [[remoteMessage valueForKey:@"senderId"] stringValue]; - NSDictionary * data = [[remoteMessage valueForKey:@"data"] dictionaryRepresentation]; + NSString * mId = [remoteMessage valueForKey:@"id"]; + NSString * receiver = [remoteMessage valueForKey:@"sender"]; + NSDictionary * data = [remoteMessage valueForKey:@"data"]; [[FIRMessaging messaging]sendMessage:data to:receiver withMessageID:mId timeToLive:ttl]; } diff --git a/lib/modules/messaging/RemoteMessage.js b/lib/modules/messaging/RemoteMessage.js index ab5c2a66..b44a6cbb 100644 --- a/lib/modules/messaging/RemoteMessage.js +++ b/lib/modules/messaging/RemoteMessage.js @@ -6,7 +6,7 @@ export default class RemoteMessage { id: generatePushID(), ttl: 3600, // add the googleapis sender id part if not already added. - sender: sender.includes('@') ? sender : `${sender}@gcm.googleapis.com`, + sender: `${sender}`.includes('@') ? sender : `${sender}@gcm.googleapis.com`, type: 'remote', data: {}, }; @@ -27,7 +27,7 @@ export default class RemoteMessage { * @param id */ setId(id: string): RemoteMessage { - this.properties.id = id; + this.properties.id = `${id}`; return this; } @@ -37,7 +37,7 @@ export default class RemoteMessage { * @returns {RemoteMessage} */ setType(type: string): RemoteMessage { - this.properties.type = type; + this.properties.type = `${type}`; return this; } @@ -47,7 +47,7 @@ export default class RemoteMessage { * @returns {RemoteMessage} */ setCollapseKey(key: string): RemoteMessage { - this.properties.collapseKey = key; + this.properties.collapseKey = `${key}`; return this; } diff --git a/lib/modules/storage/reference.js b/lib/modules/storage/reference.js index a5b8b0d5..f7895c82 100644 --- a/lib/modules/storage/reference.js +++ b/lib/modules/storage/reference.js @@ -1,7 +1,7 @@ /* @flow */ import { NativeModules } from 'react-native'; -import { ReferenceBase } from './../base'; +import { ReferenceBase } from '../base'; import StorageTask, { UPLOAD_TASK, DOWNLOAD_TASK } from './task'; import Storage from './'; @@ -16,7 +16,7 @@ export default class StorageReference extends ReferenceBase { this.storage = storage; } - get fullPath() { + get fullPath(): string { return this.path; }