-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Merge v2.0.x into master #1736
Merge v2.0.x into master #1736
Conversation
* Modified plugin.xml to include FCM changes * Plugin.xml changes for FCM * Java changes for FCM * Increased plugin version to 2.0.0 * Increased plugin version in package.json * Added topic subscription/unsubscription * Removed some empty lines
…ction call for action buttons
One of the forks of the
Should the examples on payload be changed accordingly? Docs on the new official node.js API is here |
Should we subtly advise use of |
@fredgalvao ES6 is only baked in on iOS 10, unfortunately (without transpilers). cordova-ios still supports ios 9. |
@shazron The examples are in the context of a node.js server to send the payloads, not in the webview itself. |
@fredgalvao gotcha, I thought you were talking about the client side example |
I can't read Objective-C without it hurting my brain, so I can't help on that. Overall, there seems to be a few merge-originated regressions on plugin.xml and that one Most of the stuff I commented on on the docs are chore, and can be left for another PR. |
I'm getting this error when submitting to the Apple App store:
Found in: |
@tlaverdure Looks like we can't include the full GTM suite, and just use subspecs of it. We will have to discover which ones, but definitely none of the UnitTesting ones.
Looks like it could just be Logger: https://github.com/CocoaPods/Specs/blob/23b07bd380c1e829caf2663182e3be87ace02785/Specs/2/d/6/FirebaseMessaging/1.2.1/FirebaseMessaging.podspec.json#L35 |
I removed the Lots of similar issues: https://www.google.com/search?q=library+not+found+for+lGoogleToolboxForMac&oq=library+not+found+for+lGoogleToolboxForMac&aqs=chrome..69i57.3654j0j7&sourceid=chrome&ie=UTF-8 |
I tested this again on the v2.0.x plugin without the GoogleToolboxForMac
|
I was planning on testing FirebaseMessaging 2.0.0 |
@fredgalvao can you create an issue to update the docs for ES6 and using the supported way of sending FCM messages from node? Tag it to the v2.0.0 release. |
Okay |
`android.icon` | `string` | | Optional. The name of a drawable resource to use as the small-icon. The name should not include the extension. | ||
`android.iconColor` | `string` | | Optional. Sets the background color of the small icon on Android 5.0 and greater. [Supported Formats](http://developer.android.com/reference/android/graphics/Color.html#parseColor(java.lang.String)) | ||
`android.sound` | `boolean` | `true` | Optional. If `true` it plays the sound specified in the push data or the default system sound. | ||
`android.vibrate` | `boolean` | `true` | Optional. If `true` the device vibrates on receipt of notification. | ||
`android.clearBadge` | `boolean` | `false` | Optional. If `true` the icon badge will be cleared on init and before push messages are processed. | ||
`android.clearNotifications` | `boolean` | `true` | Optional. If `true` the app clears all pending notifications when it is closed. | ||
`android.forceShow` | `boolean` | `false` | Optional. Controls the behavior of the notification when app is in foreground. If `true` and app is in foreground, it will show a notification in the notification drawer, the same way as when the app is in background (and `on('notification')` callback will be called *only when the user clicks the notification*). When `false` and app is in foreground, the `on('notification')` callback will be called immediately. | ||
`android.topics` | `array` | `[]` | Optional. If the array contains one or more strings each string will be used to subscribe to a GcmPubSub topic. Note: you should omit the `/topics/` prefix from each element of the array as the plugin will handle that for you. | ||
`android.topics` | `array` | `[]` | Optional. If the array contains one or more strings each string will be used to subscribe to a FcmPubSub topic. | ||
`/topics/` prefix from each element of the array as the plugin will handle that for you. |
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.
This looks like an accidental line break. (edit) Or maybe this line was supposed to be removed too?
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.
It was supposed to be removed. I will fix this in a commit shortly.
`ios.topics` | `array` | `[]` | Optional. If the array contains one or more strings each string will be used to subscribe to a GcmPubSub topic. Note: only usable in conjunction with `senderID`. Note: you should omit the `/topics/` prefix from each element of the array as the plugin will handle that for you. | ||
`ios.fcmSandbox` | `boolean` | `false` | Whether to use prod or sandbox GCM setting. Defaults to false. | ||
options | ||
`ios.topics` | `array` | `[]` | Optional. If the array contains one or more strings each string will be used to subscribe to a FcmPubSub topic. |
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.
Either the /topics
thing needs to come back here, or it needs to go away on the android section above.
If you are not creating an Android application you can put in anything for this value. | ||
``` | ||
<platform name="android"> | ||
<resource-file src="google-services.json" target="google-services.json" /> |
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.
Is this target
needed in this example?
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.
Doesn't hurt :)
title: 'AUX Scrum', | ||
message: 'Scrum: Daily touchbase @ 10am Please be on time so we can cover everything on the agenda.', | ||
actions: [ | ||
{ "icon": "emailGuests", "title": "EMAIL GUESTS", "callback": "app.emailGuests", "foreground": true}, |
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.
No need to quote those nested keys, might as well leave unquoted for homogeneity.
data: { | ||
title: 'Force Start', | ||
message: 'This notification should restart the app', | ||
force-start: '1' |
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.
This key actually needs to be quoted, otherwise this won't compile.
"cordova": ">100" | ||
"cordova-ios": ">=4.4.0", | ||
"cordova-android": ">=6.2.1", | ||
"cordova": ">=6.4.0" | ||
} |
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.
Having a block pointing to the distant future "cordova": ">100"
is healthy afaik, we should create a new one for 3.0 or 2.1 on that.
<platform name="android"> | ||
<hook type="before_plugin_install" src="scripts/copyAndroidFile.js"/> |
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.
Do we still need this? If I read that script right, it only adds a framework dependency, which can be done through framework tags themselves.
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.
Yeah, it's still needed as the classpath "com.google.gms:google-services:3.0.0" has to end up in the buildscript dependencies section. This will screw us up for PGB.
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.
Isn't this something that can be achieved with a custom framework tag to gradle?
</config-file> | ||
<config-file target="AndroidManifest.xml" parent="/manifest/application"> | ||
<activity android:name="com.adobe.phonegap.push.PushHandlerActivity" android:exported="true" android:permission="${applicationId}.permission.PushHandlerActivity"/> | ||
<activity android:name="com.adobe.phonegap.push.PushHandlerActivity" android:exported="true"/> |
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.
This might be a bit too late or mistaken, but why was the custom permission removed? It fixed conflicts of duplicated providers when multiple applications with the same plugin were present, and afaik that issue can still happen on 2.0.
<js-module src="src/windows/PushPluginProxy.js" name="PushPlugin"> | ||
<runs/> | ||
<merges target=""/> |
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.
This and the setToastCapable
above seem to have been lost accidentally. Losing those changes are a regression afaik.
String refreshedToken = FirebaseInstanceId.getInstance().getToken(); | ||
Log.d(LOG_TAG, "Refreshed token: " + refreshedToken); | ||
// TODO: Implement this method to send any registration to your app's servers. | ||
//sendRegistrationToServer(refreshedToken); |
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.
Is this TODO
supposed to have survived? How is the tokenRefresh
event being cascaded into webview-land now?
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.
Yeah, that todo should stick around for now. We should fire the registration event if this happens.
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.
By "we should" you mean when this TODO
gets implemented, right? I'm trying to understand what's happening and what should happen with this TODO in place. Otherwise we need to update the docs to mention that tokenRefresh
won't trigger a registration
event anymore.
I misunderstood how github reviews acted on the comments left on changes, and it seems all the comments I had made were being held until I submitted the review. Sorry for that. @macdonst can you take a look at them? It's too late with the merge, but we can always create new issues for the ones that are agreed upon. |
@fredgalvao I went through your comments. Lots of good catches there, thanks! Will push a commit in a moment. |
This thread has been automatically locked. |
Hey all,
I want to move the 2.0.x branch into master as I'm getting tired of all of these rebases and I want to release this thing soon. Please take a look over this PR.
I've pushed the latest master branch to
v1.x
so we can do bug fixes there if required.