Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Added partial Android FCM support (#975)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jcesarmobile authored and macdonst committed May 24, 2017
1 parent c258e80 commit e2c2f3f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 9 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:amazon="http://schemas.android.com/apk/lib/com.amazon.device.ads" xmlns:rim="http://www.blackberry.com/ns/widgets" id="phonegap-plugin-push" version="2.0.0-rc2">
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:amazon="http://schemas.android.com/apk/lib/com.amazon.device.ads"
xmlns:rim="http://www.blackberry.com/ns/widgets"
id="phonegap-plugin-push"
version="2.0.0">

<name>PushPlugin</name>
<description>
This plugin allows your application to receive push notifications on Android, iOS and Windows devices.
Expand Down Expand Up @@ -96,4 +102,4 @@
<preference name="WindowsToastCapable" value="true"/>
</config-file>
</platform>
</plugin>
</plugin>
5 changes: 4 additions & 1 deletion src/android/com/adobe/phonegap/push/PushPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,10 @@ private void subscribeToTopics(JSONArray topics, String registrationToken) {
String topic = null;
for (int i=0; i<topics.length(); i++) {
topic = topics.optString(i, null);
subscribeToTopic(topic, registrationToken);
if (topic != null) {
Log.d(LOG_TAG, "Subscribing to topic: " + topic);
FirebaseMessaging.getInstance().subscribeToTopic(topic);
}
}
}
}
Expand Down

0 comments on commit e2c2f3f

Please sign in to comment.