Skip to content

Commit

Permalink
Removed description
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorholk committed Oct 3, 2020
1 parent d5498d7 commit 6c4653f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public void onResponse(JSONObject response) {
int code = response.getInt("status");
if (code == 200){
String title = response.getJSONObject("data").getString("title");
String description = response.getJSONObject("data").getString("description");
apiNotification(title,description);
String text = response.getJSONObject("data").getString("text");
apiNotification(title, text);
}

} catch (JSONException e){
Expand Down Expand Up @@ -115,7 +115,7 @@ private void foregroundNotification(){
startForeground(2, notification);
}

private void apiNotification(String title, String description){
private void apiNotification(String title, String text){
NotificationChannel channel = new NotificationChannel(notificationChannelIdAPI, "Push Notifications", NotificationManager.IMPORTANCE_HIGH);
channel.setDescription("Channel for all APN API notifications");

Expand All @@ -125,7 +125,8 @@ private void apiNotification(String title, String description){
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, notificationChannelIdAPI)
.setSmallIcon(R.drawable.ic_launcher_foreground)
.setContentTitle(title)
.setContentText(description)
.setStyle(new NotificationCompat.BigTextStyle())
.setContentText(text)
.setPriority(NotificationCompat.DEFAULT_ALL);

notificationManager.notify(1, builder.build());
Expand Down
7 changes: 4 additions & 3 deletions api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ def index():
if not request.json == None:
if not 'title' in request.json:
return decorate_response(400, "Not a valid title", "")
if not 'description' in request.json:
return decorate_response(400, 'Not a valid description', "")

if not 'text' in request.json:
return decorate_response(400, 'Not a valid text', "")

data = {
'title': request.json['title'],
'description': request.json['description']
'text': request.json['text']
}


Expand Down

0 comments on commit 6c4653f

Please sign in to comment.