Skip to content

Commit f0f93ea

Browse files
committed
style(lint): yarn lint:js --fix && yarn lint:ios:fix && yarn lint:android
1 parent c389481 commit f0f93ea

File tree

7 files changed

+87
-70
lines changed

7 files changed

+87
-70
lines changed

packages/dynamic-links/android/src/main/java/io/invertase/firebase/dynamiclinks/ReactNativeFirebaseDynamicLinksModule.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,18 @@ private DynamicLink.Builder createDynamicLinkBuilder(final ReadableMap dynamicLi
291291
buildNavigationParameters(dynamicLinkMap.getMap("navigation"), builder);
292292
}
293293

294-
if (dynamicLinkMap.hasKey("otherPlatform")) {
295-
if (dynamicLinkMap.getMap("otherPlatform").hasKey("fallbackUrl")) {
296-
String OTHER_PLATFORM_LINK_KEY = "ofl";
297-
String linkUrl = String.valueOf(builder.buildDynamicLink().getUri());
298-
linkUrl += '&' + OTHER_PLATFORM_LINK_KEY + '=' + dynamicLinkMap.getMap("otherPlatform").getString("fallbackUrl");
299-
builder.setLongLink(Uri.parse(linkUrl));
300-
}
301-
}
294+
if (dynamicLinkMap.hasKey("otherPlatform")) {
295+
if (dynamicLinkMap.getMap("otherPlatform").hasKey("fallbackUrl")) {
296+
String OTHER_PLATFORM_LINK_KEY = "ofl";
297+
String linkUrl = String.valueOf(builder.buildDynamicLink().getUri());
298+
linkUrl +=
299+
'&'
300+
+ OTHER_PLATFORM_LINK_KEY
301+
+ '='
302+
+ dynamicLinkMap.getMap("otherPlatform").getString("fallbackUrl");
303+
builder.setLongLink(Uri.parse(linkUrl));
304+
}
305+
}
302306

303307
return builder;
304308
}

packages/dynamic-links/e2e/builder.otherplatform.e2e.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ describe('dynamicLinks() dynamicLinkParams.otherPlatform', function () {
2424
});
2525
return Promise.reject(new Error('Did not throw Error.'));
2626
} catch (e) {
27-
e.message.should.containEql("'dynamicLinksParams.otherPlatform.fallbackUrl' must be a string");
27+
e.message.should.containEql(
28+
"'dynamicLinksParams.otherPlatform.fallbackUrl' must be a string",
29+
);
2830
return Promise.resolve();
2931
}
3032
});

packages/dynamic-links/ios/RNFBDynamicLinks/RNFBDynamicLinksModule.m

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ - (FIRDynamicLinkComponents *)createDynamicLinkComponents:(NSDictionary *)dynami
276276
[self buildItunesParameters:dynamicLinkDict[@"itunes"] components:linkComponents];
277277
[self buildNavigationParameters:dynamicLinkDict[@"navigation"] components:linkComponents];
278278
[self buildSocialParameters:dynamicLinkDict[@"social"] components:linkComponents];
279-
[self buildOtherPlatformParameters:dynamicLinkDict[@"otherPlatform"] components:linkComponents];
279+
[self buildOtherPlatformParameters:dynamicLinkDict[@"otherPlatform"] components:linkComponents];
280280

281281
return linkComponents;
282282
}
@@ -421,16 +421,16 @@ - (void)buildSocialParameters:(NSDictionary *)socialDict
421421
}
422422

423423
- (void)buildOtherPlatformParameters:(NSDictionary *)otherDict
424-
components:(FIRDynamicLinkComponents *)linkComponents {
425-
if (otherDict == nil) return;
426-
427-
FIRDynamicLinkOtherPlatformParameters *otherParams =
428-
[FIRDynamicLinkOtherPlatformParameters parameters];
429-
if (otherDict[@"fallbackUrl"]) {
430-
otherParams.fallbackUrl = [NSURL URLWithString:otherDict[@"fallbackUrl"]];
431-
}
432-
linkComponents.otherPlatformParameters = otherParams;
433-
}
424+
components:(FIRDynamicLinkComponents *)linkComponents {
425+
if (otherDict == nil) return;
426+
427+
FIRDynamicLinkOtherPlatformParameters *otherParams =
428+
[FIRDynamicLinkOtherPlatformParameters parameters];
429+
if (otherDict[@"fallbackUrl"]) {
430+
otherParams.fallbackUrl = [NSURL URLWithString:otherDict[@"fallbackUrl"]];
431+
}
432+
linkComponents.otherPlatformParameters = otherParams;
433+
}
434434

