Skip to content

Commit 112f5c5

Browse files
committed
some bugs fixed!
1 parent 50874c9 commit 112f5c5

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ An Android Library to send Firebase notifications to users easily.
2222
* Step 2. Add the dependency
2323
```java
2424
dependencies {
25-
compile 'com.github.iammannan:EasyNotifyLibProject:1.1'
25+
compile 'com.github.iammannan:EasyNotifyLibProject:1.2'
2626
}
2727
```
2828

app/src/main/java/com/msoftworks/easynotifyapp/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ public boolean onOptionsItemSelected(MenuItem item) {
9292
private void callEasyNotify() {
9393
EasyNotify easyNotify = new EasyNotify(api_key.getText().toString());
9494
easyNotify.setSendBy(EasyNotify.TOPIC);
95+
easyNotify.setTopic(topic.getText().toString());
9596
easyNotify.setTitle(title.getText().toString());
9697
easyNotify.setBody(body.getText().toString());
97-
easyNotify.setTopic(topic.getText().toString());
9898
easyNotify.setClickAction(click_action.getText().toString());
9999
easyNotify.setSound(sound.getText().toString());
100100
easyNotify.nPush();

easynotify/src/main/java/com/msoftworks/easynotify/EasyNotify.java

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@
1919

2020
public class EasyNotify {
2121

22+
private String ntitle = "title";
23+
private String nbody = "body";
24+
private String nclick_action = "MAINACTIVITY";
25+
private String ntopic = "allDevices";
26+
private String ntoken = "A0CALSKNLKAS45CLKSC655";
27+
private String nsound = "default";
28+
private String sendBy = TOPIC;
29+
private String API_KEY;
30+
31+
public static String TOPIC = "SEND_BY_TOPIC";
32+
public static String TOKEN = "SEND_BY_TOKEN";
33+
34+
private JSONObject notificationObject;
35+
private JSONObject dataObject;
36+
private JSONObject bodyObject;
37+
2238
public void setTitle(String ntitle) {
2339
this.ntitle = ntitle;
2440
}
@@ -35,6 +51,10 @@ public void setTopic(String ntopic) {
3551
this.ntopic = ntopic;
3652
}
3753

54+
public void setToken(String ntoken) {
55+
this.ntoken = ntoken;
56+
}
57+
3858
public void setSound(String nsound) {
3959
this.nsound = nsound;
4060
}
@@ -43,23 +63,6 @@ public void setSendBy(String sendBy) {
4363
this.sendBy = sendBy;
4464
}
4565

46-
private String ntitle = "title";
47-
private String nbody = "body";
48-
private String nclick_action = "MAINACTIVITY";
49-
private String ntopic = "allDevices";
50-
private String ntoken = "A0CALSKNLKAS45CLKSC655";
51-
private String nsound = "default";
52-
private String sendBy = TOPIC;
53-
private String API_KEY;
54-
55-
public static String TOPIC = "SEND_BY_TOPIC";
56-
public static String TOKEN = "SEND_BY_TOKEN";
57-
58-
private JSONObject notificationObject;
59-
private JSONObject dataObject;
60-
private JSONObject bodyObject;
61-
62-
6366
private void sendNotification() throws IOException, JSONException {
6467
OkHttpClient client = new OkHttpClient();
6568

0 commit comments

Comments
 (0)