This repository has been archived by the owner on Jun 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 152
Firebase Cloud Messaging support #141
Open
siwymilek
wants to merge
7
commits into
richsage:master
Choose a base branch
from
siwymilek:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a06bbbf
Firebase Cloud Messaging integration
siwymilek 1a66f98
Fix typo in README.md
siwymilek 519a0ec
Remove dump
siwymilek 9340543
Define parameters
siwymilek 6368983
Suggestions from @richsage
320a34f
All parameters should be initialized.
ac376ed
Check each parameter.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# RMSPushNotificationsBundle ![](https://secure.travis-ci.org/richsage/RMSPushNotificationsBundle.png) | ||
|
||
A bundle to allow sending of push notifications to mobile devices. Currently supports Android (C2DM, GCM), Blackberry and iOS devices. | ||
A bundle to allow sending of push notifications to mobile devices. Currently supports Android (C2DM, GCM, FCM), Blackberry and iOS devices. | ||
|
||
## Installation | ||
|
||
|
@@ -44,6 +44,9 @@ only be available if you provide configuration respectively for them. | |
api_key: <string_android_gcm_api_key> # This is titled "Server Key" when creating it | ||
use_multi_curl: <boolean_android_gcm_use_multi_curl> # default is true | ||
dry_run: <bool_use_gcm_dry_run> | ||
fcm: | ||
api_key: <string_android_fcm_api_key> # This is titled "Server Key" when creating it | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not that familiar with FCM - is the comment still relevant here about "Server Key" being how the Firebase control panels name the API key? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's still called "Server Key" |
||
use_multi_curl: <boolean_android_fcm_use_multi_curl> # default is true | ||
ios: | ||
timeout: 60 # Seconds to wait for connection timeout, default is 60 | ||
sandbox: <bool_use_apns_sandbox> | ||
|
@@ -62,7 +65,7 @@ only be available if you provide configuration respectively for them. | |
windowsphone: | ||
timeout: 5 # Seconds to wait for connection timeout, default is 5 | ||
|
||
NOTE: If you are using Windows, you may need to set the Android GCM `use_multi_curl` flag to false for GCM messages to be sent correctly. | ||
NOTE: If you are using Windows, you may need to set the Android GCM/FCM `use_multi_curl` flag to false for GCM/FCM messages to be sent correctly. | ||
|
||
Timeout defaults are the defaults from prior to the introduction of this configuration value. | ||
|
||
|
@@ -89,15 +92,15 @@ A little example of how to push your first message to an iOS device, we'll assum | |
The send method will detect the type of message so if you'll pass it an `AndroidMessage` it will automatically send it through the C2DM/GCM servers, and likewise for Mac and Blackberry. | ||
|
||
## Android messages | ||
|
||
Since both C2DM and GCM are still available, the `AndroidMessage` class has a small flag on it to toggle which service to send it to. Use as follows: | ||
You have a choice of three services, C2DM, GCM and FCM. C2DM is defined as main option, but the `AndroidMessage` class has flags to toggle which service to send it to. | ||
|
||
use RMS\PushNotificationsBundle\Message\AndroidMessage; | ||
|
||
$message = new AndroidMessage(); | ||
$message->setGCM(true); | ||
|
||
to send as a GCM message rather than C2DM. | ||
You may choose `setGCM` or `setFCM` - this is optional. | ||
|
||
$message->setFCM(true); | ||
|
||
## iOS Feedback service | ||
|
||
|
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
Oops, something went wrong.
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.
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.
I'm not sure on the reasoning behind this.
If the user is not interested in GCM configuration (for example, they are only using iOS push notifications), this forces them to supply configuration options. That is why the conditional check is in place, to enable them to leave out the android.gcm key and similar (see the
Configuration
class which permits the key to be unset/not supplied if not needed).Commenting this check out will force the user to supply dummy details. Therefore I'd like this to be left in.
This is the same for the FCM change on line 108.