435435
- (NSArray<NSString *> *)supportedEvents {
436436
return @[];

packages/dynamic-links/lib/builder.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,17 @@ export default function build(dynamicLinksParams) {
2929
throw new Error("'dynamicLinksParams' must be an object.");
3030
}
3131

32-
const { link, domainUriPrefix, android, analytics, ios, itunes, navigation, social, otherPlatform } =
33-
dynamicLinksParams;
32+
const {
33+
link,
34+
domainUriPrefix,
35+
android,
36+
analytics,
37+
ios,
38+
itunes,
39+
navigation,
40+
social,
41+
otherPlatform,
42+
} = dynamicLinksParams;
3443

3544
if (!link) {
3645
throw new Error("missing required 'link' property.");
@@ -88,9 +97,9 @@ export default function build(dynamicLinksParams) {
8897
params.social = buildSocial(social);
8998
}
9099

91-
if (otherPlatform) {
92-
params.otherPlatform = buildOtherPlatform(otherPlatform);
93-
}
100+
if (otherPlatform) {
101+
params.otherPlatform = buildOtherPlatform(otherPlatform);
102+
}
94103

95104
return params;
96105
}
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import { isObject, isString } from '@react-native-firebase/app/lib/common';
22

3-
export default function buildOtherPlatform(otherPlatformParameters) {
4-
if (!isObject(otherPlatformParameters)) {
5-
throw new Error("'dynamicLinksParams.otherPlatform' must be an object.");
6-
}
3+
export default function buildOtherPlatform(otherPlatformParameters) {
4+
if (!isObject(otherPlatformParameters)) {
5+
throw new Error("'dynamicLinksParams.otherPlatform' must be an object.");
6+
}
77

8-
const params = {}
8+
const params = {};
99

10-
if (otherPlatformParameters.fallbackUrl) {
11-
if (!isString(otherPlatformParameters.fallbackUrl)) {
12-
throw new Error("'dynamicLinksParams.otherPlatform.fallbackUrl' must be a string.");
13-
}
10+
if (otherPlatformParameters.fallbackUrl) {
11+
if (!isString(otherPlatformParameters.fallbackUrl)) {
12+
throw new Error("'dynamicLinksParams.otherPlatform.fallbackUrl' must be a string.");
13+
}
1414

15-
params.fallbackUrl = otherPlatformParameters.fallbackUrl;
16-
}
15+
params.fallbackUrl = otherPlatformParameters.fallbackUrl;
16+
}
1717

18-
return params
19-
}
18+
return params;
19+
}

packages/dynamic-links/lib/index.d.ts

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -302,32 +302,31 @@ export namespace FirebaseDynamicLinksTypes {
302302
title?: string;
303303
}
304304

305-
/**
306-
* The DynamicLinkOtherPlatformParameters interface provides functionality to
307-
* open a custom URL on platforms beside Android and iOS. This is useful to
308-
* specify a different behavior on desktop, like displaying a full web page
309-
* of the app content/payload (as specified by param link) with another dynamic
310-
* link to install the app.
311-
*
312-
* #### Example
313-
*
314-
* ```js
315-
* const link = await firebase.dynamicLinks().buildLink({
316-
* link: 'https://invertase.io',
317-
* domainUriPrefix: 'https://xyz.page.link',
318-
* otherPlatform: {
319-
* fallbackUrl: 'https://www.google.com/',
320-
* }
321-
* });
322-
* ```
323-
*/
324-
export interface DynamicLinkOtherPlatformParameters {
325-
/**
326-
* The URL to open on desktop.
327-
*/
328-
fallbackUrl?: string;
329-
}
330-
305+
/**
306+
* The DynamicLinkOtherPlatformParameters interface provides functionality to
307+
* open a custom URL on platforms beside Android and iOS. This is useful to
308+
* specify a different behavior on desktop, like displaying a full web page
309+
* of the app content/payload (as specified by param link) with another dynamic
310+
* link to install the app.
311+
*
312+
* #### Example
313+
*
314+
* ```js
315+
* const link = await firebase.dynamicLinks().buildLink({
316+
* link: 'https://invertase.io',
317+
* domainUriPrefix: 'https://xyz.page.link',
318+
* otherPlatform: {
319+
* fallbackUrl: 'https://www.google.com/',
320+
* }
321+
* });
322+
* ```
323+
*/
324+
export interface DynamicLinkOtherPlatformParameters {
325+
/**
326+
* The URL to open on desktop.
327+
*/
328+
fallbackUrl?: string;
329+
}
331330

332331
/**
333332
* The DynamicLinkParameters interface provides access to the Dynamic Link builder classes
@@ -387,10 +386,10 @@ export namespace FirebaseDynamicLinksTypes {
387386
*/
388387
social?: DynamicLinkSocialParameters;
389388

390-
/**
391-
* Access other platform specific link parameters.
392-
*/
393-
otherPlatform?: DynamicLinkOtherPlatformParameters
389+
/**
390+
* Access other platform specific link parameters.
391+
*/
392+
otherPlatform?: DynamicLinkOtherPlatformParameters;
394393
}
395394

396395
/**

packages/messaging/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingModule.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ public void setDeliveryMetricsExportToBigQuery(Boolean enabled, Promise promise)
232232
.addOnCompleteListener(
233233
task -> {
234234
if (task.isSuccessful()) {
235-
promise.resolve(FirebaseMessaging.getInstance().deliveryMetricsExportToBigQueryEnabled());
235+
promise.resolve(
236+
FirebaseMessaging.getInstance().deliveryMetricsExportToBigQueryEnabled());
236237
} else {
237238
rejectPromiseWithExceptionMap(promise, task.getException());
238239
}
@@ -243,7 +244,9 @@ public void setDeliveryMetricsExportToBigQuery(Boolean enabled, Promise promise)
243244
public Map<String, Object> getConstants() {
244245
final Map<String, Object> constants = new HashMap<>();
245246
constants.put("isAutoInitEnabled", FirebaseMessaging.getInstance().isAutoInitEnabled());
246-
constants.put("isDeliveryMetricsExportToBigQueryEnabled", FirebaseMessaging.getInstance().deliveryMetricsExportToBigQueryEnabled());
247+
constants.put(
248+
"isDeliveryMetricsExportToBigQueryEnabled",
249+
FirebaseMessaging.getInstance().deliveryMetricsExportToBigQueryEnabled());
247250
return constants;
248251
}
249252

0 commit comments

Comments
 (0)