Skip to content

Commit aeb281b

Browse files
Merge branch 'master' into ui/localizations
2 parents 803144a + 3ab283b commit aeb281b

File tree

357 files changed

+17570
-3358
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+17570
-3358
lines changed
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
name: iOS background message handling bug report for Firebase Messaging
2+
description:
3+
Create an issue specific to receiving Firebase Messaging messages in the background on iOS.
4+
title: "[firebase_messaging]: <YOUR TITLE HERE>"
5+
labels: ["Needs Attention", "type: bug", "plugin: messaging", "platform: ios"]
6+
body:
7+
- type: checkboxes
8+
attributes:
9+
label: Is there an existing issue for this?
10+
description: |
11+
Please search to see if an issue already exists for the bug you encountered.
12+
options:
13+
- label: I have searched the existing issues.
14+
required: true
15+
16+
- type: markdown
17+
attributes:
18+
value: |
19+
---
20+
- type: checkboxes
21+
attributes:
22+
label: Are you aware of the differences between iOS and Android background message handling?
23+
description: |
24+
iOS adopts a more aggressive policy to throttling background messages. Android is a lot more lenient, even when the app is in a terminated state, it is highly likely that
25+
messages will be received by the device and processed by the Firebase Messaging background handler. This is not the case with iOS. There are multiple reasons why your messages
26+
may not be received by the device. Here are just a few reasons that are weighed by the iOS system in the decision to throttle your messages:
27+
1. Low battery
28+
2. High CPU usage
29+
3. Too many messages received
30+
4. App is in a terminated or background state
31+
5. Data-only messages are considered lower priority than notification messages
32+
options:
33+
- label: I understand that iOS and Android background messages behave differently, and I've designed my application with that in mind.
34+
required: true
35+
36+
- type: markdown
37+
attributes:
38+
value: |
39+
---
40+
- type: checkboxes
41+
attributes:
42+
label: Do you have an active Apple Developer account?
43+
description: |
44+
An [Apple Developer account](https://developer.apple.com/membercenter/index.action) is required.
45+
options:
46+
- label: I have an active Apple Developer account.
47+
required: true
48+
49+
- type: markdown
50+
attributes:
51+
value: |
52+
---
53+
54+
- type: checkboxes
55+
attributes:
56+
label: Are you using a physical iOS device to test background messages?
57+
description: |
58+
A physical device is required, background messages will not work on a simulator.
59+
options:
60+
- label: I am using a physical iOS device to test background messages.
61+
required: true
62+
63+
- type: markdown
64+
attributes:
65+
value: |
66+
---
67+
68+
- type: textarea
69+
attributes:
70+
label: Have you enabled "Remote Notifications" & "Background Mode" (Checking options for "Background Processing" & "Remote Notifications") in your app's Xcode project?
71+
description: |
72+
Find out how to enable "Remote Notifications" & "Background Mode" in the [documentation](https://firebase.google.com/docs/cloud-messaging/flutter/client#enable_app_capabilities_in_xcode).
73+
74+
<details>
75+
<summary>Click to see how your Xcode project "Signing and Capabilities" settings should look like</summary>
76+
<img alt="Xcode "Signing and Capabilities tab" src="./../images/remote-notifications-enable.png?raw=true" />
77+
</details>
78+
79+
REQUIRED: Please provide a screenshot of your Xcode project "Signing and capabilities" settings in the text area.
80+
validations:
81+
required: true
82+
83+
- type: markdown
84+
attributes:
85+
value: |
86+
---
87+
88+
- type: textarea
89+
attributes:
90+
label: Have you created an APNs key in your Apple Developer account & uploaded this APNs key to your Firebase console?
91+
description: |
92+
You have to create an APNs key in your [Apple Developer account](https://developer.apple.com/membercenter/index.action) & upload this APNs key to your [Firebase console](https://console.firebase.google.com). [See documentation](https://firebase.google.com/docs/cloud-messaging/flutter/client#upload_your_apns_authentication_key).
93+
94+
<details>
95+
<summary>Click to see how an APNs key uploaded to the correct app in the Firebase console should look like</summary>
96+
<img alt="APNs key uploaded to Firebase console" src="./../images/apns-key-upload.png?raw=true" />
97+
</details>
98+
99+
REQUIRED: Please provide a screenshot of your APNs key showing as uploaded in the Firebase console for your app in the text area below (as show in the example above).
100+
validations:
101+
required: true
102+
103+
- type: markdown
104+
attributes:
105+
value: |
106+
---
107+
108+
- type: textarea
109+
attributes:
110+
label: Have you disabled method swizzling for Firebase in your app?
111+
description: |
112+
Firebase Messaging will not work if you disable method swizzling. Please remove or set to `YES` the `FirebaseAppDelegateProxyEnabled` property in your `ios/Info.plist` file if it exists.
113+
114+
REQUIRED: Please paste your `ios/Info.plist` file in the text area.
115+
validations:
116+
required: true
117+
118+
- type: markdown
119+
attributes:
120+
value: |
121+
---
122+
123+
- type: textarea
124+
attributes:
125+
label: Are you sending messages to your app from the Firebase Admin SDK?
126+
description: |
127+
For an example of sending messages to your app, please see [FlutterFire's nodejs Firebase Admin SDK script](https://github.com/firebase/flutterfire/blob/master/packages/firebase_messaging/firebase_messaging/example/scripts/send-message.js). FlutterFire does not support sending messages from 3rd party packages.
128+
129+
It is essential you include the `contentAvailable` flag in your message payload when sending messages to your app from the Firebase Admin SDK.
130+
131+
Example code snippet for using the Node.js Firebase Admin SDK to send a message to your app
132+
```js
133+
admin
134+
.messaging()
135+
.sendToDevice(
136+
[token],
137+
{
138+
data: {
139+
foo:'bar',
140+
},
141+
notification: {
142+
title: 'A great title',
143+
body: 'Great content',
144+
},
145+
},
146+
{
147+
// Required for background/terminated app state messages on iOS
148+
contentAvailable: true,
149+
}
150+
)
151+
```
152+
153+
REQUIRED: Please paste a code snippet that you're using to send messages to your app from the Firebase Admin SDK in the text area below.
154+
validations:
155+
required: true
156+
157+
- type: markdown
158+
attributes:
159+
value: |
160+
---
161+
162+
- type: checkboxes
163+
attributes:
164+
label: Have you requested permission from the user to receive notifications?
165+
description: |
166+
You need to request permission from your user to receive notifications using the following API:
167+
```dart
168+
FirebaseMessaging messaging = FirebaseMessaging.instance;
169+
170+
NotificationSettings settings = await messaging.requestPermission(
171+
alert: true,
172+
announcement: false,
173+
badge: true,
174+
carPlay: false,
175+
criticalAlert: false,
176+
provisional: false,
177+
sound: true,
178+
);
179+
180+
print('User granted permission: ${settings.authorizationStatus}');
181+
```
182+
183+
options:
184+
- label: I have the relevant permission to receive notifications.
185+
required: true
186+
187+
- type: markdown
188+
attributes:
189+
value: |
190+
---
191+
192+
- type: textarea
193+
attributes:
194+
label: Have you used the 'Console' application on your macOS device to check if the iOS device's system is throttling your background messages?
195+
description: |
196+
To check the status of your push notification, please follow the steps below.
197+
1. Open the `Console` app on your Mac
198+
2. Select your iPhone from the devices list on the left hand side
199+
3. Filter messages by typing in your Bundle ID (e.g. The Firebase Messaging example app bundle ID is 'io.flutter.plugins.firebase.messaging') into the search box and pressing enter.
200+
4. Press the clear button to clean the history.
201+
5. Now send the message to your device
202+
6. Select all the rows on the logs & copy them, Cmd + C (not available on right-click menu)
203+
204+
[Example of successfully delivered data-only background message](https://github.com/firebase/flutterfire/blob/master/.github/images/ios-background-message-delivered.png)
205+
[Example of unsuccessfully delivered data-only background message](https://github.com/firebase/flutterfire/blob/master/.github/images/ios-background-message-not-delivered.png)
206+
207+
REQUIRED: Please paste your logs from the above steps in the text area so we can see if a message was delivered but not received by the background message handler.
208+
validations:
209+
required: true
210+
211+
- type: markdown
212+
attributes:
213+
value: |
214+
---
215+
216+
- type: textarea
217+
id: comments
218+
attributes:
219+
label: Additional context and comments
220+
description: |
221+
Anything else you want to add for this issue?

.github/images/apns-key-upload.png

251 KB
Loading

.github/images/firebase-logo.png

17.5 KB
Loading
726 KB
Loading
289 KB
Loading
229 KB
Loading

.github/workflows/all_plugins.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ jobs:
6060
- uses: actions/checkout@v2
6161
- name: 'Install Flutter'
6262
run: ./.github/workflows/scripts/install-flutter.sh stable
63+
# See https://github.com/actions/runner-images/issues/6283
64+
- name: Add Homebrew to PATH
65+
run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
66+
shell: bash
6367
- name: 'Install Tools'
6468
run: |
6569
./.github/workflows/scripts/install-tools.sh

.github/workflows/e2e_tests.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,6 @@ jobs:
178178
FLUTTER_DRIVE_EXIT_CODE=$?
179179
xcrun simctl shutdown "$SIMULATOR"
180180
exit $FLUTTER_DRIVE_EXIT_CODE
181-
- name: "Swift Format Check"
182-
if: ${{ success() || failure() }}
183-
run: |
184-
swiftformat .
185-
./.github/workflows/scripts/validate-formatting.sh
186181
187182
macos:
188183
runs-on: macos-latest
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"projects": {
3-
"default": "flutterfire-e2e-tests"
4-
}
5-
}
3+
"default": "flutterfire-e2e-tests",
4+
"react-native-firebase-testing": "react-native-firebase-testing"
5+
},
6+
"targets": {}
7+
}

.github/workflows/scripts/firebase.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"firestore": {
3-
"rules": "firestore.rules"
3+
"rules": "firestore.rules",
4+
"indexes": "firestore.indexes.json"
45
},
56
"database": {
67
"rules": "database.rules.json"

0 commit comments

Comments
 (0)