[firebase_messaging] Add support for handling messages in background for iOS#53
Closed
genert wants to merge 5 commits intofirebase:masterfrom
Closed
[firebase_messaging] Add support for handling messages in background for iOS#53genert wants to merge 5 commits intofirebase:masterfrom
genert wants to merge 5 commits intofirebase:masterfrom
Conversation
Author
|
This was largely based on @athornz solution. Please give it a look. |
4 tasks
Author
|
Update: I will work on this tomorrow. |
14 tasks
|
Any chance that this can be merged soon? |
|
BTW, I'm getting this exception when trying to run the sample: Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryM objectAtIndexedSubscript:]: unrecognized selector sent to instance 0x60000296cd20'
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 681.5.1 - Device: iPhone 11 Pro Max (850D6B32-240C-42D5-961F-CB2F0A2D9C70) - Runtime: iOS 13.0 (17A577a) - DeviceType: iPhone 11 Pro Max
Application Specific Backtrace 1:
0 CoreFoundation 0x00007fff23b98bde __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23bb9704 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff23b9d7bc ___forwarding___ + 1436
4 CoreFoundation 0x00007fff23b9f6c8 _CF_forwarding_prep_0 + 120
5 Runner 0x0000000105c38eea -[FLTFirebaseMessagingPlugin handleMethodCall:result:] + 858
6 Flutter 0x0000000107a8f4fd __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 104
7 Flutter 0x0000000107a28ec0 _ZNK7flutter21PlatformMessageRouter21HandlePlatformMessageEN3fml6RefPtrINS_15PlatformMessageEEE + 166
8 Flutter 0x0000000107a2c780 _ZN7flutter15PlatformViewIOS21HandlePlatformMessageEN3fml6RefPtrINS_15PlatformMessageEEE + 38
9 Flutter 0x0000000107a89db3 _ZNSt3__110__function6__funcIZN7flutter5Shell29OnEngineHandlePlatformMessageEN3fml6RefPtrINS2_15PlatformMessageEEEE4$_31NS_9allocatorIS8_EEFvvEEclEv + 57
10 Flutter 0x0000000107a3b3f1 _ZN3fml15MessageLoopImpl10FlushTasksENS_9FlushTypeE + 123
11 Flutter 0x0000000107a40742 _ZN3fml17MessageLoopDarwin11OnTimerFireEP16__CFRunLoopTimerPS0_ + 26
12 CoreFoundation 0x00007fff23afc1e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
13 CoreFoundation 0x00007fff23afbed2 __CFRunLoopDoTimer + 1026
14 CoreFoundation 0x00007fff23afb52a __CFRunLoopDoTimers + 266
15 CoreFoundation 0x00007fff23af629e __CFRunLoopRun + 2238
16 CoreFoundation 0x00007fff23af56b6 CFRunLoopRunSpecific + 438
17 GraphicsServices 0x00007fff3815cbb0 GSEventRunModal + 65
18 UIKitCore 0x00007fff47162a67 UIApplicationMain + 1621
19 Runner 0x0000000105b36db0 main + 112
20 libdyld.dylib 0x00007fff5123bcf5 start + 1(my myBackgroundMessageHandler is static, so that shouldn't be causing it) |
Author
|
We ended up rolling native part for handling Firebase messaging due business logic requirements. Thus I have not worked on this. Perhaps, someone can take over or create a new one. |
This was referenced Oct 22, 2019
mudi256
reviewed
Oct 24, 2019
| ``` | ||
| <application android:name=".Application" ...> | ||
| ``` | ||
| 1. For iOS (Swift) |
There was a problem hiding this comment.
where to add this code in ios? like android we create an Application class
Contributor
|
So is this PR dead? |
Author
|
@athornz Yes, we went with native solution instead (APNs with notification service extension). Will close this now, feel free to work on this. |
13 tasks
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When Flutter app is in the background or terminated allow it to handle incoming FCM messages. When the application starts an additional background channel is started to handle incoming messages when the app is not in the foreground.
Related Issues
See #47
Remaining work
TODOs before this can be merged