-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(firebase_messaging):
getInitialMessage
returns notification onc…
…e & only if pressed for `iOS`. (#7634)
- Loading branch information
1 parent
fb64643
commit 85739b4
Showing
4 changed files
with
84 additions
and
57 deletions.
There are no files selected for viewing
46 changes: 0 additions & 46 deletions
46
packages/firebase_messaging/firebase_messaging/example/lib/firebase_config.dart
This file was deleted.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
packages/firebase_messaging/firebase_messaging/example/lib/firebase_options.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// File generated by FlutterFire CLI. | ||
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; | ||
import 'package:flutter/foundation.dart' | ||
show defaultTargetPlatform, kIsWeb, TargetPlatform; | ||
|
||
class DefaultFirebaseOptions { | ||
static FirebaseOptions get currentPlatform { | ||
if (kIsWeb) { | ||
return web; | ||
} | ||
// ignore: missing_enum_constant_in_switch | ||
switch (defaultTargetPlatform) { | ||
case TargetPlatform.android: | ||
return android; | ||
case TargetPlatform.iOS: | ||
return ios; | ||
case TargetPlatform.macOS: | ||
return macos; | ||
} | ||
|
||
throw UnsupportedError( | ||
'DefaultFirebaseOptions are not supported for this platform.', | ||
); | ||
} | ||
|
||
static const FirebaseOptions web = FirebaseOptions( | ||
apiKey: 'AIzaSyAgUhHU8wSJgO5MVNy95tMT07NEjzMOfz0', | ||
appId: '1:448618578101:web:a8ebc6ab724e6baaac3efc', | ||
messagingSenderId: '448618578101', | ||
projectId: 'react-native-firebase-testing', | ||
authDomain: 'react-native-firebase-testing.firebaseapp.com', | ||
databaseURL: 'https://react-native-firebase-testing.firebaseio.com', | ||
storageBucket: 'react-native-firebase-testing.appspot.com', | ||
measurementId: 'G-RF9GF9MQ1F', | ||
); | ||
|
||
static const FirebaseOptions android = FirebaseOptions( | ||
apiKey: 'AIzaSyCuu4tbv9CwwTudNOweMNstzZHIDBhgJxA', | ||
appId: '1:448618578101:android:0568e76dc62e89bcac3efc', | ||
messagingSenderId: '448618578101', | ||
projectId: 'react-native-firebase-testing', | ||
databaseURL: 'https://react-native-firebase-testing.firebaseio.com', | ||
storageBucket: 'react-native-firebase-testing.appspot.com', | ||
); | ||
|
||
static const FirebaseOptions ios = FirebaseOptions( | ||
apiKey: 'AIzaSyAHAsf51D0A407EklG1bs-5wA7EbyfNFg0', | ||
appId: '1:448618578101:ios:0b11ed8263232715ac3efc', | ||
messagingSenderId: '448618578101', | ||
projectId: 'react-native-firebase-testing', | ||
databaseURL: 'https://react-native-firebase-testing.firebaseio.com', | ||
storageBucket: 'react-native-firebase-testing.appspot.com', | ||
androidClientId: | ||
'448618578101-a9p7bj5jlakabp22fo3cbkj7nsmag24e.apps.googleusercontent.com', | ||
iosClientId: | ||
'448618578101-evbjdqq9co9v29pi8jcua8bm7kr4smuu.apps.googleusercontent.com', | ||
iosBundleId: 'io.flutter.plugins.firebase.messaging', | ||
); | ||
|
||
static const FirebaseOptions macos = FirebaseOptions( | ||
apiKey: 'AIzaSyAHAsf51D0A407EklG1bs-5wA7EbyfNFg0', | ||
appId: '1:448618578101:ios:0b11ed8263232715ac3efc', | ||
messagingSenderId: '448618578101', | ||
projectId: 'react-native-firebase-testing', | ||
databaseURL: 'https://react-native-firebase-testing.firebaseio.com', | ||
storageBucket: 'react-native-firebase-testing.appspot.com', | ||
androidClientId: | ||
'448618578101-a9p7bj5jlakabp22fo3cbkj7nsmag24e.apps.googleusercontent.com', | ||
iosClientId: | ||
'448618578101-evbjdqq9co9v29pi8jcua8bm7kr4smuu.apps.googleusercontent.com', | ||
iosBundleId: 'io.flutter.plugins.firebase.messaging', | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85739b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In iOS(14.4), when the app is in the terminate\force close state and device receives a push notification, the onBackgroundMessage and getInitialMessage both gets called, though user has not tapped on the notification. Hope this is not the expected behaviour.
85739b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can confirm what @GKPK commented. in iOS (15.4) getInitialMessage gets called when opening the app even when I don't tap the notification.