Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 7f36b60

Browse files
Aligned a few property names
1 parent 5329910 commit 7f36b60

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

demo-push/app/push-view-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class PushViewModel extends Observable {
3434
title: "We'd like to send notifications",
3535
message: "Do you agree? Please do, we won't spam you. Promised.",
3636
okButtonText: "Yep!",
37-
cancelButtonText: "Nooo"
37+
cancelButtonText: "Maybe later"
3838
}).then(pushAllowed => {
3939
if (pushAllowed) {
4040
applicationSettings.setBoolean(PushViewModel.APP_REGISTERED_FOR_NOTIFICATIONS, true);

docs/MESSAGING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ Similarly to the message callback you can either wire this through `init` or as
114114

115115
By default, this plugin will display a notification every time it receives one. If you want to disable this
116116
behaviour and handle the notifications yourself on the `onMessageReceivedCallback`, you need to set the
117-
`displayNotifications` option to `false`:
117+
`showNotifications` option to `false`:
118118

119119
```js
120120
firebase.init({
121-
displayNotifications: false,
121+
showNotifications: false,
122122
});
123123
```
124124

@@ -130,11 +130,11 @@ This might be helpful too if you or some other plugin you use is already setting
130130
### Always show notifications when the application is in foreground
131131

132132
If you always want to display notifications while the application is in foreground withouth sending additional
133-
parameters/data when sending the push notification, you need to set the `showWhenInForeground` option to `true`:
133+
parameters/data when sending the push notification, you need to set the `showNotificationsWhenInForeground` option to `true`:
134134

135135
```js
136136
firebase.init({
137-
showWhenInForeground: true,
137+
showNotificationsWhenInForeground: true,
138138
});
139139
```
140140

src/firebase.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ export interface InitOptions {
118118
onMessageReceivedCallback?: (data: Message) => void;
119119

120120
/**
121-
* For FCM. Whether you want this plugin to automatically display the notifications or just notify the callback.
121+
* For Messaging (Push Notifications). Whether you want this plugin to automatically display the notifications or just notify the callback.
122122
*/
123-
displayNotifications: boolean;
123+
showNotifications: boolean;
124124

125125
/**
126-
* For FCM. Whether you want this plugin to always handle the notifications when the app is in foreground.
126+
* For Messaging (Push Notifications). Whether you want this plugin to always handle the notifications when the app is in foreground.
127127
*/
128-
showWhenInForeground: boolean;
128+
showNotificationsWhenInForeground: boolean;
129129

130130
/**
131131
* Get notified when a dynamic link was used to launch the app. Alternatively use addOnDynamicLinkReceivedCallback.

src/messaging/messaging.ios.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ let _registerForRemoteNotificationsRanThisSession = false;
2020
let _userNotificationCenterDelegate: UNUserNotificationCenterDelegateImpl;
2121
let _messagingConnected: boolean = null;
2222
let _firebaseRemoteMessageDelegate: FIRMessagingDelegateImpl;
23-
let _displayNotifications: boolean = true;
24-
let _showWhenInForeground: boolean = false;
23+
let _showNotifications: boolean = true;
24+
let _showNotificationsWhenInForeground: boolean = false;
2525

2626
// Track whether or not registration for remote notifications was request.
2727
// This way we can suppress the "Allow notifications" consent popup until the listeners are passed in.
2828
const NOTIFICATIONS_REGISTRATION_KEY = "Firebase-RegisterForRemoteNotifications";
2929

3030
export function initFirebaseMessaging(arg) {
31-
_displayNotifications = arg.displayNotifications === undefined ? _displayNotifications : !!arg.displayNotifications;
32-
_showWhenInForeground = arg.showWhenInForeground === undefined ? _showWhenInForeground : !!arg.showWhenInForeground;
31+
_showNotifications = arg.showNotifications === undefined ? _showNotifications : !!arg.showNotifications;
32+
_showNotificationsWhenInForeground = arg.showNotificationsWhenInForeground === undefined ? _showNotificationsWhenInForeground : !!arg.showNotificationsWhenInForeground;
3333

3434
if (arg.onMessageReceivedCallback !== undefined || arg.onPushTokenReceivedCallback !== undefined) {
3535
if (arg.onMessageReceivedCallback !== undefined) {
@@ -393,7 +393,7 @@ function _registerForRemoteNotifications() {
393393
}
394394
});
395395

396-
if (_displayNotifications) {
396+
if (_showNotifications) {
397397
_userNotificationCenterDelegate = UNUserNotificationCenterDelegateImpl.new().initWithCallback((unnotification, actionIdentifier?, inputText?) => {
398398
// if the app is in the foreground then this method will receive the notification
399399
// if the app is in the background, and user has responded to interactive notification, then this method will receive the notification
@@ -551,7 +551,7 @@ class UNUserNotificationCenterDelegateImpl extends NSObject implements UNUserNot
551551
const userInfo = notification.request.content.userInfo;
552552
const userInfoJSON = firebaseUtils.toJsObject(userInfo);
553553

554-
if ( _showWhenInForeground || // Default value, in case we always want to show when in foreground.
554+
if (_showNotificationsWhenInForeground || // Default value, in case we always want to show when in foreground.
555555
userInfoJSON["gcm.notification.showWhenInForeground"] === "true" || // This is for FCM, ...
556556
userInfoJSON["showWhenInForeground"] === true || // ...this is for non-FCM...
557557
(userInfoJSON.aps && userInfoJSON.aps.showWhenInForeground === true) // ...and this as well (so users can choose where to put it).

0 commit comments

Comments
 (0)