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

Commit

Permalink
Refactor GCMIntentService to FCMService
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst committed Nov 28, 2016
1 parent 084d078 commit d6e01cf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<activity android:name="com.adobe.phonegap.push.PushHandlerActivity" android:exported="true"/>
<receiver android:name="com.adobe.phonegap.push.BackgroundActionButtonHandler"/>
<service
android:name="com.adobe.phonegap.push.GCMIntentService">
android:name="com.adobe.phonegap.push.FCMService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
Expand All @@ -70,7 +70,7 @@
<framework src="me.leolin:ShortcutBadger:1.1.11@aar"/>
<framework src="com.google.firebase:firebase-messaging:9+" />

<source-file src="src/android/com/adobe/phonegap/push/GCMIntentService.java" target-dir="src/com/adobe/phonegap/push/" />
<source-file src="src/android/com/adobe/phonegap/push/FCMService.java" target-dir="src/com/adobe/phonegap/push/" />
<source-file src="src/android/com/adobe/phonegap/push/PushConstants.java" target-dir="src/com/adobe/phonegap/push/" />
<source-file src="src/android/com/adobe/phonegap/push/PushHandlerActivity.java" target-dir="src/com/adobe/phonegap/push/" />
<source-file src="src/android/com/adobe/phonegap/push/PushInstanceIDListenerService.java" target-dir="src/com/adobe/phonegap/push/" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void onReceive(Context context, Intent intent) {
int notId = intent.getIntExtra(NOT_ID, 0);
Log.d(LOG_TAG, "not id = " + notId);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(GCMIntentService.getAppName(context), notId);
notificationManager.cancel(FCMService.getAppName(context), notId);

if (extras != null) {
Bundle originalExtras = extras.getBundle(PUSH_BUNDLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import java.util.Random;

@SuppressLint("NewApi")
public class GCMIntentService extends FirebaseMessagingService implements PushConstants {
public class FCMService extends FirebaseMessagingService implements PushConstants {

private static final String LOG_TAG = "PushPlugin_FCMService";
private static HashMap<Integer, ArrayList<String>> messageMap = new HashMap<Integer, ArrayList<String>>();
Expand Down
4 changes: 2 additions & 2 deletions src/android/com/adobe/phonegap/push/PushHandlerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PushHandlerActivity extends Activity implements PushConstants {
*/
@Override
public void onCreate(Bundle savedInstanceState) {
GCMIntentService gcm = new GCMIntentService();
FCMService gcm = new FCMService();

Intent intent = getIntent();

Expand All @@ -37,7 +37,7 @@ public void onCreate(Bundle savedInstanceState) {

if(!startOnBackground){
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(GCMIntentService.getAppName(this), notId);
notificationManager.cancel(FCMService.getAppName(this), notId);
}

Log.d(LOG_TAG, "bringToForeground = " + foreground);
Expand Down

0 comments on commit d6e01cf

Please sign in to comment.