Skip to content

Commit 8a181a4

Browse files
author
Alexandre Saddour
committed
Not implementing notification displayer anymore
+ clean
1 parent 99e998f commit 8a181a4

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
package com.dimelo.sampleapp;
22

33
import android.app.IntentService;
4-
import android.app.PendingIntent;
5-
import android.content.Context;
64
import android.content.Intent;
75
import android.os.Bundle;
8-
import android.support.annotation.NonNull;
9-
import android.support.v4.app.TaskStackBuilder;
106

11-
import com.dimelo.dimelosdk.main.ChatActivity;
127
import com.dimelo.dimelosdk.main.Dimelo;
138
import com.google.android.gms.gcm.GoogleCloudMessaging;
149

@@ -23,14 +18,13 @@ protected void onHandleIntent(Intent intent) {
2318
Bundle extras = intent.getExtras();
2419
GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this);
2520
String messageType = gcm.getMessageType(intent);
26-
2721
if (!extras.isEmpty()) { // has effect of unparcelling Bundle
2822
if (GoogleCloudMessaging.MESSAGE_TYPE_SEND_ERROR.equals(messageType)
2923
|| GoogleCloudMessaging.MESSAGE_TYPE_DELETED.equals(messageType)){
3024
// An error occured
3125
}
3226
else if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
33-
if (Dimelo.consumeReceivedRemoteNotification(this, extras, notifDisplayer)){
27+
if (Dimelo.consumeReceivedRemoteNotification(this, extras, null)){
3428
// Cool !
3529
}
3630
else {
@@ -41,17 +35,4 @@ else if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
4135
// Release the wake lock provided by the WakefulBroadcastReceiver.
4236
GcmBroadcastReceiver.completeWakefulIntent(intent);
4337
}
44-
45-
Dimelo.BasicNotificationDisplayer notifDisplayer = new Dimelo.BasicNotificationDisplayer() {
46-
47-
@Override
48-
public @NonNull PendingIntent createPendingIntent(Context context, String message) {
49-
return TaskStackBuilder.create(GcmIntentService.this)
50-
.addParentStack(ChatActivity.class)
51-
.addNextIntent(new Intent(context, ChatActivity.class).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP))
52-
.getPendingIntent(1, PendingIntent.FLAG_CANCEL_CURRENT);
53-
}
54-
55-
};
56-
5738
}

DimeloSampleApp/app/src/main/java/com/dimelo/sampleapp/MainActivity.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ else if (error.statusCode == DimeloConnection.DimeloError.TIMEOUT_ERROR){
6969
};
7070

7171
private void setupDimelo(){
72-
String secret = "e3e5d064186207607a0095a40faa2cfe79cfc756799773f088a37cdc8a804a60";
73-
// String secret = "YOUR_SECRET";
72+
String secret = ""; // YOUR_SECRET
7473
Dimelo.setup(this);
7574
Dimelo dimelo = Dimelo.getInstance();
7675
dimelo.setApiSecret(secret);

0 commit comments

Comments
 (0)