Merge branch 'master' of https://github.com/invertase/react-native-firebase into bridge-detox
This commit is contained in:
commit
e0d62f3945
52
README.md
52
README.md
|
@ -35,27 +35,27 @@ All in all, RNFirebase provides much faster performance (~2x) over the web SDK a
|
||||||
|
|
||||||
> '**?**' indicates partial support
|
> '**?**' indicates partial support
|
||||||
|
|
||||||
| Firebase Features | v1.x.x | v2.x.x | v3.x.x | v3.1.x | v3.2.x | Web SDK |
|
| Firebase Features | v2.2.x | v3.3.x | v4.0.x | Web SDK |
|
||||||
| -------------------------- | :----: | :----: | :----: | :----: | :----: | :-----: |
|
| -------------------------- | :----: | :----: | :----: | :-----: |
|
||||||
| **AdMob** | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
|
| **AdMob** | ✅ | ✅ | ✅ | ❌ |
|
||||||
| **Analytics** | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
|
| **Analytics** | ✅ | ✅ | ✅ | ❌ |
|
||||||
| **App Indexing** | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
| **App Indexing** | ❌ | ❌ | ❌ | ❌ |
|
||||||
| **Authentication** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
| **Authentication** | ✅ | ✅ | ✅ | ✅ |
|
||||||
| _-- Phone Auth_ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
|
| _-- Phone Auth_ | ❌ | ✅ | ✅ | ❌ |
|
||||||
| **Core** | ❌ | **?** | ✅ | ✅ | ✅ | ✅ |
|
| **Core** | **?** | ✅ | ✅ | ✅ |
|
||||||
| _-- Multiple Apps_ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
|
| _-- Multiple Apps_ | ❌ | ✅ | ✅ | ✅ |
|
||||||
| **Cloud Firestore** | ❌ | ❌ | ✅ | ✅ | ✅ | **?** |
|
| **Cloud Firestore** | ❌ | ✅ | ✅ | **?** |
|
||||||
| **Cloud Messaging (FCM)** | ✅ | ✅ | ✅ | ✅ | ✅ | **?** |
|
| **Cloud Messaging (FCM)** | **?** | **?** | ✅ | ❌ |
|
||||||
| **Crashlytics** | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
|
| **Crashlytics** | ❌ | ✅ | ✅ | ❌ |
|
||||||
| **Crash Reporting** | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
|
| **Crash Reporting** | ✅ | ✅ | ✅ | ❌ |
|
||||||
| **Dynamic Links** | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ |
|
| **Dynamic Links** | ❌ | ✅ | ✅ | ❌ |
|
||||||
| **Invites** | ❌ | ❌ | ❌ | **?** | **?** | ❌ |
|
| **Invites** | ❌ | ❌ | ✅ | ❌ |
|
||||||
| **Performance Monitoring** | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
|
| **Instance ID** | ❌ | ❌ | **?** | ❌ |
|
||||||
| **Realtime Database** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
| **Performance Monitoring** | ✅ | ✅ | ✅ | ❌ |
|
||||||
| _-- Offline Persistence_ | ✅ | ✅ | ✅ | ✅ | ✅ | **?** |
|
| **Realtime Database** | ✅ | ✅ | ✅ | ✅ |
|
||||||
| _-- Transactions_ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
| _-- Offline Persistence_ | ✅ | ✅ | ✅ | **?** |
|
||||||
| **Remote Config** | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
|
| **Remote Config** | ✅ | ✅ | ✅ | ❌ |
|
||||||
| **Storage** | ✅ | ✅ | ✅ | ✅ | ✅ | **?** |
|
| **Storage** | ✅ | ✅ | ✅ | **?** |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -63,11 +63,11 @@ All in all, RNFirebase provides much faster performance (~2x) over the web SDK a
|
||||||
|
|
||||||
> The table below shows the supported versions of React Native and the Firebase SDKs for different versions of `react-native-firebase`
|
> The table below shows the supported versions of React Native and the Firebase SDKs for different versions of `react-native-firebase`
|
||||||
|
|
||||||
| | 1.X.X | 2.0.X | 2.1.X / 2.2.X | 3.0.X | 3.1.X | 3.2.X |
|
| | 2.2.x | 3.3.x | 4.0.x |
|
||||||
| -------------------- | ----------- | ----------- | ------------- | -------- | ----------- | -------- |
|
|------------------------|----------|----------|----------|
|
||||||
| React Native | 0.36 - 0.39 | 0.40 - 0.46 | 0.47 + | 0.48 + | 0.48 - 0.49 | 0.50 + |
|
| React Native | 0.47 + | 0.50 + | 0.52 + |
|
||||||
| Firebase Android SDK | 10.2.0 + | 11.0.0 + | 11.0.0 + | 11.4.2 + | 11.6.0 + | 11.6.2 + |
|
| Firebase Android SDK | 11.0.0 + | 11.8.0 + | 12.0.0 + |
|
||||||
| Firebase iOS SDK | 3.15.0 + | 4.0.0 + | 4.0.0 + | 4.3.0 + | 4.5.0 + | 4.7.0 + |
|
| Firebase iOS SDK | 4.0.0 + | 4.7.0 + | 4.11.0 + |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.firebaseVersion = '11.8.0'
|
ext.firebaseVersion = '12.0.0'
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
|
|
|
@ -92,6 +92,11 @@ public class RNFirebaseAdMobRewardedVideo implements RewardedVideoAdListener {
|
||||||
sendEvent("onAdClosed", null);
|
sendEvent("onAdClosed", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRewardedVideoCompleted() {
|
||||||
|
sendEvent("onAdCompleted", null);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRewardedVideoAdFailedToLoad(int errorCode) {
|
public void onRewardedVideoAdFailedToLoad(int errorCode) {
|
||||||
WritableMap payload = RNFirebaseAdMobUtils.errorCodeToMap(errorCode);
|
WritableMap payload = RNFirebaseAdMobUtils.errorCodeToMap(errorCode);
|
||||||
|
|
|
@ -30,8 +30,11 @@ declare module "react-native-firebase" {
|
||||||
crashlytics: FirebaseModuleAndStatics<RNFirebase.crashlytics.Crashlytics>;
|
crashlytics: FirebaseModuleAndStatics<RNFirebase.crashlytics.Crashlytics>;
|
||||||
};
|
};
|
||||||
firestore: FirebaseModuleAndStatics<RNFirebase.firestore.Firestore, RNFirebase.firestore.FirestoreStatics>;
|
firestore: FirebaseModuleAndStatics<RNFirebase.firestore.Firestore, RNFirebase.firestore.FirestoreStatics>;
|
||||||
|
iid: FirebaseModuleAndStatics<RNFirebase.iid.InstanceId>
|
||||||
|
// invites: FirebaseModuleAndStatics<RNFirebase.invites.Invites>
|
||||||
links: FirebaseModuleAndStatics<RNFirebase.links.Links>;
|
links: FirebaseModuleAndStatics<RNFirebase.links.Links>;
|
||||||
messaging: FirebaseModuleAndStatics<RNFirebase.messaging.Messaging>;
|
messaging: FirebaseModuleAndStatics<RNFirebase.messaging.Messaging>;
|
||||||
|
notifications: FirebaseModuleAndStatics<RNFirebase.notifications.Notifications>;
|
||||||
// perf: FirebaseModuleAndStatics<RNFirebase.perf.Perf>;
|
// perf: FirebaseModuleAndStatics<RNFirebase.perf.Perf>;
|
||||||
storage: FirebaseModuleAndStatics<RNFirebase.storage.Storage>;
|
storage: FirebaseModuleAndStatics<RNFirebase.storage.Storage>;
|
||||||
// utils: FirebaseModuleAndStatics<RNFirebase.utils.Utils>;
|
// utils: FirebaseModuleAndStatics<RNFirebase.utils.Utils>;
|
||||||
|
@ -66,8 +69,11 @@ declare module "react-native-firebase" {
|
||||||
crashlytics(): RNFirebase.crashlytics.Crashlytics,
|
crashlytics(): RNFirebase.crashlytics.Crashlytics,
|
||||||
};
|
};
|
||||||
firestore(): RNFirebase.firestore.Firestore;
|
firestore(): RNFirebase.firestore.Firestore;
|
||||||
|
iid(): RNFirebase.iid.InstanceId;
|
||||||
|
// invites(): RNFirebase.invites.Invites;
|
||||||
links(): RNFirebase.links.Links;
|
links(): RNFirebase.links.Links;
|
||||||
messaging(): RNFirebase.messaging.Messaging;
|
messaging(): RNFirebase.messaging.Messaging;
|
||||||
|
notifications(): RNFirebase.notifications.Notifications;
|
||||||
// perf(): RNFirebase.perf.Performance;
|
// perf(): RNFirebase.perf.Performance;
|
||||||
storage(): RNFirebase.storage.Storage;
|
storage(): RNFirebase.storage.Storage;
|
||||||
// utils(): RNFirebase.utils.Utils;
|
// utils(): RNFirebase.utils.Utils;
|
||||||
|
@ -875,33 +881,17 @@ declare module "react-native-firebase" {
|
||||||
namespace messaging {
|
namespace messaging {
|
||||||
|
|
||||||
interface Messaging {
|
interface Messaging {
|
||||||
/**
|
|
||||||
* Subscribes the device to a topic.
|
|
||||||
*/
|
|
||||||
subscribeToTopic(topic: string): void
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unsubscribes the device from a topic.
|
|
||||||
*/
|
|
||||||
unsubscribeFromTopic(topic: string): void
|
|
||||||
|
|
||||||
/**
|
|
||||||
* When the application has been opened from a notification
|
|
||||||
* getInitialNotification is called and the notification payload is returned.
|
|
||||||
* Use onMessage for notifications when the app is running.
|
|
||||||
*/
|
|
||||||
getInitialNotification(): Promise<any>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the devices FCM token.
|
* Returns the devices FCM token.
|
||||||
* This token can be used in the Firebase console to send messages to directly.
|
|
||||||
*/
|
*/
|
||||||
getToken(forceRefresh?: Boolean): Promise<string>
|
getToken(): Promise<string>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset Instance ID and revokes all tokens.
|
* On a new message,
|
||||||
|
* the payload object is passed to the listener callback.
|
||||||
|
* This method is only triggered when the app is running.
|
||||||
*/
|
*/
|
||||||
deleteInstanceId(): Promise<any>
|
onMessage(listener: (message: any) => any): () => any
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On the event a devices FCM token is refreshed by Google,
|
* On the event a devices FCM token is refreshed by Google,
|
||||||
|
@ -910,84 +900,111 @@ declare module "react-native-firebase" {
|
||||||
onTokenRefresh(listener: (token: string) => any): () => any
|
onTokenRefresh(listener: (token: string) => any): () => any
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On a new message,
|
|
||||||
* the payload object is passed to the listener callback.
|
|
||||||
* This method is only triggered when the app is running.
|
|
||||||
* Use getInitialNotification for notifications which cause the app to open.
|
|
||||||
*/
|
|
||||||
onMessage(listener: (message: any) => any): () => any
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a local notification from the device itself.
|
|
||||||
*/
|
|
||||||
createLocalNotification(notification: any): any
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Schedule a local notification to be shown on the device.
|
|
||||||
*/
|
|
||||||
scheduleLocalNotification(notification: any): any
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an array of all currently scheduled notifications.
|
|
||||||
* ```
|
|
||||||
* firebase.messaging().getScheduledLocalNotifications()
|
|
||||||
* .then((notifications) => {
|
|
||||||
* console.log('Current scheduled notifications: ', notifications);
|
|
||||||
* });
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
getScheduledLocalNotifications(): Promise<any[]>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cancels a location notification by ID,
|
|
||||||
* or all notifications by *.
|
|
||||||
*/
|
|
||||||
cancelLocalNotification(id: string): void
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes all delivered notifications from device by ID,
|
|
||||||
* or all notifications by *.
|
|
||||||
*/
|
|
||||||
removeDeliveredNotification(id: string): void
|
|
||||||
|
|
||||||
/**
|
|
||||||
* IOS
|
|
||||||
* Requests app notification permissions in an Alert dialog.
|
* Requests app notification permissions in an Alert dialog.
|
||||||
*/
|
*/
|
||||||
requestPermissions(): Promise<{ granted: boolean }>;
|
requestPermission(): Promise<boolean>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the badge number on the iOS app icon.
|
* Checks if the app has notification permissions.
|
||||||
*/
|
*/
|
||||||
setBadgeNumber(value: number): void
|
hasPermission(): Promise<boolean>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send an upstream message
|
||||||
|
*/
|
||||||
|
sendMessage(remoteMessage: RemoteMessage): Promise<void>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Subscribes the device to a topic.
|
||||||
|
*/
|
||||||
|
subscribeToTopic(topic: string): void
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unsubscribes the device from a topic.
|
||||||
|
*/
|
||||||
|
unsubscribeFromTopic(topic: string): void
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RemoteMessage {
|
||||||
|
collapseKey?: string
|
||||||
|
data: Object
|
||||||
|
from?: string
|
||||||
|
messageId?: string
|
||||||
|
messageType: string
|
||||||
|
sentTime?: number
|
||||||
|
to?: string
|
||||||
|
ttl?: number
|
||||||
|
|
||||||
|
setCollapseKey(collapseKey: string): RemoteMessage
|
||||||
|
setData(data: Object): RemoteMessage
|
||||||
|
setMessageId(messageId: string): RemoteMessage
|
||||||
|
setMessageType(messageType: string): RemoteMessage
|
||||||
|
setTo(to: string): RemoteMessage
|
||||||
|
setTtl(ttl: number): RemoteMessage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace iid {
|
||||||
|
interface InstanceId {
|
||||||
|
delete(): Promise<void>
|
||||||
|
get(): Promise<string>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace notifications {
|
||||||
|
interface AndroidNotifications {
|
||||||
|
createChannel(channel: any): Promise<void>
|
||||||
|
createChannelGroup(channelGroup: any): Promise<void>
|
||||||
|
createChannelGroups(channelGroups: any[]): Promise<void>
|
||||||
|
createChannels(channels: any[]): Promise<void>
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Notifications {
|
||||||
|
android: AndroidNotifications
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cancels all notifications
|
||||||
|
*/
|
||||||
|
cancelAllNotifications(): void
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cancels a notification by ID
|
||||||
|
*/
|
||||||
|
cancelNotification(notificationId: string): void
|
||||||
|
|
||||||
|
displayNotification(notification: any): Promise<void>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current badge number on the app icon.
|
* Returns the current badge number on the app icon.
|
||||||
*/
|
*/
|
||||||
getBadgeNumber(): Promise<number>
|
getBadge(): Promise<number>
|
||||||
|
|
||||||
|
getInitialNotification(): Promise<any>
|
||||||
|
|
||||||
|
getScheduledNotifications(): Promise<any[]>
|
||||||
|
|
||||||
|
onNotification(listener: (notification: any) => any): () => any
|
||||||
|
|
||||||
|
onNotificationDisplayed(listener: (notification: any) => any): () => any
|
||||||
|
|
||||||
|
onNotificationOpened(listener: (notificationOpen: any) => any): () => any
|
||||||
|
|
||||||
|
removeAllDeliveredNotifications(): void
|
||||||
|
|
||||||
|
removeDeliveredNotification(notificationId: string): void
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an upstream message
|
* Schedule a local notification to be shown on the device.
|
||||||
* @param senderId
|
|
||||||
* @param payload
|
|
||||||
*/
|
*/
|
||||||
sendMessage(senderId: string, payload: RemoteMessage): any
|
scheduleNotification(notification: any, schedule: any): any
|
||||||
|
|
||||||
NOTIFICATION_TYPE: Object
|
/**
|
||||||
REMOTE_NOTIFICATION_RESULT: Object
|
* Sets the badge number on the iOS app icon.
|
||||||
WILL_PRESENT_RESULT: Object
|
*/
|
||||||
EVENT_TYPE: Object
|
setBadge(badge: number): void
|
||||||
}
|
|
||||||
|
|
||||||
interface RemoteMessage {
|
|
||||||
id: string,
|
|
||||||
type: string,
|
|
||||||
ttl?: number,
|
|
||||||
sender: string,
|
|
||||||
collapseKey?: string,
|
|
||||||
data: Object,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace crash {
|
namespace crash {
|
||||||
|
|
||||||
interface Crash {
|
interface Crash {
|
||||||
|
@ -1058,9 +1075,9 @@ declare module "react-native-firebase" {
|
||||||
namespace links {
|
namespace links {
|
||||||
interface Links {
|
interface Links {
|
||||||
/** Creates a standard dynamic link. */
|
/** Creates a standard dynamic link. */
|
||||||
createDynamicLink(parameters: LinkConfiguration): Promise<string>;
|
createDynamicLink(dynamicLink: DynamicLink): Promise<string>;
|
||||||
/** Creates a short dynamic link. */
|
/** Creates a short dynamic link. */
|
||||||
createShortDynamicLink(parameters: LinkConfiguration): Promise<string>;
|
createShortDynamicLink(type: 'SHORT' | 'UNGUESSABLE'): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* Returns the URL that the app has been launched from. If the app was
|
* Returns the URL that the app has been launched from. If the app was
|
||||||
* not launched from a URL the return value will be null.
|
* not launched from a URL the return value will be null.
|
||||||
|
@ -1077,36 +1094,53 @@ declare module "react-native-firebase" {
|
||||||
onLink(listener: (url: string) => void): () => void;
|
onLink(listener: (url: string) => void): () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
interface DynamicLink {
|
||||||
* Configuration when creating a Dynamic Link (standard or short). For
|
analytics: AnalyticsParameters
|
||||||
* more information about each parameter, see the official Firebase docs:
|
android: AndroidParameters
|
||||||
* https://firebase.google.com/docs/reference/dynamic-links/link-shortener
|
ios: IOSParameters
|
||||||
*/
|
itunes: ITunesParameters
|
||||||
interface LinkConfiguration {
|
navigation: NavigationParameters
|
||||||
link: string,
|
social: SocialParameters
|
||||||
dynamicLinkDomain: string,
|
}
|
||||||
androidInfo?: {
|
|
||||||
androidLink?: string,
|
interface AnalyticsParameters {
|
||||||
androidPackageName: string,
|
setCampaign(campaign: string): DynamicLink
|
||||||
androidFallbackLink?: string,
|
setContent(content: string): DynamicLink
|
||||||
androidMinPackageVersionCode?: string,
|
setMedium(medium: string): DynamicLink
|
||||||
},
|
setSource(source: string): DynamicLink
|
||||||
iosInfo?: {
|
setTerm(term: string): DynamicLink
|
||||||
iosBundleId: string,
|
}
|
||||||
iosAppStoreId?: string,
|
|
||||||
iosFallbackLink?: string,
|
interface AndroidParameters {
|
||||||
iosCustomScheme?: string,
|
setFallbackUrl(fallbackUrl: string): DynamicLink
|
||||||
iosIpadBundleId?: string,
|
setMinimumVersion(minimumVersion: number): DynamicLink
|
||||||
iosIpadFallbackLink?: string,
|
setPackageName(packageName: string): DynamicLink
|
||||||
},
|
}
|
||||||
socialMetaTagInfo?: {
|
|
||||||
socialTitle: string,
|
interface IOSParameters {
|
||||||
socialImageLink: string,
|
setAppStoreId(appStoreId: string): DynamicLink
|
||||||
socialDescription: string,
|
setBundleId(bundleId: string): DynamicLink
|
||||||
},
|
setCustomScheme(customScheme: string): DynamicLink
|
||||||
suffix?: {
|
setFallbackUrl(fallbackUrl: string): DynamicLink
|
||||||
option: 'SHORT' | 'UNGUESSABLE',
|
setIPadBundleId(iPadBundleId: string): DynamicLink
|
||||||
},
|
setIPadFallbackUrl(iPadFallbackUrl: string): DynamicLink
|
||||||
|
setMinimumVersion(minimumVersion: string): DynamicLink
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ITunesParameters {
|
||||||
|
setAffiliateToken(affiliateToken: string): DynamicLink
|
||||||
|
setCampaignToken(campaignToken: string): DynamicLink
|
||||||
|
setProviderToken(providerToken: string): DynamicLink
|
||||||
|
}
|
||||||
|
|
||||||
|
interface NavigationParameters {
|
||||||
|
setForcedRedirectEnabled(forcedRedirectEnabled: boolean): DynamicLink
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SocialParameters {
|
||||||
|
setDescriptionText(descriptionText: string): DynamicLink
|
||||||
|
setImageUrl(imageUrl: string): DynamicLink
|
||||||
|
setTitle(title: string): DynamicLink
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ import Crashlytics, {
|
||||||
} from '../fabric/crashlytics';
|
} from '../fabric/crashlytics';
|
||||||
import Database, { NAMESPACE as DatabaseNamespace } from '../database';
|
import Database, { NAMESPACE as DatabaseNamespace } from '../database';
|
||||||
import Firestore, { NAMESPACE as FirestoreNamespace } from '../firestore';
|
import Firestore, { NAMESPACE as FirestoreNamespace } from '../firestore';
|
||||||
import InstanceId, { NAMESPACE as InstanceIdNamespace } from '../instanceid';
|
import InstanceId, { NAMESPACE as InstanceIdNamespace } from '../iid';
|
||||||
import Invites, { NAMESPACE as InvitesNamespace } from '../invites';
|
import Invites, { NAMESPACE as InvitesNamespace } from '../invites';
|
||||||
import Links, { NAMESPACE as LinksNamespace } from '../links';
|
import Links, { NAMESPACE as LinksNamespace } from '../links';
|
||||||
import Messaging, { NAMESPACE as MessagingNamespace } from '../messaging';
|
import Messaging, { NAMESPACE as MessagingNamespace } from '../messaging';
|
||||||
|
@ -49,7 +49,7 @@ export default class App {
|
||||||
crashlytics: () => Crashlytics,
|
crashlytics: () => Crashlytics,
|
||||||
};
|
};
|
||||||
firestore: () => Firestore;
|
firestore: () => Firestore;
|
||||||
instanceid: () => InstanceId;
|
iid: () => InstanceId;
|
||||||
invites: () => Invites;
|
invites: () => Invites;
|
||||||
links: () => Links;
|
links: () => Links;
|
||||||
messaging: () => Messaging;
|
messaging: () => Messaging;
|
||||||
|
@ -91,7 +91,7 @@ export default class App {
|
||||||
crashlytics: APPS.appModule(this, CrashlyticsNamespace, Crashlytics),
|
crashlytics: APPS.appModule(this, CrashlyticsNamespace, Crashlytics),
|
||||||
};
|
};
|
||||||
this.firestore = APPS.appModule(this, FirestoreNamespace, Firestore);
|
this.firestore = APPS.appModule(this, FirestoreNamespace, Firestore);
|
||||||
this.instanceid = APPS.appModule(this, InstanceIdNamespace, InstanceId);
|
this.iid = APPS.appModule(this, InstanceIdNamespace, InstanceId);
|
||||||
this.invites = APPS.appModule(this, InvitesNamespace, Invites);
|
this.invites = APPS.appModule(this, InvitesNamespace, Invites);
|
||||||
this.links = APPS.appModule(this, LinksNamespace, Links);
|
this.links = APPS.appModule(this, LinksNamespace, Links);
|
||||||
this.messaging = APPS.appModule(this, MessagingNamespace, Messaging);
|
this.messaging = APPS.appModule(this, MessagingNamespace, Messaging);
|
||||||
|
|
|
@ -41,7 +41,7 @@ import {
|
||||||
import {
|
import {
|
||||||
statics as InstanceIdStatics,
|
statics as InstanceIdStatics,
|
||||||
MODULE_NAME as InstanceIdModuleName,
|
MODULE_NAME as InstanceIdModuleName,
|
||||||
} from '../instanceid';
|
} from '../iid';
|
||||||
import {
|
import {
|
||||||
statics as InvitesStatics,
|
statics as InvitesStatics,
|
||||||
MODULE_NAME as InvitesModuleName,
|
MODULE_NAME as InvitesModuleName,
|
||||||
|
@ -102,7 +102,7 @@ class Firebase {
|
||||||
database: DatabaseModule;
|
database: DatabaseModule;
|
||||||
fabric: FabricModule;
|
fabric: FabricModule;
|
||||||
firestore: FirestoreModule;
|
firestore: FirestoreModule;
|
||||||
instanceid: InstanceIdModule;
|
iid: InstanceIdModule;
|
||||||
invites: InvitesModule;
|
invites: InvitesModule;
|
||||||
links: LinksModule;
|
links: LinksModule;
|
||||||
messaging: MessagingModule;
|
messaging: MessagingModule;
|
||||||
|
@ -148,8 +148,8 @@ class Firebase {
|
||||||
FirestoreStatics,
|
FirestoreStatics,
|
||||||
FirestoreModuleName
|
FirestoreModuleName
|
||||||
);
|
);
|
||||||
this.instanceid = APPS.moduleAndStatics(
|
this.iid = APPS.moduleAndStatics(
|
||||||
'instanceid',
|
'iid',
|
||||||
InstanceIdStatics,
|
InstanceIdStatics,
|
||||||
InstanceIdModuleName
|
InstanceIdModuleName
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { getNativeModule } from '../../utils/native';
|
||||||
import type App from '../core/app';
|
import type App from '../core/app';
|
||||||
|
|
||||||
export const MODULE_NAME = 'RNFirebaseInstanceId';
|
export const MODULE_NAME = 'RNFirebaseInstanceId';
|
||||||
export const NAMESPACE = 'instanceid';
|
export const NAMESPACE = 'iid';
|
||||||
|
|
||||||
export default class InstanceId extends ModuleBase {
|
export default class InstanceId extends ModuleBase {
|
||||||
constructor(app: App) {
|
constructor(app: App) {
|
|
@ -41,9 +41,9 @@ export default class Invites extends ModuleBase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the invitation that triggered application open
|
* Returns the invitation that triggered application open
|
||||||
* @returns {Promise.<Object>}
|
* @returns {Promise.<InvitationOpen>}
|
||||||
*/
|
*/
|
||||||
getInitialInvitation(): Promise<string> {
|
getInitialInvitation(): Promise<?InvitationOpen> {
|
||||||
return getNativeModule(this).getInitialInvitation();
|
return getNativeModule(this).getInitialInvitation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,11 +65,17 @@ export default class Invites extends ModuleBase {
|
||||||
|
|
||||||
sendInvitation(invitation: Invitation): Promise<string[]> {
|
sendInvitation(invitation: Invitation): Promise<string[]> {
|
||||||
if (!(invitation instanceof Invitation)) {
|
if (!(invitation instanceof Invitation)) {
|
||||||
throw new Error(
|
return Promise.reject(
|
||||||
`Invites:sendInvitation expects an 'Invitation' but got type ${typeof invitation}`
|
new Error(
|
||||||
|
`Invites:sendInvitation expects an 'Invitation' but got type ${typeof invitation}`
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return getNativeModule(this).sendInvitation(invitation.build());
|
try {
|
||||||
|
return getNativeModule(this).sendInvitation(invitation.build());
|
||||||
|
} catch (error) {
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import type DynamicLink from './DynamicLink';
|
||||||
import type { NativeNavigationParameters } from './types';
|
import type { NativeNavigationParameters } from './types';
|
||||||
|
|
||||||
export default class NavigationParameters {
|
export default class NavigationParameters {
|
||||||
_forcedRedirectEnabled: string | void;
|
_forcedRedirectEnabled: boolean | void;
|
||||||
_link: DynamicLink;
|
_link: DynamicLink;
|
||||||
|
|
||||||
constructor(link: DynamicLink) {
|
constructor(link: DynamicLink) {
|
||||||
|
@ -18,7 +18,7 @@ export default class NavigationParameters {
|
||||||
* @param forcedRedirectEnabled
|
* @param forcedRedirectEnabled
|
||||||
* @returns {DynamicLink}
|
* @returns {DynamicLink}
|
||||||
*/
|
*/
|
||||||
setForcedRedirectEnabled(forcedRedirectEnabled: string): DynamicLink {
|
setForcedRedirectEnabled(forcedRedirectEnabled: boolean): DynamicLink {
|
||||||
this._forcedRedirectEnabled = forcedRedirectEnabled;
|
this._forcedRedirectEnabled = forcedRedirectEnabled;
|
||||||
return this._link;
|
return this._link;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,11 +45,17 @@ export default class Links extends ModuleBase {
|
||||||
*/
|
*/
|
||||||
createDynamicLink(link: DynamicLink): Promise<string> {
|
createDynamicLink(link: DynamicLink): Promise<string> {
|
||||||
if (!(link instanceof DynamicLink)) {
|
if (!(link instanceof DynamicLink)) {
|
||||||
throw new Error(
|
return Promise.reject(
|
||||||
`Links:createDynamicLink expects a 'DynamicLink' but got type ${typeof link}`
|
new Error(
|
||||||
|
`Links:createDynamicLink expects a 'DynamicLink' but got type ${typeof link}`
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return getNativeModule(this).createDynamicLink(link.build());
|
try {
|
||||||
|
return getNativeModule(this).createDynamicLink(link.build());
|
||||||
|
} catch (error) {
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,18 +68,24 @@ export default class Links extends ModuleBase {
|
||||||
type?: 'SHORT' | 'UNGUESSABLE'
|
type?: 'SHORT' | 'UNGUESSABLE'
|
||||||
): Promise<String> {
|
): Promise<String> {
|
||||||
if (!(link instanceof DynamicLink)) {
|
if (!(link instanceof DynamicLink)) {
|
||||||
throw new Error(
|
return Promise.reject(
|
||||||
`Links:createShortDynamicLink expects a 'DynamicLink' but got type ${typeof link}`
|
new Error(
|
||||||
|
`Links:createShortDynamicLink expects a 'DynamicLink' but got type ${typeof link}`
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return getNativeModule(this).createShortDynamicLink(link.build(), type);
|
try {
|
||||||
|
return getNativeModule(this).createShortDynamicLink(link.build(), type);
|
||||||
|
} catch (error) {
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the link that triggered application open
|
* Returns the link that triggered application open
|
||||||
* @returns {Promise.<String>}
|
* @returns {Promise.<String>}
|
||||||
*/
|
*/
|
||||||
getInitialLink(): Promise<string> {
|
getInitialLink(): Promise<?string> {
|
||||||
return getNativeModule(this).getInitialLink();
|
return getNativeModule(this).getInitialLink();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,4 +106,6 @@ export default class Links extends ModuleBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const statics = {};
|
export const statics = {
|
||||||
|
DynamicLink,
|
||||||
|
};
|
||||||
|
|
|
@ -32,7 +32,7 @@ export type NativeITunesParameters = {|
|
||||||
|};
|
|};
|
||||||
|
|
||||||
export type NativeNavigationParameters = {|
|
export type NativeNavigationParameters = {|
|
||||||
forcedRedirectEnabled?: string,
|
forcedRedirectEnabled?: boolean,
|
||||||
|};
|
|};
|
||||||
|
|
||||||
export type NativeSocialParameters = {|
|
export type NativeSocialParameters = {|
|
||||||
|
|
|
@ -129,11 +129,17 @@ export default class Messaging extends ModuleBase {
|
||||||
|
|
||||||
sendMessage(remoteMessage: RemoteMessage): Promise<void> {
|
sendMessage(remoteMessage: RemoteMessage): Promise<void> {
|
||||||
if (!(remoteMessage instanceof RemoteMessage)) {
|
if (!(remoteMessage instanceof RemoteMessage)) {
|
||||||
throw new Error(
|
return Promise.reject(
|
||||||
`Messaging:sendMessage expects a 'RemoteMessage' but got type ${typeof remoteMessage}`
|
new Error(
|
||||||
|
`Messaging:sendMessage expects a 'RemoteMessage' but got type ${typeof remoteMessage}`
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return getNativeModule(this).sendMessage(remoteMessage.build());
|
try {
|
||||||
|
return getNativeModule(this).sendMessage(remoteMessage.build());
|
||||||
|
} catch (error) {
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
subscribeToTopic(topic: string): void {
|
subscribeToTopic(topic: string): void {
|
||||||
|
|
|
@ -152,11 +152,17 @@ export default class Notifications extends ModuleBase {
|
||||||
*/
|
*/
|
||||||
displayNotification(notification: Notification): Promise<void> {
|
displayNotification(notification: Notification): Promise<void> {
|
||||||
if (!(notification instanceof Notification)) {
|
if (!(notification instanceof Notification)) {
|
||||||
throw new Error(
|
return Promise.reject(
|
||||||
`Notifications:displayNotification expects a 'Notification' but got type ${typeof notification}`
|
new Error(
|
||||||
|
`Notifications:displayNotification expects a 'Notification' but got type ${typeof notification}`
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return getNativeModule(this).displayNotification(notification.build());
|
try {
|
||||||
|
return getNativeModule(this).displayNotification(notification.build());
|
||||||
|
} catch (error) {
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getBadge(): Promise<number> {
|
getBadge(): Promise<number> {
|
||||||
|
@ -285,13 +291,19 @@ export default class Notifications extends ModuleBase {
|
||||||
schedule: Schedule
|
schedule: Schedule
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (!(notification instanceof Notification)) {
|
if (!(notification instanceof Notification)) {
|
||||||
throw new Error(
|
return Promise.reject(
|
||||||
`Notifications:scheduleNotification expects a 'Notification' but got type ${typeof notification}`
|
new Error(
|
||||||
|
`Notifications:scheduleNotification expects a 'Notification' but got type ${typeof notification}`
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const nativeNotification = notification.build();
|
try {
|
||||||
nativeNotification.schedule = schedule;
|
const nativeNotification = notification.build();
|
||||||
return getNativeModule(this).scheduleNotification(nativeNotification);
|
nativeNotification.schedule = schedule;
|
||||||
|
return getNativeModule(this).scheduleNotification(nativeNotification);
|
||||||
|
} catch (error) {
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setBadge(badge: number): void {
|
setBadge(badge: number): void {
|
||||||
|
|
|
@ -15,8 +15,8 @@ import type Database from '../modules/database';
|
||||||
import { typeof statics as DatabaseStatics } from '../modules/database';
|
import { typeof statics as DatabaseStatics } from '../modules/database';
|
||||||
import type Firestore from '../modules/firestore';
|
import type Firestore from '../modules/firestore';
|
||||||
import { typeof statics as FirestoreStatics } from '../modules/firestore';
|
import { typeof statics as FirestoreStatics } from '../modules/firestore';
|
||||||
import type InstanceId from '../modules/instanceid';
|
import type InstanceId from '../modules/iid';
|
||||||
import { typeof statics as InstanceIdStatics } from '../modules/instanceid';
|
import { typeof statics as InstanceIdStatics } from '../modules/iid';
|
||||||
import type Invites from '../modules/invites';
|
import type Invites from '../modules/invites';
|
||||||
import { typeof statics as InvitesStatics } from '../modules/invites';
|
import { typeof statics as InvitesStatics } from '../modules/invites';
|
||||||
import type Links from '../modules/links';
|
import type Links from '../modules/links';
|
||||||
|
@ -81,7 +81,7 @@ export type FirebaseNamespace =
|
||||||
| 'crashlytics'
|
| 'crashlytics'
|
||||||
| 'database'
|
| 'database'
|
||||||
| 'firestore'
|
| 'firestore'
|
||||||
| 'instanceid'
|
| 'iid'
|
||||||
| 'invites'
|
| 'invites'
|
||||||
| 'links'
|
| 'links'
|
||||||
| 'messaging'
|
| 'messaging'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "react-native-firebase",
|
"name": "react-native-firebase",
|
||||||
"version": "4.0.0-alpha.1",
|
"version": "4.0.0-rc.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "react-native-firebase",
|
"name": "react-native-firebase",
|
||||||
"version": "4.0.0-alpha.1",
|
"version": "4.0.0-rc.2",
|
||||||
"author": "Invertase <contact@invertase.io> (http://invertase.io)",
|
"author": "Invertase <contact@invertase.io> (http://invertase.io)",
|
||||||
"description": "A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Messaging (FCM), Remote Config, Storage and Performance.",
|
"description": "A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Messaging (FCM), Remote Config, Storage and Performance.",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|
|
@ -27,8 +27,8 @@ def enableSeparateBuildPerCPUArchitecture = false
|
||||||
def enableProguardInReleaseBuilds = false
|
def enableProguardInReleaseBuilds = false
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 26
|
compileSdkVersion 27
|
||||||
buildToolsVersion '26.0.2'
|
buildToolsVersion '27.0.1'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.reactnativefirebasedemo"
|
applicationId "com.reactnativefirebasedemo"
|
||||||
|
@ -70,7 +70,7 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project.ext.firebaseVersion = '11.8.0'
|
project.ext.firebaseVersion = '12.0.0'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':react-native-vector-icons')
|
compile project(':react-native-vector-icons')
|
||||||
|
@ -93,7 +93,7 @@ dependencies {
|
||||||
compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
|
compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
|
||||||
transitive = true
|
transitive = true
|
||||||
}
|
}
|
||||||
compile "com.android.support:appcompat-v7:26.0.2"
|
compile "com.android.support:appcompat-v7:27.0.1"
|
||||||
compile "com.facebook.react:react-native:+" // From node_modules
|
compile "com.facebook.react:react-native:+" // From node_modules
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,8 @@ allprojects {
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
ext {
|
ext {
|
||||||
compileSdk = 26
|
compileSdk = 27
|
||||||
buildTools = "26.0.2"
|
buildTools = "27.0.1"
|
||||||
minSdk = 16
|
minSdk = 16
|
||||||
targetSdk = 26
|
targetSdk = 26
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,37 +4,37 @@
|
||||||
<dict>
|
<dict>
|
||||||
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
|
<key>AD_UNIT_ID_FOR_BANNER_TEST</key>
|
||||||
<string>ca-app-pub-3940256099942544/2934735716</string>
|
<string>ca-app-pub-3940256099942544/2934735716</string>
|
||||||
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
|
<key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key>
|
||||||
<string>ca-app-pub-3940256099942544/4411468910</string>
|
<string>ca-app-pub-3940256099942544/4411468910</string>
|
||||||
<key>CLIENT_ID</key>
|
<key>CLIENT_ID</key>
|
||||||
<string>17067372085-siujfe334vool17t2mtrmjrsgl81nhd9.apps.googleusercontent.com</string>
|
<string>305229645282-22imndi01abc2p6esgtu1i1m9mqrd0ib.apps.googleusercontent.com</string>
|
||||||
<key>REVERSED_CLIENT_ID</key>
|
<key>REVERSED_CLIENT_ID</key>
|
||||||
<string>com.googleusercontent.apps.17067372085-siujfe334vool17t2mtrmjrsgl81nhd9</string>
|
<string>com.googleusercontent.apps.305229645282-22imndi01abc2p6esgtu1i1m9mqrd0ib</string>
|
||||||
<key>API_KEY</key>
|
<key>API_KEY</key>
|
||||||
<string>AIzaSyC8ZEruBCvS_6woF8_l07ILy1eXaD6J4vQ</string>
|
<string>AIzaSyAcdVLG5dRzA1ck_fa_xd4Z0cY7cga7S5A</string>
|
||||||
<key>GCM_SENDER_ID</key>
|
<key>GCM_SENDER_ID</key>
|
||||||
<string>17067372085</string>
|
<string>305229645282</string>
|
||||||
<key>PLIST_VERSION</key>
|
<key>PLIST_VERSION</key>
|
||||||
<string>1</string>
|
<string>1</string>
|
||||||
<key>BUNDLE_ID</key>
|
<key>BUNDLE_ID</key>
|
||||||
<string>com.invertase.RNFirebaseTests</string>
|
<string>com.invertase.ReactNativeFirebaseDemo</string>
|
||||||
<key>PROJECT_ID</key>
|
<key>PROJECT_ID</key>
|
||||||
<string>rnfirebase</string>
|
<string>rnfirebase-b9ad4</string>
|
||||||
<key>STORAGE_BUCKET</key>
|
<key>STORAGE_BUCKET</key>
|
||||||
<string>rnfirebase.appspot.com</string>
|
<string>rnfirebase-b9ad4.appspot.com</string>
|
||||||
<key>IS_ADS_ENABLED</key>
|
<key>IS_ADS_ENABLED</key>
|
||||||
<true></true>
|
<true/>
|
||||||
<key>IS_ANALYTICS_ENABLED</key>
|
<key>IS_ANALYTICS_ENABLED</key>
|
||||||
<false></false>
|
<false/>
|
||||||
<key>IS_APPINVITE_ENABLED</key>
|
<key>IS_APPINVITE_ENABLED</key>
|
||||||
<false></false>
|
<false/>
|
||||||
<key>IS_GCM_ENABLED</key>
|
<key>IS_GCM_ENABLED</key>
|
||||||
<true></true>
|
<true/>
|
||||||
<key>IS_SIGNIN_ENABLED</key>
|
<key>IS_SIGNIN_ENABLED</key>
|
||||||
<true></true>
|
<true/>
|
||||||
<key>GOOGLE_APP_ID</key>
|
<key>GOOGLE_APP_ID</key>
|
||||||
<string>1:17067372085:ios:d9ef660bd02cc2f1</string>
|
<string>1:305229645282:ios:7b45748cb1117d2d</string>
|
||||||
<key>DATABASE_URL</key>
|
<key>DATABASE_URL</key>
|
||||||
<string>https://rnfirebase-5579a.firebaseio.com</string>
|
<string>https://rnfirebase-b9ad4.firebaseio.com</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
@ -7,41 +7,41 @@ PODS:
|
||||||
- BoringSSL/Interface (10.0)
|
- BoringSSL/Interface (10.0)
|
||||||
- Crashlytics (3.10.1):
|
- Crashlytics (3.10.1):
|
||||||
- Fabric (~> 1.7.5)
|
- Fabric (~> 1.7.5)
|
||||||
- Fabric (1.7.5)
|
- Fabric (1.7.6)
|
||||||
- Firebase/AdMob (4.10.0):
|
- Firebase/AdMob (4.11.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- Google-Mobile-Ads-SDK (= 7.29.0)
|
- Google-Mobile-Ads-SDK (= 7.29.0)
|
||||||
- Firebase/Auth (4.10.0):
|
- Firebase/Auth (4.11.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- FirebaseAuth (= 4.4.4)
|
- FirebaseAuth (= 4.5.0)
|
||||||
- Firebase/Core (4.10.0):
|
- Firebase/Core (4.11.0):
|
||||||
- FirebaseAnalytics (= 4.1.0)
|
- FirebaseAnalytics (= 4.1.0)
|
||||||
- FirebaseCore (= 4.0.16)
|
- FirebaseCore (= 4.0.18)
|
||||||
- Firebase/Crash (4.10.0):
|
- Firebase/Crash (4.11.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- FirebaseCrash (= 2.0.2)
|
- FirebaseCrash (= 2.0.2)
|
||||||
- Firebase/Database (4.10.0):
|
- Firebase/Database (4.11.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- FirebaseDatabase (= 4.1.5)
|
- FirebaseDatabase (= 4.1.5)
|
||||||
- Firebase/DynamicLinks (4.10.0):
|
- Firebase/DynamicLinks (4.11.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- FirebaseDynamicLinks (= 2.3.2)
|
- FirebaseDynamicLinks (= 2.3.2)
|
||||||
- Firebase/Firestore (4.10.0):
|
- Firebase/Firestore (4.11.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- FirebaseFirestore (= 0.10.2)
|
- FirebaseFirestore (= 0.10.4)
|
||||||
- Firebase/Invites (4.10.0):
|
- Firebase/Invites (4.11.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- FirebaseInvites (= 2.0.2)
|
- FirebaseInvites (= 2.0.2)
|
||||||
- Firebase/Messaging (4.10.0):
|
- Firebase/Messaging (4.11.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- FirebaseMessaging (= 2.1.1)
|
- FirebaseMessaging (= 2.1.1)
|
||||||
- Firebase/Performance (4.10.0):
|
- Firebase/Performance (4.11.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- FirebasePerformance (= 1.1.2)
|
- FirebasePerformance (= 1.1.2)
|
||||||
- Firebase/RemoteConfig (4.10.0):
|
- Firebase/RemoteConfig (4.11.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- FirebaseRemoteConfig (= 2.1.2)
|
- FirebaseRemoteConfig (= 2.1.2)
|
||||||
- Firebase/Storage (4.10.0):
|
- Firebase/Storage (4.11.0):
|
||||||
- Firebase/Core
|
- Firebase/Core
|
||||||
- FirebaseStorage (= 2.1.3)
|
- FirebaseStorage (= 2.1.3)
|
||||||
- FirebaseABTesting (1.0.0):
|
- FirebaseABTesting (1.0.0):
|
||||||
|
@ -52,11 +52,11 @@ PODS:
|
||||||
- FirebaseInstanceID (~> 2.0)
|
- FirebaseInstanceID (~> 2.0)
|
||||||
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
|
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
|
||||||
- nanopb (~> 0.3)
|
- nanopb (~> 0.3)
|
||||||
- FirebaseAuth (4.4.4):
|
- FirebaseAuth (4.5.0):
|
||||||
- FirebaseAnalytics (~> 4.1)
|
- FirebaseAnalytics (~> 4.1)
|
||||||
- GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)
|
- GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)
|
||||||
- GTMSessionFetcher/Core (~> 1.1)
|
- GTMSessionFetcher/Core (~> 1.1)
|
||||||
- FirebaseCore (4.0.16):
|
- FirebaseCore (4.0.18):
|
||||||
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
|
- GoogleToolboxForMac/NSData+zlib (~> 2.1)
|
||||||
- FirebaseCrash (2.0.2):
|
- FirebaseCrash (2.0.2):
|
||||||
- FirebaseAnalytics (~> 4.0)
|
- FirebaseAnalytics (~> 4.0)
|
||||||
|
@ -70,13 +70,13 @@ PODS:
|
||||||
- leveldb-library (~> 1.18)
|
- leveldb-library (~> 1.18)
|
||||||
- FirebaseDynamicLinks (2.3.2):
|
- FirebaseDynamicLinks (2.3.2):
|
||||||
- FirebaseAnalytics (~> 4.0)
|
- FirebaseAnalytics (~> 4.0)
|
||||||
- FirebaseFirestore (0.10.2):
|
- FirebaseFirestore (0.10.4):
|
||||||
- FirebaseAnalytics (~> 4.1)
|
- FirebaseAnalytics (~> 4.1)
|
||||||
- FirebaseCore (~> 4.0)
|
- FirebaseCore (~> 4.0)
|
||||||
- gRPC-ProtoRPC (~> 1.0)
|
- gRPC-ProtoRPC (~> 1.0)
|
||||||
- leveldb-library (~> 1.18)
|
- leveldb-library (~> 1.18)
|
||||||
- Protobuf (~> 3.5)
|
- Protobuf (~> 3.5)
|
||||||
- FirebaseInstanceID (2.0.9):
|
- FirebaseInstanceID (2.0.10):
|
||||||
- FirebaseCore (~> 4.0)
|
- FirebaseCore (~> 4.0)
|
||||||
- FirebaseInvites (2.0.2):
|
- FirebaseInvites (2.0.2):
|
||||||
- FirebaseAnalytics (~> 4.0)
|
- FirebaseAnalytics (~> 4.0)
|
||||||
|
@ -244,17 +244,17 @@ EXTERNAL SOURCES:
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
BoringSSL: 32764dbaf5f5888cf51fbaa172a010126b41bcd4
|
BoringSSL: 32764dbaf5f5888cf51fbaa172a010126b41bcd4
|
||||||
Crashlytics: aee1a064cbbf99b32efa3f056a5f458d846bc8ff
|
Crashlytics: aee1a064cbbf99b32efa3f056a5f458d846bc8ff
|
||||||
Fabric: ae7146a5f505ea370a1e44820b4b1dc8890e2890
|
Fabric: f8d42c893bb187326a7968b62abe55c36a987a46
|
||||||
Firebase: c98c8b1fbcbdccd82539a36c2b17a9b1bb0ee798
|
Firebase: cc13dfab1038c8b45d7903e01fc690451d6d0b24
|
||||||
FirebaseABTesting: d07d0ee833b842d5153549e4c7e2e2cb1c23a3f9
|
FirebaseABTesting: d07d0ee833b842d5153549e4c7e2e2cb1c23a3f9
|
||||||
FirebaseAnalytics: 3dfae28d4a5e06f86c4fae830efc2ad3fadb19bc
|
FirebaseAnalytics: 3dfae28d4a5e06f86c4fae830efc2ad3fadb19bc
|
||||||
FirebaseAuth: d040bb7a9db6dfc29d0e7ec82d48be51352b2581
|
FirebaseAuth: 147bf340a0706b44ca1753d6b41ebafd9687cfe6
|
||||||
FirebaseCore: eb9e1a56733ff1094ecf3e28af9069c344b25239
|
FirebaseCore: b981f47e5254cbcfdeb483355300d743f6fcab2c
|
||||||
FirebaseCrash: cded0fc566c03651aea606a101bc156085f333ca
|
FirebaseCrash: cded0fc566c03651aea606a101bc156085f333ca
|
||||||
FirebaseDatabase: 5f0bc6134c5c237cf55f9e1249d406770a75eafd
|
FirebaseDatabase: 5f0bc6134c5c237cf55f9e1249d406770a75eafd
|
||||||
FirebaseDynamicLinks: 38b68641d24e78d0277a9205d988ce22875d5a25
|
FirebaseDynamicLinks: 38b68641d24e78d0277a9205d988ce22875d5a25
|
||||||
FirebaseFirestore: 9423ca756bbf77bfa3cd02fafc8027ae79da625a
|
FirebaseFirestore: 796df79c29cf8ecf806564f4d347665bdafa6ef0
|
||||||
FirebaseInstanceID: d2058a35e9bebda1b6dd42486b84917bde552a9d
|
FirebaseInstanceID: 8d20d890d65c917f9f7d9950b6e10a760ad34321
|
||||||
FirebaseInvites: ae15e0636f9eb42bdf5c1ef4c8f7bd4a88f9878b
|
FirebaseInvites: ae15e0636f9eb42bdf5c1ef4c8f7bd4a88f9878b
|
||||||
FirebaseMessaging: db0e01c52ef7e1f42846431273558107d084ede4
|
FirebaseMessaging: db0e01c52ef7e1f42846431273558107d084ede4
|
||||||
FirebasePerformance: 96c831a9eaf8d2ddf8bb37a4a6f6dd1b4bfe929f
|
FirebasePerformance: 96c831a9eaf8d2ddf8bb37a4a6f6dd1b4bfe929f
|
||||||
|
|
|
@ -118,7 +118,7 @@ const invitations = async () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
invitations();
|
// invitations();
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
apiKey: 'AIzaSyDnVqNhxU0Biit9nCo4RorAh5ulQQwko3E',
|
apiKey: 'AIzaSyDnVqNhxU0Biit9nCo4RorAh5ulQQwko3E',
|
||||||
|
|
|
@ -24,30 +24,25 @@ function linksTests({ describe, it, firebase, tryCatch }) {
|
||||||
const socialImageLink = 'test.imageUrl.com';
|
const socialImageLink = 'test.imageUrl.com';
|
||||||
|
|
||||||
it('create long dynamic link with all supported parameters', async () => {
|
it('create long dynamic link with all supported parameters', async () => {
|
||||||
const data = {
|
const dynamicLink = new firebase.native.links.DynamicLink(
|
||||||
link,
|
link,
|
||||||
dynamicLinkDomain,
|
dynamicLinkDomain
|
||||||
androidInfo: {
|
);
|
||||||
androidPackageName,
|
dynamicLink.android
|
||||||
androidFallbackLink,
|
.setPackageName(androidPackageName)
|
||||||
androidMinPackageVersionCode,
|
.android.setFallbackUrl(androidFallbackLink)
|
||||||
},
|
.android.setMinimumVersion(androidMinPackageVersionCode)
|
||||||
iosInfo: {
|
.ios.setBundleId(iosBundleId)
|
||||||
iosBundleId,
|
.ios.setFallbackUrl(iosFallbackLink)
|
||||||
iosFallbackLink,
|
.ios.setCustomScheme(iosCustomScheme)
|
||||||
iosCustomScheme,
|
.ios.setIPadFallbackUrl(iosIpadFallbackLink)
|
||||||
iosIpadFallbackLink,
|
.ios.setIPadBundleId(iosIpadBundleId)
|
||||||
iosIpadBundleId,
|
.ios.setAppStoreId(iosAppStoreId)
|
||||||
iosAppStoreId,
|
.social.setTitle(socialTitle)
|
||||||
},
|
.social.setDescriptionText(socialDescription)
|
||||||
socialMetaTagInfo: {
|
.social.setImageUrl(socialImageLink);
|
||||||
socialTitle,
|
|
||||||
socialDescription,
|
|
||||||
socialImageLink,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const result = await links.createDynamicLink(data);
|
const result = await links.createDynamicLink(dynamicLink);
|
||||||
|
|
||||||
const expectedParameters = {
|
const expectedParameters = {
|
||||||
sd: socialDescription,
|
sd: socialDescription,
|
||||||
|
@ -77,12 +72,12 @@ function linksTests({ describe, it, firebase, tryCatch }) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create long dynamic link with minimal parameters', async () => {
|
it('create long dynamic link with minimal parameters', async () => {
|
||||||
const data = {
|
const dynamicLink = new firebase.native.links.DynamicLink(
|
||||||
link,
|
link,
|
||||||
dynamicLinkDomain,
|
dynamicLinkDomain
|
||||||
};
|
);
|
||||||
|
|
||||||
const result = await links.createDynamicLink(data);
|
const result = await links.createDynamicLink(dynamicLink);
|
||||||
|
|
||||||
const url = new URL(result);
|
const url = new URL(result);
|
||||||
url.protocol.should.eql('https:');
|
url.protocol.should.eql('https:');
|
||||||
|
@ -91,29 +86,6 @@ function linksTests({ describe, it, firebase, tryCatch }) {
|
||||||
params.link.should.eql(link);
|
params.link.should.eql(link);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('fail to create long dynamic link with empty data object', () =>
|
|
||||||
new Promise((resolve, reject) => {
|
|
||||||
const success = tryCatch(() => {
|
|
||||||
// Assertion
|
|
||||||
reject(new Error('createDynamicLink did not fail.'));
|
|
||||||
}, reject);
|
|
||||||
|
|
||||||
const failure = tryCatch(error => {
|
|
||||||
// Assertion
|
|
||||||
error.message.should.equal('No dynamicLinkDomain was specified.');
|
|
||||||
resolve();
|
|
||||||
}, reject);
|
|
||||||
|
|
||||||
const data = {};
|
|
||||||
|
|
||||||
// Test
|
|
||||||
|
|
||||||
links
|
|
||||||
.createDynamicLink(data)
|
|
||||||
.then(success)
|
|
||||||
.catch(failure);
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('fail to create long dynamic link without link object', () =>
|
it('fail to create long dynamic link without link object', () =>
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
const success = tryCatch(() => {
|
const success = tryCatch(() => {
|
||||||
|
@ -123,16 +95,18 @@ function linksTests({ describe, it, firebase, tryCatch }) {
|
||||||
|
|
||||||
const failure = tryCatch(error => {
|
const failure = tryCatch(error => {
|
||||||
// Assertion
|
// Assertion
|
||||||
error.message.should.equal('No link was specified.');
|
error.message.should.equal(
|
||||||
|
'DynamicLink: Missing required `link` property'
|
||||||
|
);
|
||||||
resolve();
|
resolve();
|
||||||
}, reject);
|
}, reject);
|
||||||
|
|
||||||
const data = { dynamicLinkDomain };
|
const dynamicLink = new firebase.native.links.DynamicLink();
|
||||||
|
|
||||||
// Test
|
// Test
|
||||||
|
|
||||||
links
|
links
|
||||||
.createDynamicLink(data)
|
.createDynamicLink(dynamicLink)
|
||||||
.then(success)
|
.then(success)
|
||||||
.catch(failure);
|
.catch(failure);
|
||||||
}));
|
}));
|
||||||
|
@ -146,37 +120,34 @@ function linksTests({ describe, it, firebase, tryCatch }) {
|
||||||
|
|
||||||
const failure = tryCatch(error => {
|
const failure = tryCatch(error => {
|
||||||
// Assertion
|
// Assertion
|
||||||
error.message.should.equal('No iosBundleId was specified.');
|
error.message.should.equal(
|
||||||
|
'IOSParameters: Missing required `bundleId` property'
|
||||||
|
);
|
||||||
resolve();
|
resolve();
|
||||||
}, reject);
|
}, reject);
|
||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
const data = {
|
const dynamicLink = new firebase.native.links.DynamicLink(
|
||||||
link,
|
link,
|
||||||
dynamicLinkDomain,
|
dynamicLinkDomain
|
||||||
androidInfo: {
|
);
|
||||||
androidPackageName,
|
dynamicLink.android
|
||||||
androidFallbackLink,
|
.setPackageName(androidPackageName)
|
||||||
androidMinPackageVersionCode,
|
.android.setFallbackUrl(androidFallbackLink)
|
||||||
},
|
.android.setMinimumVersion(androidMinPackageVersionCode)
|
||||||
iosInfo: {
|
.ios.setFallbackUrl(iosFallbackLink)
|
||||||
iosFallbackLink,
|
.ios.setCustomScheme(iosCustomScheme)
|
||||||
iosCustomScheme,
|
.ios.setIPadFallbackUrl(iosIpadFallbackLink)
|
||||||
iosIpadFallbackLink,
|
.ios.setIPadBundleId(iosIpadBundleId)
|
||||||
iosIpadBundleId,
|
.ios.setAppStoreId(iosAppStoreId)
|
||||||
iosAppStoreId,
|
.social.setTitle(socialTitle)
|
||||||
},
|
.social.setDescriptionText(socialDescription)
|
||||||
socialMetaTagInfo: {
|
.social.setImageUrl(socialImageLink);
|
||||||
socialTitle,
|
|
||||||
socialDescription,
|
|
||||||
socialImageLink,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Test
|
// Test
|
||||||
|
|
||||||
links
|
links
|
||||||
.createDynamicLink(data)
|
.createDynamicLink(dynamicLink)
|
||||||
.then(success)
|
.then(success)
|
||||||
.catch(failure);
|
.catch(failure);
|
||||||
}));
|
}));
|
||||||
|
@ -190,198 +161,62 @@ function linksTests({ describe, it, firebase, tryCatch }) {
|
||||||
|
|
||||||
const failure = tryCatch(error => {
|
const failure = tryCatch(error => {
|
||||||
// Assertion
|
// Assertion
|
||||||
error.message.should.equal('No androidPackageName was specified.');
|
error.message.should.equal(
|
||||||
|
'AndroidParameters: Missing required `packageName` property'
|
||||||
|
);
|
||||||
resolve();
|
resolve();
|
||||||
}, reject);
|
}, reject);
|
||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
const data = {
|
const dynamicLink = new firebase.native.links.DynamicLink(
|
||||||
link,
|
link,
|
||||||
dynamicLinkDomain,
|
dynamicLinkDomain
|
||||||
androidInfo: {
|
);
|
||||||
androidFallbackLink,
|
dynamicLink.android
|
||||||
androidMinPackageVersionCode,
|
.setFallbackUrl(androidFallbackLink)
|
||||||
},
|
.android.setMinimumVersion(androidMinPackageVersionCode)
|
||||||
iosInfo: {
|
.ios.setBundleId(iosBundleId)
|
||||||
iosBundleId,
|
.ios.setFallbackUrl(iosFallbackLink)
|
||||||
iosFallbackLink,
|
.ios.setCustomScheme(iosCustomScheme)
|
||||||
iosCustomScheme,
|
.ios.setIPadFallbackUrl(iosIpadFallbackLink)
|
||||||
iosIpadFallbackLink,
|
.ios.setIPadBundleId(iosIpadBundleId)
|
||||||
iosIpadBundleId,
|
.ios.setAppStoreId(iosAppStoreId)
|
||||||
iosAppStoreId,
|
.social.setTitle(socialTitle)
|
||||||
},
|
.social.setDescriptionText(socialDescription)
|
||||||
socialMetaTagInfo: {
|
.social.setImageUrl(socialImageLink);
|
||||||
socialTitle,
|
|
||||||
socialDescription,
|
|
||||||
socialImageLink,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Test
|
// Test
|
||||||
|
|
||||||
links
|
links
|
||||||
.createDynamicLink(data)
|
.createDynamicLink(dynamicLink)
|
||||||
.then(success)
|
|
||||||
.catch(failure);
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('fail to create long dynamic link with unsupported parameter', () =>
|
|
||||||
new Promise((resolve, reject) => {
|
|
||||||
const success = tryCatch(() => {
|
|
||||||
// Assertion
|
|
||||||
reject(new Error('createDynamicLink did not fail.'));
|
|
||||||
}, reject);
|
|
||||||
|
|
||||||
const failure = tryCatch(error => {
|
|
||||||
// Assertion
|
|
||||||
error.message.should.equal('Invalid Parameters.');
|
|
||||||
resolve();
|
|
||||||
}, reject);
|
|
||||||
|
|
||||||
const data = {
|
|
||||||
link,
|
|
||||||
dynamicLinkDomain,
|
|
||||||
someInvalidParameter: 'invalid',
|
|
||||||
};
|
|
||||||
|
|
||||||
// Test
|
|
||||||
|
|
||||||
links
|
|
||||||
.createDynamicLink(data)
|
|
||||||
.then(success)
|
|
||||||
.catch(failure);
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('fail to create long dynamic link with unsupported ios parameters', () =>
|
|
||||||
new Promise((resolve, reject) => {
|
|
||||||
const success = tryCatch(() => {
|
|
||||||
// Assertion
|
|
||||||
reject(new Error('createDynamicLink did not fail.'));
|
|
||||||
}, reject);
|
|
||||||
|
|
||||||
const failure = tryCatch(error => {
|
|
||||||
// Assertion
|
|
||||||
error.message.should.equal('Invalid Parameters.');
|
|
||||||
resolve();
|
|
||||||
}, reject);
|
|
||||||
|
|
||||||
const data = {
|
|
||||||
link,
|
|
||||||
dynamicLinkDomain,
|
|
||||||
androidInfo: {
|
|
||||||
androidPackageName,
|
|
||||||
},
|
|
||||||
iosInfo: {
|
|
||||||
iosBundleId,
|
|
||||||
someInvalidParameter: 'invalid',
|
|
||||||
someOtherParameter: 'invalid',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Test
|
|
||||||
|
|
||||||
links
|
|
||||||
.createDynamicLink(data)
|
|
||||||
.then(success)
|
|
||||||
.catch(failure);
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('fail to create long dynamic link with unsupported android parameters', () =>
|
|
||||||
new Promise((resolve, reject) => {
|
|
||||||
const success = tryCatch(() => {
|
|
||||||
// Assertion
|
|
||||||
reject(new Error('createDynamicLink did not fail.'));
|
|
||||||
}, reject);
|
|
||||||
|
|
||||||
const failure = tryCatch(error => {
|
|
||||||
// Assertion
|
|
||||||
error.message.should.equal('Invalid Parameters.');
|
|
||||||
resolve();
|
|
||||||
}, reject);
|
|
||||||
|
|
||||||
const data = {
|
|
||||||
link,
|
|
||||||
dynamicLinkDomain,
|
|
||||||
androidInfo: {
|
|
||||||
androidPackageName,
|
|
||||||
someInvalidParameter: 'invalid',
|
|
||||||
someOtherParameter: 'invalid',
|
|
||||||
},
|
|
||||||
iosInfo: {
|
|
||||||
iosBundleId,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Test
|
|
||||||
|
|
||||||
links
|
|
||||||
.createDynamicLink(data)
|
|
||||||
.then(success)
|
|
||||||
.catch(failure);
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('fail to create long dynamic link with unsupported social parameters', () =>
|
|
||||||
new Promise((resolve, reject) => {
|
|
||||||
const success = tryCatch(() => {
|
|
||||||
// Assertion
|
|
||||||
reject(new Error('createDynamicLink did not fail.'));
|
|
||||||
}, reject);
|
|
||||||
|
|
||||||
const failure = tryCatch(error => {
|
|
||||||
// Assertion
|
|
||||||
error.message.should.equal('Invalid Parameters.');
|
|
||||||
resolve();
|
|
||||||
}, reject);
|
|
||||||
|
|
||||||
const data = {
|
|
||||||
link,
|
|
||||||
dynamicLinkDomain,
|
|
||||||
androidInfo: {
|
|
||||||
androidPackageName,
|
|
||||||
},
|
|
||||||
iosInfo: {
|
|
||||||
iosBundleId,
|
|
||||||
},
|
|
||||||
socialMetaTagInfo: {
|
|
||||||
someInvalidParameter: 'invalid',
|
|
||||||
someOtherParameter: 'invalid',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Test
|
|
||||||
|
|
||||||
links
|
|
||||||
.createDynamicLink(data)
|
|
||||||
.then(success)
|
.then(success)
|
||||||
.catch(failure);
|
.catch(failure);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('create short (unguessable) dynamic link with all supported parameters', async () => {
|
it('create short (unguessable) dynamic link with all supported parameters', async () => {
|
||||||
const url = 'https://www.google.co.il/search?q=react+native+firebase';
|
const url = 'https://www.google.co.il/search?q=react+native+firebase';
|
||||||
const data = {
|
const dynamicLink = new firebase.native.links.DynamicLink(
|
||||||
link: url,
|
url,
|
||||||
dynamicLinkDomain,
|
dynamicLinkDomain
|
||||||
androidInfo: {
|
);
|
||||||
androidPackageName,
|
dynamicLink.android
|
||||||
androidFallbackLink,
|
.setPackageName(androidPackageName)
|
||||||
androidMinPackageVersionCode,
|
.android.setFallbackUrl(androidFallbackLink)
|
||||||
},
|
.android.setMinimumVersion(androidMinPackageVersionCode)
|
||||||
iosInfo: {
|
.ios.setBundleId(iosBundleId)
|
||||||
iosBundleId,
|
.ios.setFallbackUrl(iosFallbackLink)
|
||||||
iosFallbackLink,
|
.ios.setCustomScheme(iosCustomScheme)
|
||||||
iosCustomScheme,
|
.ios.setIPadFallbackUrl(iosIpadFallbackLink)
|
||||||
iosIpadFallbackLink,
|
.ios.setIPadBundleId(iosIpadBundleId)
|
||||||
iosIpadBundleId,
|
.ios.setAppStoreId(iosAppStoreId)
|
||||||
iosAppStoreId,
|
.social.setTitle(socialTitle)
|
||||||
},
|
.social.setDescriptionText(socialDescription)
|
||||||
socialMetaTagInfo: {
|
.social.setImageUrl(socialImageLink);
|
||||||
socialTitle,
|
|
||||||
socialDescription,
|
|
||||||
socialImageLink,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const result = await links.createShortDynamicLink(data);
|
const result = await links.createShortDynamicLink(
|
||||||
|
dynamicLink,
|
||||||
|
'UNGUESSABLE'
|
||||||
|
);
|
||||||
result.should.startWith(`https://${dynamicLinkDomain}`);
|
result.should.startWith(`https://${dynamicLinkDomain}`);
|
||||||
|
|
||||||
const response = await fetch(result);
|
const response = await fetch(result);
|
||||||
|
@ -390,42 +225,35 @@ function linksTests({ describe, it, firebase, tryCatch }) {
|
||||||
|
|
||||||
it('create short (short) dynamic link with all supported parameters', async () => {
|
it('create short (short) dynamic link with all supported parameters', async () => {
|
||||||
const url = 'https://www.google.co.il/search?q=react+native+firebase';
|
const url = 'https://www.google.co.il/search?q=react+native+firebase';
|
||||||
const data = {
|
const dynamicLink = new firebase.native.links.DynamicLink(
|
||||||
link: url,
|
url,
|
||||||
dynamicLinkDomain,
|
dynamicLinkDomain
|
||||||
androidInfo: {
|
);
|
||||||
androidPackageName,
|
dynamicLink.android
|
||||||
androidFallbackLink,
|
.setPackageName(androidPackageName)
|
||||||
androidMinPackageVersionCode,
|
.android.setFallbackUrl(androidFallbackLink)
|
||||||
},
|
.android.setMinimumVersion(androidMinPackageVersionCode)
|
||||||
iosInfo: {
|
.ios.setBundleId(iosBundleId)
|
||||||
iosBundleId,
|
.ios.setFallbackUrl(iosFallbackLink)
|
||||||
iosFallbackLink,
|
.ios.setCustomScheme(iosCustomScheme)
|
||||||
iosCustomScheme,
|
.ios.setIPadFallbackUrl(iosIpadFallbackLink)
|
||||||
iosIpadFallbackLink,
|
.ios.setIPadBundleId(iosIpadBundleId)
|
||||||
iosIpadBundleId,
|
.ios.setAppStoreId(iosAppStoreId)
|
||||||
iosAppStoreId,
|
.social.setTitle(socialTitle)
|
||||||
},
|
.social.setDescriptionText(socialDescription)
|
||||||
socialMetaTagInfo: {
|
.social.setImageUrl(socialImageLink);
|
||||||
socialTitle,
|
|
||||||
socialDescription,
|
|
||||||
socialImageLink,
|
|
||||||
},
|
|
||||||
suffix: {
|
|
||||||
option: 'SHORT',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const result = await links.createShortDynamicLink(data);
|
const result = await links.createShortDynamicLink(dynamicLink, 'SHORT');
|
||||||
result.should.startWith(`https://${dynamicLinkDomain}`);
|
result.should.startWith(`https://${dynamicLinkDomain}`);
|
||||||
|
|
||||||
const response = await fetch(result);
|
const response = await fetch(result);
|
||||||
url.should.eql(response.url);
|
url.should.eql(response.url);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('getInitialLink should return null', async () => {
|
it('getInitialLink should return null or undefined', async () => {
|
||||||
const initialLink = await links.getInitialLink();
|
// TODO: iOS returns undefined, Android returns null
|
||||||
should(initialLink).be.null();
|
// const initialLink = await links.getInitialLink();
|
||||||
|
// should(initialLink).be.undefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should listen to link', () => {
|
it('should listen to link', () => {
|
||||||
|
|
|
@ -1,53 +1,40 @@
|
||||||
function messagingTests({ describe, it, firebase }) {
|
function messagingTests({ describe, it, firebase }) {
|
||||||
describe('FCM', () => {
|
describe('FCM', () => {
|
||||||
it('it should build a RemoteMessage', () => {
|
it('it should build a RemoteMessage', () => {
|
||||||
const remoteMessage = new firebase.native.messaging.RemoteMessage(
|
const remoteMessage = new firebase.native.messaging.RemoteMessage();
|
||||||
'305229645282'
|
remoteMessage.setTo('305229645282');
|
||||||
);
|
|
||||||
|
|
||||||
// all optional
|
// all optional
|
||||||
remoteMessage.setId('foobar');
|
remoteMessage.setMessageId('foobar');
|
||||||
remoteMessage.setTtl(12000);
|
remoteMessage.setTtl(12000);
|
||||||
remoteMessage.setType('something');
|
remoteMessage.setMessageType('something');
|
||||||
remoteMessage.setData({
|
remoteMessage.setData({
|
||||||
object: { foo: 'bar ' },
|
|
||||||
array: [1, 2, 3, 4, 5],
|
|
||||||
string: 'hello',
|
string: 'hello',
|
||||||
boolean: true,
|
|
||||||
number: 123456,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// return json object so we can assert values
|
// return json object so we can assert values
|
||||||
const mOutput = remoteMessage.toJSON();
|
const mOutput = remoteMessage.build();
|
||||||
|
|
||||||
mOutput.id.should.equal('foobar');
|
mOutput.messageId.should.equal('foobar');
|
||||||
mOutput.ttl.should.equal(12000);
|
mOutput.ttl.should.equal(12000);
|
||||||
mOutput.type.should.equal('something');
|
mOutput.messageType.should.equal('something');
|
||||||
mOutput.data.should.be.a.Object();
|
mOutput.data.should.be.a.Object();
|
||||||
|
|
||||||
// all data types should be a string as this is all that native accepts
|
// all data types should be a string as this is all that native accepts
|
||||||
mOutput.data.object.should.equal('[object Object]');
|
|
||||||
mOutput.data.array.should.equal('1,2,3,4,5');
|
|
||||||
mOutput.data.string.should.equal('hello');
|
mOutput.data.string.should.equal('hello');
|
||||||
mOutput.data.number.should.equal('123456');
|
|
||||||
|
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should send a RemoteMessage', () => {
|
it('should send a RemoteMessage', () => {
|
||||||
const remoteMessage = new firebase.native.messaging.RemoteMessage(
|
const remoteMessage = new firebase.native.messaging.RemoteMessage();
|
||||||
'305229645282'
|
remoteMessage.setTo('305229645282');
|
||||||
);
|
|
||||||
|
|
||||||
// all optional
|
// all optional
|
||||||
remoteMessage.setId('foobar');
|
remoteMessage.setMessageId('foobar');
|
||||||
remoteMessage.setTtl(12000);
|
remoteMessage.setTtl(12000);
|
||||||
remoteMessage.setType('something');
|
remoteMessage.setMessageType('something');
|
||||||
remoteMessage.setData({
|
remoteMessage.setData({
|
||||||
object: { foo: 'bar ' },
|
|
||||||
array: [1, 2, 3, 4, 5],
|
|
||||||
string: 'hello',
|
string: 'hello',
|
||||||
number: 123456,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
firebase.native.messaging().sendMessage(remoteMessage);
|
firebase.native.messaging().sendMessage(remoteMessage);
|
||||||
|
@ -66,60 +53,6 @@ function messagingTests({ describe, it, firebase }) {
|
||||||
.then(successCb);
|
.then(successCb);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('it should build a RemoteMessage', () => {
|
|
||||||
const remoteMessage = new firebase.native.messaging.RemoteMessage(
|
|
||||||
'305229645282'
|
|
||||||
);
|
|
||||||
|
|
||||||
// all optional
|
|
||||||
remoteMessage.setId('foobar');
|
|
||||||
remoteMessage.setTtl(12000);
|
|
||||||
remoteMessage.setType('something');
|
|
||||||
remoteMessage.setData({
|
|
||||||
object: { foo: 'bar ' },
|
|
||||||
array: [1, 2, 3, 4, 5],
|
|
||||||
string: 'hello',
|
|
||||||
boolean: true,
|
|
||||||
number: 123456,
|
|
||||||
});
|
|
||||||
|
|
||||||
// return json object so we can assert values
|
|
||||||
const mOutput = remoteMessage.toJSON();
|
|
||||||
|
|
||||||
mOutput.id.should.equal('foobar');
|
|
||||||
mOutput.ttl.should.equal(12000);
|
|
||||||
mOutput.type.should.equal('something');
|
|
||||||
mOutput.data.should.be.a.Object();
|
|
||||||
|
|
||||||
// all data types should be a string as this is all that native accepts
|
|
||||||
mOutput.data.object.should.equal('[object Object]');
|
|
||||||
mOutput.data.array.should.equal('1,2,3,4,5');
|
|
||||||
mOutput.data.string.should.equal('hello');
|
|
||||||
mOutput.data.number.should.equal('123456');
|
|
||||||
|
|
||||||
return Promise.resolve();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('it should send a RemoteMessage', () => {
|
|
||||||
const remoteMessage = new firebase.native.messaging.RemoteMessage(
|
|
||||||
'305229645282'
|
|
||||||
);
|
|
||||||
|
|
||||||
// all optional
|
|
||||||
remoteMessage.setId('foobar');
|
|
||||||
remoteMessage.setTtl(12000);
|
|
||||||
remoteMessage.setType('something');
|
|
||||||
remoteMessage.setData({
|
|
||||||
object: { foo: 'bar ' },
|
|
||||||
array: [1, 2, 3, 4, 5],
|
|
||||||
string: 'hello',
|
|
||||||
number: 123456,
|
|
||||||
});
|
|
||||||
|
|
||||||
firebase.native.messaging().sendMessage(remoteMessage);
|
|
||||||
return Promise.resolve();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('it should create/remove onTokenRefresh listeners', () => {
|
it('it should create/remove onTokenRefresh listeners', () => {
|
||||||
try {
|
try {
|
||||||
const unsub = firebase.native.messaging().onTokenRefresh(() => {});
|
const unsub = firebase.native.messaging().onTokenRefresh(() => {});
|
||||||
|
@ -138,13 +71,10 @@ function messagingTests({ describe, it, firebase }) {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('it should show a notification', () => {
|
it('it should show a notification', () => {
|
||||||
firebase.native.messaging().createLocalNotification({
|
const notification = new firebase.native.notifications.Notification();
|
||||||
title: 'Hello',
|
notification.setBody('My Notification Message').setTitle('Hello');
|
||||||
body: 'My Notification Message',
|
notification.android.setChannelId('test');
|
||||||
big_text: "Is it me you're looking for?",
|
firebase.native.notifications().displayNotification(notification);
|
||||||
sub_text: 'nope',
|
|
||||||
show_in_foreground: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue